From 9f899c5e6d546bc1a17fb4f8ddb130f098fe9d0b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jan 2022 13:39:57 +0800 Subject: [PATCH 001/113] minor bug fixes in ts fetch generator (#11215) --- .../TypeScriptFetchClientCodegen.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index bc0a2808aad..5c810f7073b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -1064,6 +1064,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenParameter that = (ExtendedCodegenParameter) o; return result && @@ -1109,7 +1115,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege public ExtendedCodegenProperty(CodegenProperty cp) { super(); - this.openApiType = openApiType; + this.openApiType = cp.openApiType; this.baseName = cp.baseName; this.complexType = cp.complexType; this.getter = cp.getter; @@ -1200,6 +1206,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenProperty that = (ExtendedCodegenProperty) o; return result && @@ -1306,6 +1318,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenOperation that = (ExtendedCodegenOperation) o; return result && @@ -1440,6 +1458,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenModel that = (ExtendedCodegenModel) o; return result && From 0a09f1faa35f5a678c63eb40e47129f6a73c802e Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Tue, 4 Jan 2022 08:41:22 +0300 Subject: [PATCH 002/113] [php][bug] Fix DateTime microseconds bug in ObjectSerializer (#11213) * fixing precision for php * remove a bracket * handling whitespace * format comment * Use regexp to trim needless microseconds That way we can save timezone suffix. Co-authored-by: Carmen Quan --- .../resources/php/ObjectSerializer.mustache | 21 +++++-- .../lib/ObjectSerializer.php | 21 +++++-- .../tests/ObjectSerializerTest.php | 62 +++++++++++++++++++ 3 files changed, 96 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 6d1193099c5..7d48d3557c3 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -120,6 +120,20 @@ class ObjectSerializer } } + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + /** * Take value and turn it into a string suitable for inclusion in * the path, by url-encoding. @@ -313,10 +327,9 @@ class ObjectSerializer return new \DateTime($data); } catch (\Exception $exception) { // Some API's return a date-time with too high nanosecond - // precision for php's DateTime to handle. This conversion - // (string -> unix timestamp -> DateTime) is a workaround - // for the problem. - return (new \DateTime())->setTimestamp(strtotime($data)); + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); } } else { return null; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 9d9562bb668..093c15794ed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -129,6 +129,20 @@ class ObjectSerializer } } + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + /** * Take value and turn it into a string suitable for inclusion in * the path, by url-encoding. @@ -322,10 +336,9 @@ class ObjectSerializer return new \DateTime($data); } catch (\Exception $exception) { // Some API's return a date-time with too high nanosecond - // precision for php's DateTime to handle. This conversion - // (string -> unix timestamp -> DateTime) is a workaround - // for the problem. - return (new \DateTime())->setTimestamp(strtotime($data)); + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); } } else { return null; diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php index d7cc4a173f1..9c4e86d5bf1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php @@ -64,4 +64,66 @@ class ObjectSerializerTest extends TestCase ], ]; } + + /** + * @covers ObjectSerializer::sanitizeTimestamp + * @dataProvider provideTimestamps + */ + public function testSanitizeTimestamp(string $timestamp, string $expected): void + { + $this->assertEquals($expected, ObjectSerializer::sanitizeTimestamp($timestamp)); + } + + /** + * Test datetime deserialization. + * + * @covers ObjectSerializer::deserialize + * @dataProvider provideTimestamps + * + * @see https://github.com/OpenAPITools/openapi-generator/issues/7942 + * @see https://github.com/OpenAPITools/openapi-generator/issues/10548 + */ + public function testDateTimeParseSecondAccuracy(string $timestamp, string $expected): void + { + $dateTime = ObjectSerializer::deserialize($timestamp, '\DateTime'); + $this->assertEquals(new \DateTime($expected), $dateTime); + } + + public function provideTimestamps(): array + { + return [ + 'String from #7942' => [ + '2020-11-11T15:17:58.868722633Z', + '2020-11-11T15:17:58.868722Z', + ], + 'String from #10548' => [ + '2021-10-06T20:17:16.076372256Z', + '2021-10-06T20:17:16.076372Z', + ], + 'Without timezone' => [ + '2021-10-06T20:17:16.076372256', + '2021-10-06T20:17:16.076372', + ], + 'Without microseconds' => [ + '2021-10-06T20:17:16', + '2021-10-06T20:17:16', + ], + 'Without microseconds with timezone' => [ + '2021-10-06T20:17:16Z', + '2021-10-06T20:17:16Z', + ], + 'With numeric timezone' => [ + '2021-10-06T20:17:16.076372256+03:00', + '2021-10-06T20:17:16.076372+03:00', + ], + 'With numeric timezone without delimiter' => [ + '2021-10-06T20:17:16.076372256+0300', + '2021-10-06T20:17:16.076372+0300', + ], + 'With numeric short timezone' => [ + '2021-10-06T20:17:16.076372256+03', + '2021-10-06T20:17:16.076372+03', + ], + ]; + } } From 5a616757e736958d209c4d33edd4776ab89d417c Mon Sep 17 00:00:00 2001 From: Yohei Kitamura Date: Tue, 4 Jan 2022 01:36:28 -0500 Subject: [PATCH 003/113] Fix examples for request body with array to not raise java.lang.NullPointerException (#11170) --- .../codegen/languages/CrystalClientCodegen.java | 6 +++++- .../org/openapitools/codegen/languages/GoClientCodegen.java | 3 +++ .../codegen/languages/PowerShellClientCodegen.java | 6 +++++- .../openapitools/codegen/languages/RubyClientCodegen.java | 6 +++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index 2e77181d7a3..21b18e18154 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -657,7 +657,11 @@ public class CrystalClientCodegen extends DefaultCodegen { if (codegenProperty.isArray) { // array return "[" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "]"; } else if (codegenProperty.isMap) { - return "{ key: " + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "}"; + if (codegenProperty.items != null) { + return "{ key: " + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "}"; + } else { + return "{ ... }"; + } } else if (codegenProperty.isPrimitiveType) { // primitive type if (codegenProperty.isEnum) { // When inline enum, set example to first allowable value diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 5f556a45671..3902e0b07cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -555,6 +555,9 @@ public class GoClientCodegen extends AbstractGoCodegen { if (modelMaps.containsKey(dataType)) { prefix = "map[string][]" + goImportAlias + "." + dataType; } + if (codegenProperty.items == null) { + return prefix + "{ ... }"; + } return prefix + "{\"key\": " + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "}"; } else if (codegenProperty.isPrimitiveType) { // primitive type if (codegenProperty.isString) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index f55734fafa2..c7d4028d84a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -1230,7 +1230,11 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo example.append(constructExampleCode(codegenProperty.items, modelMaps, processedModelMap, requiredOnly)); } else if (codegenProperty.isMap) { example.append("@{ key_example = "); - example.append(constructExampleCode(codegenProperty.items, modelMaps, processedModelMap, requiredOnly)); + if (codegenProperty.items != null) { + example.append(constructExampleCode(codegenProperty.items, modelMaps, processedModelMap, requiredOnly)); + } else { + example.append(" ... "); + } example.append(" }"); } else if (codegenProperty.isEnum || (codegenProperty.allowableValues != null && !codegenProperty.allowableValues.isEmpty())) { example.append(constructEnumExample(codegenProperty.allowableValues)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 335a329ef59..88a8aa6547d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -680,7 +680,11 @@ public class RubyClientCodegen extends AbstractRubyCodegen { } return "[" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "]"; } else if (codegenProperty.isMap) { - return "{ key: " + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "}"; + if (codegenProperty.items != null) { + return "{ key: " + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "}"; + } else { + return "{ ... }"; + } } else if (codegenProperty.isPrimitiveType) { // primitive type if (codegenProperty.isEnum) { // When inline enum, set example to first allowable value From f1b9676f7ed9f9aac687be53c35d7bc70a499c85 Mon Sep 17 00:00:00 2001 From: Sergey Nikolaev Date: Tue, 4 Jan 2022 13:37:06 +0700 Subject: [PATCH 004/113] update in readme: Manticore Search uses the generator too (#11223) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f8b8df917ae..48bae346b51 100644 --- a/README.md +++ b/README.md @@ -626,6 +626,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Lumeris](https://www.lumeris.com) - [LVM Versicherungen](https://www.lvm.de) - [MailSlurp](https://www.mailslurp.com) +- [Manticore Search](https://manticoresearch.com) - [Médiavision](https://www.mediavision.fr/) - [Metaswitch](https://www.metaswitch.com/) - [MoonVision](https://www.moonvision.io/) From a3b90183aa123233381744ff6ee0e824d972d98f Mon Sep 17 00:00:00 2001 From: Mostafa Aghajani Date: Tue, 4 Jan 2022 08:47:42 +0200 Subject: [PATCH 005/113] Fix musache template to use "{{package}}.{{dataType}}" on all non primitive types (#11201) --- .../src/main/resources/avro-schema/typeProperty.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache b/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache index a2d5c7a1f7e..574d9b17124 100644 --- a/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache +++ b/modules/openapi-generator/src/main/resources/avro-schema/typeProperty.mustache @@ -1 +1 @@ -{{^isEnum}}{{^isContainer}}{{#isPrimitiveType}}"{{dataType}}"{{/isPrimitiveType}}{{#isModel}}"{{package}}.{{dataType}}"{{/isModel}}{{#isFile}}"{{package}}.{{dataType}}"{{/isFile}}{{/isContainer}}{{#isContainer}}{{>typeArray}}{{/isContainer}}{{/isEnum}}{{#isEnum}}{{>typeEnum}}{{/isEnum}} \ No newline at end of file +{{^isEnum}}{{^isContainer}}{{#isPrimitiveType}}"{{dataType}}"{{/isPrimitiveType}}{{^isPrimitiveType}}"{{package}}.{{dataType}}"{{/isPrimitiveType}}{{/isContainer}}{{#isContainer}}{{>typeArray}}{{/isContainer}}{{/isEnum}}{{#isEnum}}{{>typeEnum}}{{/isEnum}} \ No newline at end of file From 35a2fa6afc54c2ad2173ee70da9959da4dc1edc2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jan 2022 15:01:28 +0800 Subject: [PATCH 006/113] move avro-schema.yaml to bin/configs --- bin/configs/{other => }/avro-schema.yaml | 0 .../schema/petstore/avro-schema/.openapi-generator/FILES | 2 -- .../schema/petstore/avro-schema/.openapi-generator/VERSION | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) rename bin/configs/{other => }/avro-schema.yaml (100%) diff --git a/bin/configs/other/avro-schema.yaml b/bin/configs/avro-schema.yaml similarity index 100% rename from bin/configs/other/avro-schema.yaml rename to bin/configs/avro-schema.yaml diff --git a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES index 894d1ff1db0..efd990ad5be 100644 --- a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES +++ b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES @@ -1,7 +1,5 @@ ApiResponse.avsc Category.avsc -InlineObject.avsc -InlineObject1.avsc Order.avsc Pet.avsc Tag.avsc diff --git a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION index d99e7162d01..0984c4c1ad2 100644 --- a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION +++ b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file From 8c090c978d2fe7ac4b1490f95a623eb89312050f Mon Sep 17 00:00:00 2001 From: Ignacio Campos Rivera Date: Tue, 4 Jan 2022 08:08:03 +0100 Subject: [PATCH 007/113] feat(python-asyncio): add support for proxy config using system env vars (#11171) Co-authored-by: Ignacio Campos --- .../src/main/resources/python-legacy/asyncio/rest.mustache | 3 ++- .../src/main/resources/python/asyncio/rest.mustache | 3 ++- samples/client/petstore/python-asyncio/petstore_api/rest.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache index 538a69bf8eb..61ad3f2ffa3 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/asyncio/rest.mustache @@ -62,7 +62,8 @@ class RESTClientObject(object): # https pool manager self.pool_manager = aiohttp.ClientSession( - connector=connector + connector=connector, + trust_env=True ) async def close(self): diff --git a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache index 3744b62c81e..d69e7fd8312 100644 --- a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache @@ -60,7 +60,8 @@ class RESTClientObject(object): # https pool manager self.pool_manager = aiohttp.ClientSession( - connector=connector + connector=connector, + trust_env=True ) async def close(self): diff --git a/samples/client/petstore/python-asyncio/petstore_api/rest.py b/samples/client/petstore/python-asyncio/petstore_api/rest.py index 75ee140efba..263fe1daafb 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/rest.py +++ b/samples/client/petstore/python-asyncio/petstore_api/rest.py @@ -70,7 +70,8 @@ class RESTClientObject(object): # https pool manager self.pool_manager = aiohttp.ClientSession( - connector=connector + connector=connector, + trust_env=True ) async def close(self): From 74f39b442ead102d407a938fff4ba2e1f37158e9 Mon Sep 17 00:00:00 2001 From: Ilario Date: Tue, 4 Jan 2022 08:14:11 +0100 Subject: [PATCH 008/113] Bugfix of #11176 and related #10706 CPP-QT-QHTTPENGINE Server (#11177) * Fix extra m that prevents qt cpp server to build (#11176) * Fix regular expression to capture IDs on path (#11176) * Fix build issue missing QHttpEngine namespace (#10706) --- .../cpp-qt-qhttpengine-server/apirouter.h.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache index 028a3097e25..f30a069c19b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache @@ -36,7 +36,7 @@ protected: if (socket->bytesAvailable() >= socket->contentLength()) { emit requestReceived(socket); } else { - connect(socket, &Socket::readChannelFinished, [this, socket, m]() { + connect(socket, &QHttpEngine::Socket::readChannelFinished, [this, socket]() { emit requestReceived(socket); }); } @@ -91,7 +91,7 @@ private : } inline QRegularExpressionMatch getRequestMatch(QString serverTemplatePath, QString requestPath){ - QRegularExpression parExpr( R"(\{([^\/\\s]+)\})" ); + QRegularExpression parExpr( R"(\{([^\/\s]+)\})" ); serverTemplatePath.replace( parExpr, R"((?<\1>[^\/\s]+))" ); serverTemplatePath.append("[\\/]?$"); QRegularExpression pathExpr( serverTemplatePath ); @@ -105,4 +105,4 @@ private : } {{/cppNamespaceDeclarations}} -#endif // {{prefix}}_APIROUTER_H \ No newline at end of file +#endif // {{prefix}}_APIROUTER_H From 98a28a075af1e80cd638c0b030b035512d346b9c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jan 2022 15:21:15 +0800 Subject: [PATCH 009/113] update cpp qt5 server samples --- .../server/src/handlers/OAIApiRouter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/server/petstore/cpp-qt-qhttpengine-server/server/src/handlers/OAIApiRouter.h b/samples/server/petstore/cpp-qt-qhttpengine-server/server/src/handlers/OAIApiRouter.h index 5b8133a7b76..22854f6ccfd 100644 --- a/samples/server/petstore/cpp-qt-qhttpengine-server/server/src/handlers/OAIApiRouter.h +++ b/samples/server/petstore/cpp-qt-qhttpengine-server/server/src/handlers/OAIApiRouter.h @@ -46,7 +46,7 @@ protected: if (socket->bytesAvailable() >= socket->contentLength()) { emit requestReceived(socket); } else { - connect(socket, &Socket::readChannelFinished, [this, socket, m]() { + connect(socket, &QHttpEngine::Socket::readChannelFinished, [this, socket]() { emit requestReceived(socket); }); } @@ -105,7 +105,7 @@ private : } inline QRegularExpressionMatch getRequestMatch(QString serverTemplatePath, QString requestPath){ - QRegularExpression parExpr( R"(\{([^\/\\s]+)\})" ); + QRegularExpression parExpr( R"(\{([^\/\s]+)\})" ); serverTemplatePath.replace( parExpr, R"((?<\1>[^\/\s]+))" ); serverTemplatePath.append("[\\/]?$"); QRegularExpression pathExpr( serverTemplatePath ); @@ -117,4 +117,4 @@ private : } -#endif // OAI_APIROUTER_H \ No newline at end of file +#endif // OAI_APIROUTER_H From 361b593da2c94cbaf731b724cf3743f2b0c1c550 Mon Sep 17 00:00:00 2001 From: S2021Git <91172466+S2021Git@users.noreply.github.com> Date: Tue, 4 Jan 2022 02:41:24 -0600 Subject: [PATCH 010/113] Not creating "Accept:null" header for Java-Jersey2 generator (#11084) * updated ApiClient.mustache for jersey2 * updated samples * corrected indentation * updated samples --- .../resources/Java/libraries/jersey2/ApiClient.mustache | 7 ++++++- .../src/main/java/org/openapitools/client/ApiClient.java | 7 ++++++- .../src/main/java/org/openapitools/client/ApiClient.java | 7 ++++++- .../src/main/java/org/openapitools/client/ApiClient.java | 7 ++++++- .../src/main/java/org/openapitools/client/ApiClient.java | 7 ++++++- .../src/main/java/org/openapitools/client/ApiClient.java | 7 ++++++- 6 files changed, 36 insertions(+), 6 deletions(-) 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 286838dcff4..e9190a25cca 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 @@ -1190,7 +1190,12 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } - Invocation.Builder invocationBuilder = target.request().accept(accept); + Invocation.Builder invocationBuilder; + if (accept != null) { + invocationBuilder = target.request().accept(accept); + } else { + invocationBuilder = target.request(); + } for (Entry entry : cookieParams.entrySet()) { String value = entry.getValue(); diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java index 5f4cb48efe2..9ba931faa55 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java @@ -1106,7 +1106,12 @@ public class ApiClient extends JavaTimeFormatter { } } - Invocation.Builder invocationBuilder = target.request().accept(accept); + Invocation.Builder invocationBuilder; + if (accept != null) { + invocationBuilder = target.request().accept(accept); + } else { + invocationBuilder = target.request(); + } for (Entry entry : cookieParams.entrySet()) { String value = entry.getValue(); 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 5f4cb48efe2..9ba931faa55 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 @@ -1106,7 +1106,12 @@ public class ApiClient extends JavaTimeFormatter { } } - Invocation.Builder invocationBuilder = target.request().accept(accept); + Invocation.Builder invocationBuilder; + if (accept != null) { + invocationBuilder = target.request().accept(accept); + } else { + invocationBuilder = target.request(); + } for (Entry entry : cookieParams.entrySet()) { String value = entry.getValue(); diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 7f844074052..e6bb7d3fad5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -1036,7 +1036,12 @@ public class ApiClient extends JavaTimeFormatter { } } - Invocation.Builder invocationBuilder = target.request().accept(accept); + Invocation.Builder invocationBuilder; + if (accept != null) { + invocationBuilder = target.request().accept(accept); + } else { + invocationBuilder = target.request(); + } for (Entry entry : cookieParams.entrySet()) { String value = entry.getValue(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index 66eb9ca7f90..5fb5eda6314 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -981,7 +981,12 @@ public class ApiClient extends JavaTimeFormatter { } } - Invocation.Builder invocationBuilder = target.request().accept(accept); + Invocation.Builder invocationBuilder; + if (accept != null) { + invocationBuilder = target.request().accept(accept); + } else { + invocationBuilder = target.request(); + } for (Entry entry : cookieParams.entrySet()) { String value = entry.getValue(); 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 index 328fec6af92..5e115bca68a 100644 --- 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 @@ -1190,7 +1190,12 @@ public class ApiClient extends JavaTimeFormatter { } } - Invocation.Builder invocationBuilder = target.request().accept(accept); + Invocation.Builder invocationBuilder; + if (accept != null) { + invocationBuilder = target.request().accept(accept); + } else { + invocationBuilder = target.request(); + } for (Entry entry : cookieParams.entrySet()) { String value = entry.getValue(); From 3243279b4da86b25f4d9635642c8c6032abb14e6 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 5 Jan 2022 12:30:49 -0800 Subject: [PATCH 011/113] Adds python-experimental with dynamic base classes (#8325) --- bin/configs/python-experimental.yaml | 8 + docs/generators.md | 1 + docs/generators/python-experimental.md | 221 ++ .../openapitools/codegen/CodegenModel.java | 3 + .../openapitools/codegen/CodegenProperty.java | 4 + .../openapitools/codegen/DefaultCodegen.java | 25 +- .../codegen/DefaultGenerator.java | 3 +- .../PythonExperimentalClientCodegen.java | 2078 +++++++++++++ .../org.openapitools.codegen.CodegenConfig | 1 + .../python-experimental/README.handlebars | 57 + .../README_common.handlebars | 111 + .../README_onlypackage.handlebars | 43 + .../python-experimental/__init__.handlebars | 0 .../__init__api.handlebars | 9 + .../__init__apis.handlebars | 24 + .../__init__model.handlebars | 5 + .../__init__models.handlebars | 18 + .../__init__package.handlebars | 28 + .../python-experimental/api.handlebars | 26 + .../python-experimental/api_client.handlebars | 1380 +++++++++ .../python-experimental/api_doc.handlebars | 212 ++ .../api_doc_example.handlebars | 163 + .../api_doc_schema_type_hint.handlebars | 10 + .../python-experimental/api_test.handlebars | 34 + .../configuration.handlebars | 636 ++++ .../doc_auth_partial.handlebars | 109 + .../python-experimental/endpoint.handlebars | 549 ++++ .../endpoint_body_serialization.handlebars | 6 + .../endpoint_parameter.handlebars | 17 + .../python-experimental/exceptions.handlebars | 129 + .../git_push.sh.handlebars | 58 + .../python-experimental/gitignore.handlebars | 67 + .../python-experimental/gitlab-ci.handlebars | 29 + .../python-experimental/model.handlebars | 17 + .../python-experimental/model_doc.handlebars | 9 + .../composed_schemas.handlebars | 86 + .../model_templates/dict_partial.handlebars | 54 + .../enum_value_to_name.handlebars | 12 + .../model_templates/enums.handlebars | 16 + .../imports_schema_types.handlebars | 41 + .../imports_schemas.handlebars | 6 + .../model_templates/new.handlebars | 53 + .../model_templates/schema.handlebars | 46 + .../schema_composed_or_anytype.handlebars | 67 + .../model_templates/schema_dict.handlebars | 42 + .../model_templates/schema_list.handlebars | 39 + .../model_templates/schema_simple.handlebars | 35 + .../model_templates/validations.handlebars | 50 + .../model_templates/var_equals_cls.handlebars | 1 + .../model_templates/xbase_schema.handlebars | 48 + .../python-experimental/model_test.handlebars | 33 + .../partial_header.handlebars | 17 + .../requirements.handlebars | 5 + .../python-experimental/rest.handlebars | 251 ++ .../python-experimental/schema_doc.handlebars | 32 + .../python-experimental/schemas.handlebars | 1987 ++++++++++++ .../python-experimental/setup.handlebars | 51 + .../python-experimental/setup_cfg.handlebars | 13 + .../python-experimental/signing.handlebars | 409 +++ .../test-requirements.handlebars | 15 + .../python-experimental/tox.handlebars | 9 + .../python-experimental/travis.handlebars | 18 + ...odels-for-testing-with-http-signature.yaml | 2655 +++++++++++++++++ .../petstore/python-experimental/.gitignore | 67 + .../python-experimental/.gitlab-ci.yml | 24 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 262 ++ .../.openapi-generator/VERSION | 1 + .../petstore/python-experimental/.travis.yml | 13 + .../petstore/python-experimental/Makefile | 16 + .../petstore/python-experimental/README.md | 320 ++ .../python-experimental/dev-requirements.txt | 2 + .../docs/AdditionalPropertiesClass.md | 17 + .../AdditionalPropertiesWithArrayOfEnums.md | 9 + .../python-experimental/docs/Address.md | 9 + .../python-experimental/docs/Animal.md | 11 + .../python-experimental/docs/AnimalFarm.md | 8 + .../docs/AnotherFakeApi.md | 94 + .../python-experimental/docs/ApiResponse.md | 12 + .../python-experimental/docs/Apple.md | 11 + .../python-experimental/docs/AppleReq.md | 10 + .../docs/ArrayHoldingAnyType.md | 8 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../python-experimental/docs/ArrayOfEnums.md | 8 + .../docs/ArrayOfNumberOnly.md | 10 + .../python-experimental/docs/ArrayTest.md | 12 + .../docs/ArrayWithValidationsInItems.md | 8 + .../python-experimental/docs/Banana.md | 10 + .../python-experimental/docs/BananaReq.md | 10 + .../petstore/python-experimental/docs/Bar.md | 8 + .../python-experimental/docs/BasquePig.md | 10 + .../python-experimental/docs/Boolean.md | 8 + .../python-experimental/docs/BooleanEnum.md | 8 + .../docs/Capitalization.md | 15 + .../petstore/python-experimental/docs/Cat.md | 9 + .../python-experimental/docs/CatAllOf.md | 10 + .../python-experimental/docs/Category.md | 11 + .../python-experimental/docs/ChildCat.md | 9 + .../python-experimental/docs/ChildCatAllOf.md | 10 + .../python-experimental/docs/ClassModel.md | 12 + .../python-experimental/docs/Client.md | 10 + .../docs/ComplexQuadrilateral.md | 9 + .../docs/ComplexQuadrilateralAllOf.md | 10 + ...omposedAnyOfDifferentTypesNoValidations.md | 9 + .../python-experimental/docs/ComposedArray.md | 8 + .../python-experimental/docs/ComposedBool.md | 8 + .../python-experimental/docs/ComposedNone.md | 8 + .../docs/ComposedNumber.md | 8 + .../docs/ComposedObject.md | 9 + .../docs/ComposedOneOfDifferentTypes.md | 11 + .../docs/ComposedString.md | 8 + .../python-experimental/docs/DanishPig.md | 10 + .../python-experimental/docs/DateTimeTest.md | 8 + .../docs/DateTimeWithValidations.md | 8 + .../docs/DateWithValidations.md | 8 + .../python-experimental/docs/DefaultApi.md | 70 + .../petstore/python-experimental/docs/Dog.md | 9 + .../python-experimental/docs/DogAllOf.md | 10 + .../python-experimental/docs/Drawing.md | 13 + .../python-experimental/docs/EnumArrays.md | 11 + .../python-experimental/docs/EnumClass.md | 8 + .../python-experimental/docs/EnumTest.md | 18 + .../docs/EquilateralTriangle.md | 9 + .../docs/EquilateralTriangleAllOf.md | 10 + .../python-experimental/docs/FakeApi.md | 2604 ++++++++++++++++ .../docs/FakeClassnameTags123Api.md | 105 + .../petstore/python-experimental/docs/File.md | 12 + .../docs/FileSchemaTestClass.md | 11 + .../petstore/python-experimental/docs/Foo.md | 10 + .../python-experimental/docs/FormatTest.md | 30 + .../python-experimental/docs/Fruit.md | 10 + .../python-experimental/docs/FruitReq.md | 9 + .../python-experimental/docs/GmFruit.md | 10 + .../docs/GrandparentAnimal.md | 10 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 12 + .../docs/InlineResponseDefault.md | 10 + .../python-experimental/docs/IntegerEnum.md | 8 + .../docs/IntegerEnumBig.md | 8 + .../docs/IntegerEnumOneValue.md | 8 + .../docs/IntegerEnumWithDefaultValue.md | 8 + .../python-experimental/docs/IntegerMax10.md | 8 + .../python-experimental/docs/IntegerMin15.md | 8 + .../docs/IsoscelesTriangle.md | 9 + .../docs/IsoscelesTriangleAllOf.md | 10 + .../python-experimental/docs/Mammal.md | 9 + .../python-experimental/docs/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Model200Response.md | 13 + .../python-experimental/docs/ModelReturn.md | 12 + .../petstore/python-experimental/docs/Name.md | 14 + .../docs/NoAdditionalProperties.md | 10 + .../python-experimental/docs/NullableClass.md | 21 + .../python-experimental/docs/NullableShape.md | 11 + .../docs/NullableString.md | 8 + .../python-experimental/docs/Number.md | 8 + .../python-experimental/docs/NumberOnly.md | 10 + .../docs/NumberWithValidations.md | 8 + .../docs/ObjectInterface.md | 9 + .../docs/ObjectModelWithRefProps.md | 14 + .../docs/ObjectWithDifficultlyNamedProps.md | 14 + .../docs/ObjectWithValidations.md | 9 + .../python-experimental/docs/Order.md | 15 + .../python-experimental/docs/ParentPet.md | 9 + .../petstore/python-experimental/docs/Pet.md | 17 + .../python-experimental/docs/PetApi.md | 1362 +++++++++ .../petstore/python-experimental/docs/Pig.md | 9 + .../python-experimental/docs/Player.md | 13 + .../python-experimental/docs/Quadrilateral.md | 9 + .../docs/QuadrilateralInterface.md | 11 + .../python-experimental/docs/ReadOnlyFirst.md | 11 + .../docs/ScaleneTriangle.md | 9 + .../docs/ScaleneTriangleAllOf.md | 10 + .../python-experimental/docs/Shape.md | 9 + .../python-experimental/docs/ShapeOrNull.md | 11 + .../docs/SimpleQuadrilateral.md | 9 + .../docs/SimpleQuadrilateralAllOf.md | 10 + .../python-experimental/docs/SomeObject.md | 9 + .../docs/SpecialModelName.md | 12 + .../python-experimental/docs/StoreApi.md | 391 +++ .../python-experimental/docs/String.md | 8 + .../docs/StringBooleanMap.md | 9 + .../python-experimental/docs/StringEnum.md | 10 + .../docs/StringEnumWithDefaultValue.md | 8 + .../docs/StringWithValidation.md | 8 + .../petstore/python-experimental/docs/Tag.md | 11 + .../python-experimental/docs/Triangle.md | 9 + .../docs/TriangleInterface.md | 11 + .../petstore/python-experimental/docs/User.md | 21 + .../python-experimental/docs/UserApi.md | 784 +++++ .../python-experimental/docs/Whale.md | 12 + .../python-experimental/docs/Zebra.md | 11 + .../petstore/python-experimental/git_push.sh | 58 + .../petstore_api/__init__.py | 31 + .../petstore_api/api/__init__.py | 3 + .../petstore_api/api/another_fake_api.py | 25 + .../call_123_test_special_tags.py | 161 + .../petstore_api/api/default_api.py | 25 + .../api/default_api_endpoints/foo_get.py | 138 + .../petstore_api/api/fake_api.py | 73 + ...ditional_properties_with_array_of_enums.py | 158 + .../api/fake_api_endpoints/array_model.py | 157 + .../api/fake_api_endpoints/array_of_enums.py | 158 + .../body_with_file_schema.py | 146 + .../body_with_query_params.py | 186 ++ .../api/fake_api_endpoints/boolean.py | 155 + .../case_sensitive_params.py | 174 ++ .../api/fake_api_endpoints/client_model.py | 161 + .../composed_one_of_different_types.py | 157 + .../fake_api_endpoints/endpoint_parameters.py | 288 ++ .../api/fake_api_endpoints/enum_parameters.py | 480 +++ .../api/fake_api_endpoints/fake_health_get.py | 135 + .../fake_api_endpoints/group_parameters.py | 234 ++ .../inline_additional_properties.py | 164 + .../api/fake_api_endpoints/json_form_data.py | 164 + .../api/fake_api_endpoints/mammal.py | 160 + .../number_with_validations.py | 157 + .../object_model_with_ref_props.py | 157 + .../parameter_collisions.py | 425 +++ .../query_parameter_collection_format.py | 228 ++ .../api/fake_api_endpoints/string.py | 155 + .../api/fake_api_endpoints/string_enum.py | 157 + .../upload_download_file.py | 159 + .../api/fake_api_endpoints/upload_file.py | 182 ++ .../api/fake_api_endpoints/upload_files.py | 184 ++ .../api/fake_classname_tags_123_api.py | 25 + .../classname.py | 165 + .../petstore_api/api/pet_api.py | 41 + .../api/pet_api_endpoints/add_pet.py | 182 ++ .../api/pet_api_endpoints/delete_pet.py | 196 ++ .../pet_api_endpoints/find_pets_by_status.py | 246 ++ .../pet_api_endpoints/find_pets_by_tags.py | 220 ++ .../api/pet_api_endpoints/get_pet_by_id.py | 209 ++ .../api/pet_api_endpoints/update_pet.py | 194 ++ .../pet_api_endpoints/update_pet_with_form.py | 208 ++ .../api/pet_api_endpoints/upload_file.py | 216 ++ .../upload_file_with_required_file.py | 225 ++ .../api/pet_api_endpoints/upload_image.py | 223 ++ .../petstore_api/api/store_api.py | 31 + .../api/store_api_endpoints/delete_order.py | 166 ++ .../api/store_api_endpoints/get_inventory.py | 156 + .../store_api_endpoints/get_order_by_id.py | 214 ++ .../api/store_api_endpoints/place_order.py | 179 ++ .../petstore_api/api/user_api.py | 39 + .../api/user_api_endpoints/create_user.py | 151 + .../create_users_with_array_input.py | 160 + .../create_users_with_list_input.py | 160 + .../api/user_api_endpoints/delete_user.py | 166 ++ .../user_api_endpoints/get_user_by_name.py | 205 ++ .../api/user_api_endpoints/login_user.py | 224 ++ .../api/user_api_endpoints/logout_user.py | 119 + .../api/user_api_endpoints/update_user.py | 198 ++ .../petstore_api/api_client.py | 1379 +++++++++ .../petstore_api/apis/__init__.py | 24 + .../petstore_api/configuration.py | 610 ++++ .../petstore_api/exceptions.py | 136 + .../petstore_api/model/__init__.py | 5 + .../model/additional_properties_class.py | 211 ++ ...ditional_properties_with_array_of_enums.py | 98 + .../petstore_api/model/address.py | 87 + .../petstore_api/model/animal.py | 112 + .../petstore_api/model/animal_farm.py | 78 + .../petstore_api/model/api_response.py | 98 + .../petstore_api/model/apple.py | 120 + .../petstore_api/model/apple_req.py | 94 + .../model/array_holding_any_type.py | 72 + .../model/array_of_array_of_number_only.py | 100 + .../petstore_api/model/array_of_enums.py | 78 + .../model/array_of_number_only.py | 95 + .../petstore_api/model/array_test.py | 129 + .../model/array_with_validations_in_items.py | 87 + .../petstore_api/model/banana.py | 93 + .../petstore_api/model/banana_req.py | 94 + .../petstore_api/model/bar.py | 59 + .../petstore_api/model/basque_pig.py | 107 + .../petstore_api/model/boolean.py | 59 + .../petstore_api/model/boolean_enum.py | 80 + .../petstore_api/model/capitalization.py | 110 + .../petstore_api/model/cat.py | 109 + .../petstore_api/model/cat_all_of.py | 90 + .../petstore_api/model/category.py | 97 + .../petstore_api/model/child_cat.py | 109 + .../petstore_api/model/child_cat_all_of.py | 90 + .../petstore_api/model/class_model.py | 91 + .../petstore_api/model/client.py | 90 + .../model/complex_quadrilateral.py | 109 + .../model/complex_quadrilateral_all_of.py | 104 + ...d_any_of_different_types_no_validations.py | 141 + .../petstore_api/model/composed_array.py | 72 + .../petstore_api/model/composed_bool.py | 103 + .../petstore_api/model/composed_none.py | 103 + .../petstore_api/model/composed_number.py | 103 + .../petstore_api/model/composed_object.py | 107 + .../model/composed_one_of_different_types.py | 162 + .../petstore_api/model/composed_string.py | 103 + .../petstore_api/model/danish_pig.py | 107 + .../petstore_api/model/date_time_test.py | 59 + .../model/date_time_with_validations.py | 80 + .../model/date_with_validations.py | 80 + .../petstore_api/model/dog.py | 109 + .../petstore_api/model/dog_all_of.py | 90 + .../petstore_api/model/drawing.py | 133 + .../petstore_api/model/enum_arrays.py | 139 + .../petstore_api/model/enum_class.py | 92 + .../petstore_api/model/enum_test.py | 243 ++ .../model/equilateral_triangle.py | 109 + .../model/equilateral_triangle_all_of.py | 104 + .../petstore_api/model/file.py | 92 + .../model/file_schema_test_class.py | 109 + .../petstore_api/model/foo.py | 90 + .../petstore_api/model/format_test.py | 276 ++ .../petstore_api/model/fruit.py | 113 + .../petstore_api/model/fruit_req.py | 111 + .../petstore_api/model/gm_fruit.py | 113 + .../petstore_api/model/grandparent_animal.py | 108 + .../petstore_api/model/has_only_read_only.py | 94 + .../petstore_api/model/health_check_result.py | 110 + .../model/inline_response_default.py | 96 + .../petstore_api/model/integer_enum.py | 92 + .../petstore_api/model/integer_enum_big.py | 92 + .../model/integer_enum_one_value.py | 80 + .../model/integer_enum_with_default_value.py | 92 + .../petstore_api/model/integer_max10.py | 78 + .../petstore_api/model/integer_min15.py | 78 + .../petstore_api/model/isosceles_triangle.py | 109 + .../model/isosceles_triangle_all_of.py | 104 + .../petstore_api/model/mammal.py | 124 + .../petstore_api/model/map_test.py | 204 ++ ...perties_and_additional_properties_class.py | 121 + .../petstore_api/model/model200_response.py | 95 + .../petstore_api/model/model_return.py | 91 + .../petstore_api/model/name.py | 102 + .../model/no_additional_properties.py | 94 + .../petstore_api/model/nullable_class.py | 425 +++ .../petstore_api/model/nullable_shape.py | 125 + .../petstore_api/model/nullable_string.py | 84 + .../petstore_api/model/number.py | 59 + .../petstore_api/model/number_only.py | 90 + .../model/number_with_validations.py | 79 + .../petstore_api/model/object_interface.py | 59 + .../model/object_model_with_ref_props.py | 106 + .../object_with_difficultly_named_props.py | 103 + .../model/object_with_validations.py | 93 + .../petstore_api/model/order.py | 136 + .../petstore_api/model/parent_pet.py | 120 + .../petstore_api/model/pet.py | 163 + .../petstore_api/model/pig.py | 121 + .../petstore_api/model/player.py | 100 + .../petstore_api/model/quadrilateral.py | 121 + .../model/quadrilateral_interface.py | 111 + .../petstore_api/model/read_only_first.py | 94 + .../petstore_api/model/scalene_triangle.py | 109 + .../model/scalene_triangle_all_of.py | 104 + .../petstore_api/model/shape.py | 121 + .../petstore_api/model/shape_or_null.py | 125 + .../model/simple_quadrilateral.py | 109 + .../model/simple_quadrilateral_all_of.py | 104 + .../petstore_api/model/some_object.py | 107 + .../petstore_api/model/special_model_name.py | 92 + .../petstore_api/model/string.py | 59 + .../petstore_api/model/string_boolean_map.py | 87 + .../petstore_api/model/string_enum.py | 136 + .../model/string_enum_with_default_value.py | 92 + .../model/string_with_validation.py | 78 + .../petstore_api/model/tag.py | 94 + .../petstore_api/model/triangle.py | 124 + .../petstore_api/model/triangle_interface.py | 111 + .../petstore_api/model/user.py | 154 + .../petstore_api/model/whale.py | 115 + .../petstore_api/model/zebra.py | 137 + .../petstore_api/models/__init__.py | 126 + .../python-experimental/petstore_api/rest.py | 258 ++ .../petstore_api/schemas.py | 1994 +++++++++++++ .../petstore_api/signing.py | 416 +++ .../python-experimental/requirements.txt | 5 + .../petstore/python-experimental/setup.cfg | 2 + .../petstore/python-experimental/setup.py | 48 + .../python-experimental/test-requirements.txt | 4 + .../python-experimental/test/__init__.py | 0 .../test/test_additional_properties_class.py | 37 + ...ditional_properties_with_array_of_enums.py | 37 + .../python-experimental/test/test_address.py | 37 + .../python-experimental/test/test_animal.py | 37 + .../test/test_animal_farm.py | 37 + .../test/test_another_fake_api.py | 37 + .../test/test_api_response.py | 37 + .../python-experimental/test/test_apple.py | 37 + .../test/test_apple_req.py | 37 + .../test/test_array_holding_any_type.py | 37 + .../test_array_of_array_of_number_only.py | 37 + .../test/test_array_of_enums.py | 37 + .../test/test_array_of_number_only.py | 37 + .../test/test_array_test.py | 37 + .../test_array_with_validations_in_items.py | 37 + .../python-experimental/test/test_banana.py | 37 + .../test/test_banana_req.py | 37 + .../python-experimental/test/test_bar.py | 37 + .../test/test_basque_pig.py | 37 + .../python-experimental/test/test_boolean.py | 37 + .../test/test_boolean_enum.py | 37 + .../test/test_capitalization.py | 37 + .../python-experimental/test/test_cat.py | 37 + .../test/test_cat_all_of.py | 37 + .../python-experimental/test/test_category.py | 37 + .../test/test_child_cat.py | 37 + .../test/test_child_cat_all_of.py | 37 + .../test/test_class_model.py | 37 + .../python-experimental/test/test_client.py | 37 + .../test/test_complex_quadrilateral.py | 37 + .../test/test_complex_quadrilateral_all_of.py | 37 + ...d_any_of_different_types_no_validations.py | 37 + .../test/test_composed_array.py | 37 + .../test/test_composed_bool.py | 37 + .../test/test_composed_none.py | 37 + .../test/test_composed_number.py | 37 + .../test/test_composed_object.py | 37 + .../test_composed_one_of_different_types.py | 37 + .../test/test_composed_string.py | 37 + .../test/test_danish_pig.py | 37 + .../test/test_date_time_test.py | 37 + .../test/test_date_time_with_validations.py | 37 + .../test/test_date_with_validations.py | 37 + .../test/test_default_api.py | 36 + .../python-experimental/test/test_dog.py | 37 + .../test/test_dog_all_of.py | 37 + .../python-experimental/test/test_drawing.py | 37 + .../test/test_enum_arrays.py | 37 + .../test/test_enum_class.py | 37 + .../test/test_enum_test.py | 37 + .../test/test_equilateral_triangle.py | 37 + .../test/test_equilateral_triangle_all_of.py | 37 + .../python-experimental/test/test_fake_api.py | 192 ++ .../test/test_fake_classname_tags_123_api.py | 37 + .../python-experimental/test/test_file.py | 37 + .../test/test_file_schema_test_class.py | 37 + .../python-experimental/test/test_foo.py | 37 + .../test/test_format_test.py | 37 + .../python-experimental/test/test_fruit.py | 37 + .../test/test_fruit_req.py | 37 + .../python-experimental/test/test_gm_fruit.py | 37 + .../test/test_grandparent_animal.py | 37 + .../test/test_has_only_read_only.py | 37 + .../test/test_health_check_result.py | 37 + .../test/test_inline_response_default.py | 37 + .../test/test_integer_enum.py | 37 + .../test/test_integer_enum_big.py | 37 + .../test/test_integer_enum_one_value.py | 37 + .../test_integer_enum_with_default_value.py | 37 + .../test/test_integer_max10.py | 37 + .../test/test_integer_min15.py | 37 + .../test/test_isosceles_triangle.py | 37 + .../test/test_isosceles_triangle_all_of.py | 37 + .../python-experimental/test/test_mammal.py | 37 + .../python-experimental/test/test_map_test.py | 37 + ...perties_and_additional_properties_class.py | 37 + .../test/test_model200_response.py | 37 + .../test/test_model_return.py | 37 + .../python-experimental/test/test_name.py | 37 + .../test/test_no_additional_properties.py | 37 + .../test/test_nullable_class.py | 37 + .../test/test_nullable_shape.py | 37 + .../test/test_nullable_string.py | 37 + .../python-experimental/test/test_number.py | 37 + .../test/test_number_only.py | 37 + .../test/test_number_with_validations.py | 37 + .../test/test_object_interface.py | 37 + .../test/test_object_model_with_ref_props.py | 37 + ...est_object_with_difficultly_named_props.py | 55 + .../test/test_object_with_validations.py | 37 + .../python-experimental/test/test_order.py | 37 + .../test/test_parent_pet.py | 37 + .../python-experimental/test/test_pet.py | 37 + .../python-experimental/test/test_pet_api.py | 93 + .../python-experimental/test/test_pig.py | 37 + .../python-experimental/test/test_player.py | 37 + .../test/test_quadrilateral.py | 37 + .../test/test_quadrilateral_interface.py | 37 + .../test/test_read_only_first.py | 37 + .../test/test_scalene_triangle.py | 37 + .../test/test_scalene_triangle_all_of.py | 37 + .../python-experimental/test/test_shape.py | 37 + .../test/test_shape_or_null.py | 37 + .../test/test_simple_quadrilateral.py | 37 + .../test/test_simple_quadrilateral_all_of.py | 37 + .../test/test_some_object.py | 37 + .../test/test_special_model_name.py | 37 + .../test/test_store_api.py | 58 + .../python-experimental/test/test_string.py | 37 + .../test/test_string_boolean_map.py | 37 + .../test/test_string_enum.py | 37 + .../test_string_enum_with_default_value.py | 37 + .../test/test_string_with_validation.py | 37 + .../python-experimental/test/test_tag.py | 37 + .../python-experimental/test/test_triangle.py | 37 + .../test/test_triangle_interface.py | 37 + .../python-experimental/test/test_user.py | 37 + .../python-experimental/test/test_user_api.py | 86 + .../python-experimental/test/test_whale.py | 37 + .../python-experimental/test/test_zebra.py | 37 + .../python-experimental/test_python.sh | 33 + .../testfiles/1px_pic1.png | Bin 0 -> 67 bytes .../testfiles/1px_pic2.png | Bin 0 -> 67 bytes .../tests_manual/__init__.py | 0 .../tests_manual/test_animal.py | 97 + .../tests_manual/test_any_type_schema.py | 273 ++ .../test_array_holding_any_type.py | 64 + .../test_array_with_validations_in_items.py | 52 + .../tests_manual/test_boolean_enum.py | 39 + .../test_combine_object_schemas.py | 152 + .../tests_manual/test_combine_schemas.py | 104 + .../tests_manual/test_composed_bool.py | 42 + .../tests_manual/test_composed_none.py | 42 + .../tests_manual/test_composed_number.py | 42 + .../tests_manual/test_composed_object.py | 42 + .../test_composed_one_of_different_types.py | 107 + .../tests_manual/test_composed_string.py | 42 + .../tests_manual/test_configuration.py | 69 + .../test_date_time_with_validations.py | 87 + .../test_date_with_validations.py | 90 + .../tests_manual/test_deserialization.py | 458 +++ .../test_discard_unknown_properties.py | 157 + .../tests_manual/test_drawing.py | 166 ++ .../test_extra_pool_config_options.py | 61 + .../tests_manual/test_fake_api.py | 575 ++++ .../tests_manual/test_format_test.py | 134 + .../tests_manual/test_fruit.py | 170 ++ .../tests_manual/test_fruit_req.py | 122 + .../tests_manual/test_gm_fruit.py | 135 + .../tests_manual/test_http_signature.py | 518 ++++ .../test_integer_enum_one_value.py | 55 + .../tests_manual/test_json_encoder.py | 50 + .../tests_manual/test_mammal.py | 55 + .../test_no_additional_properties.py | 64 + .../tests_manual/test_nullable_string.py | 54 + .../test_number_with_validations.py | 46 + .../test_object_model_with_ref_props.py | 49 + ...est_object_with_difficultly_named_props.py | 37 + .../test_object_with_validations.py | 52 + .../tests_manual/test_parameters.py | 954 ++++++ .../tests_manual/test_parent_pet.py | 42 + .../tests_manual/test_quadrilateral.py | 40 + .../tests_manual/test_request_body.py | 147 + .../tests_manual/test_shape.py | 117 + .../tests_manual/test_string_enum.py | 56 + .../tests_manual/test_triangle.py | 38 + .../tests_manual/test_validate.py | 330 ++ .../tests_manual/test_whale.py | 49 + .../python-experimental/tests_manual/util.py | 8 + .../petstore/python-experimental/tox.ini | 9 + 549 files changed, 57573 insertions(+), 14 deletions(-) create mode 100644 bin/configs/python-experimental.yaml create mode 100644 docs/generators/python-experimental.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/README.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__api.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__model.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__models.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/__init__package.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/api.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/api_doc.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/api_doc_schema_type_hint.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/configuration.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/doc_auth_partial.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/endpoint_body_serialization.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/endpoint_parameter.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/exceptions.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/git_push.sh.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/gitignore.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/gitlab-ci.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_doc.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/composed_schemas.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/enum_value_to_name.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/enums.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schemas.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/validations.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/partial_header.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/requirements.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/rest.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/setup_cfg.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/signing.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/test-requirements.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars create mode 100644 modules/openapi-generator/src/main/resources/python-experimental/travis.handlebars create mode 100644 modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml create mode 100644 samples/openapi3/client/petstore/python-experimental/.gitignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/python-experimental/.travis.yml create mode 100644 samples/openapi3/client/petstore/python-experimental/Makefile create mode 100644 samples/openapi3/client/petstore/python-experimental/README.md create mode 100644 samples/openapi3/client/petstore/python-experimental/dev-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Address.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Apple.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayHoldingAnyType.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayWithValidationsInItems.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Banana.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Bar.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Boolean.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/BooleanEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Category.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Client.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateralAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedAnyOfDifferentTypesNoValidations.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedArray.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedBool.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedNone.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedNumber.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedObject.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfDifferentTypes.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedString.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DateTimeTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DateTimeWithValidations.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DateWithValidations.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Drawing.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangleAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/File.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Fruit.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumBig.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerMax10.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerMin15.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangleAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Mammal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Name.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NoAdditionalProperties.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableString.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Number.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ObjectInterface.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDifficultlyNamedProps.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ObjectWithValidations.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Order.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pig.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Player.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangleAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Shape.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateralAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SomeObject.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/String.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringWithValidation.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Triangle.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/User.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Whale.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Zebra.md create mode 100644 samples/openapi3/client/petstore/python-experimental/git_push.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.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/configuration.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py create mode 100644 samples/openapi3/client/petstore/python-experimental/requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.cfg create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/test/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_address.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_apple.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_banana.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_bar.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_boolean.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_drawing.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fruit.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mammal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pig.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_player.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_shape.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_some_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_whale.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_zebra.py create mode 100755 samples/openapi3/client/petstore/python-experimental/test_python.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic1.png create mode 100644 samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic2.png create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_holding_any_type.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_with_validations_in_items.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_object_schemas.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_schemas.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_bool.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_none.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_number.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_time_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_json_encoder.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_nullable_string.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_difficultly_named_props.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_parameters.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_request_body.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_whale.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/util.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tox.ini diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml new file mode 100644 index 00000000000..1a8ea6e002c --- /dev/null +++ b/bin/configs/python-experimental.yaml @@ -0,0 +1,8 @@ +generatorName: python-experimental +outputDir: samples/openapi3/client/petstore/python-experimental +inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-generator/src/main/resources/python-experimental +templatingEngineName: handlebars +additionalProperties: + packageName: petstore_api + recursionLimit: "1234" diff --git a/docs/generators.md b/docs/generators.md index 6ce82ffadbb..2d887687911 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -54,6 +54,7 @@ The following generators are available: * [php-dt (beta)](generators/php-dt.md) * [powershell (beta)](generators/powershell.md) * [python (experimental)](generators/python.md) +* [python-experimental (experimental)](generators/python-experimental.md) * [python-legacy](generators/python-legacy.md) * [r](generators/r.md) * [ruby](generators/ruby.md) diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md new file mode 100644 index 00000000000..e61a03a4e60 --- /dev/null +++ b/docs/generators/python-experimental.md @@ -0,0 +1,221 @@ +--- +title: Config Options for python-experimental +sidebar_label: python-experimental +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| +|packageName|python package name (convention: snake_case).| |openapi_client| +|packageUrl|python package URL.| |null| +|packageVersion|python package version.| |1.0.0| +|projectName|python project name in setup.py (e.g. petstore-api).| |null| +|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null| +|useNose|use the nose test framework| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|map|dict| + + +## LANGUAGE PRIMITIVES + +
    +
  • bool
  • +
  • bytes
  • +
  • date
  • +
  • datetime
  • +
  • dict
  • +
  • file
  • +
  • file_type
  • +
  • float
  • +
  • int
  • +
  • list
  • +
  • none_type
  • +
  • object
  • +
  • str
  • +
+ +## RESERVED WORDS + +
    +
  • all_params
  • +
  • and
  • +
  • as
  • +
  • assert
  • +
  • async
  • +
  • auth_settings
  • +
  • await
  • +
  • body_params
  • +
  • bool
  • +
  • break
  • +
  • class
  • +
  • continue
  • +
  • def
  • +
  • del
  • +
  • dict
  • +
  • elif
  • +
  • else
  • +
  • except
  • +
  • exec
  • +
  • false
  • +
  • file_type
  • +
  • finally
  • +
  • float
  • +
  • for
  • +
  • form_params
  • +
  • from
  • +
  • frozendict
  • +
  • global
  • +
  • header_params
  • +
  • if
  • +
  • import
  • +
  • in
  • +
  • int
  • +
  • is
  • +
  • lambda
  • +
  • list
  • +
  • local_var_files
  • +
  • none
  • +
  • none_type
  • +
  • nonlocal
  • +
  • not
  • +
  • or
  • +
  • pass
  • +
  • path_params
  • +
  • print
  • +
  • property
  • +
  • query_params
  • +
  • raise
  • +
  • resource_path
  • +
  • return
  • +
  • self
  • +
  • str
  • +
  • true
  • +
  • try
  • +
  • tuple
  • +
  • while
  • +
  • with
  • +
  • yield
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✓|OAS3 +|ParameterStyling|✓|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✗|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✓|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✓|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 39e7f784cc9..91c8870774a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -1051,6 +1051,9 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.emptyVars = emptyVars; } + public boolean getHasItems() { + return this.items != null; + } /** * Remove duplicated properties in all variable list */ diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index c7a22915dbf..7c2430f4714 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -778,6 +778,10 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping; } + public boolean getHasItems() { + return this.items != null; + } + @Override public boolean getIsString() { return isString; } 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 8a96688f5fa..1af3ddbba39 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 @@ -2731,7 +2731,6 @@ public class DefaultCodegen implements CodegenConfig { addParentContainer(m, name, schema); } else if (ModelUtils.isIntegerSchema(schema)) { // integer type // NOTE: Integral schemas as CodegenModel is a rare use case and may be removed at a later date. - m.isNumeric = Boolean.TRUE; if (ModelUtils.isLongSchema(schema)) { // int64/long format m.isLong = Boolean.TRUE; @@ -2823,6 +2822,7 @@ public class DefaultCodegen implements CodegenConfig { postProcessModelProperty(m, prop); } } + return m; } @@ -2870,16 +2870,15 @@ public class DefaultCodegen implements CodegenConfig { } } - - /** - * Recursively look in Schema sc for the discriminator discPropName - * and return a CodegenProperty with the dataType and required params set - * the returned CodegenProperty may not be required and it may not be of type string - * - * @param composedSchemaName The name of the sc Schema - * @param sc The Schema that may contain the discriminator - * @param discPropName The String that is the discriminator propertyName in the schema - */ + /** + * Recursively look in Schema sc for the discriminator discPropName + * and return a CodegenProperty with the dataType and required params set + * the returned CodegenProperty may not be required and it may not be of type string + * + * @param composedSchemaName The name of the sc Schema + * @param sc The Schema that may contain the discriminator + * @param discPropName The String that is the discriminator propertyName in the schema + */ private CodegenProperty discriminatorFound(String composedSchemaName, Schema sc, String discPropName, OpenAPI openAPI) { Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc); if (refSchema.getProperties() != null && refSchema.getProperties().get(discPropName) != null) { @@ -5199,7 +5198,7 @@ public class DefaultCodegen implements CodegenConfig { * @param properties a map of properties (schema) * @param mandatory a set of required properties' name */ - private void addVars(IJsonSchemaValidationProperties m, List vars, Map properties, Set mandatory) { + protected void addVars(IJsonSchemaValidationProperties m, List vars, Map properties, Set mandatory) { if (properties == null) { return; } @@ -6826,7 +6825,7 @@ public class DefaultCodegen implements CodegenConfig { return codegenParameter; } - private void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ + protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ setAddProps(schema, property); if (!"object".equals(schema.getType())) { return; 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 815342dfea7..8e3d27c6cd9 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 @@ -41,6 +41,7 @@ import org.openapitools.codegen.api.TemplatingEngineAdapter; import org.openapitools.codegen.api.TemplateFileType; import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapitools.codegen.languages.PythonExperimentalClientCodegen; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.serializer.SerializerUtils; @@ -527,7 +528,7 @@ public class DefaultGenerator implements Generator { Map modelTemplate = (Map) modelList.get(0); if (modelTemplate != null && modelTemplate.containsKey("model")) { CodegenModel m = (CodegenModel) modelTemplate.get("model"); - if (m.isAlias && !(config instanceof PythonClientCodegen)) { + if (m.isAlias && !((config instanceof PythonClientCodegen) || (config instanceof PythonExperimentalClientCodegen))) { // alias to number, string, enum, etc, which should not be generated as model // for PythonClientCodegen, all aliases are generated as models continue; // Don't create user-defined classes for aliases diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java new file mode 100644 index 00000000000..187ae357e02 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -0,0 +1,2078 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * 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. + */ + +package org.openapitools.codegen.languages; + +import com.github.curiousoddman.rgxgen.RgxGen; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.oas.models.tags.Tag; +import org.openapitools.codegen.api.TemplatePathLocator; +import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; +import org.openapitools.codegen.templating.*; +import io.swagger.v3.core.util.Json; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.CodegenDiscriminator.MappedModel; +import org.openapitools.codegen.api.TemplatingEngineAdapter; +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.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.openapitools.codegen.api.TemplateProcessor; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.openapitools.codegen.utils.OnceLogger.once; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { + private final Logger LOGGER = LoggerFactory.getLogger(PythonExperimentalClientCodegen.class); + + public static final String PACKAGE_URL = "packageUrl"; + public static final String DEFAULT_LIBRARY = "urllib3"; + // nose is a python testing framework, we use pytest if USE_NOSE is unset + public static final String USE_NOSE = "useNose"; + public static final String RECURSION_LIMIT = "recursionLimit"; + + protected String packageUrl; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + protected boolean useNose = Boolean.FALSE; + + protected Map regexModifiers; + + private String testFolder; + + // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. + private Map modelNameToSchemaCache; + private DateTimeFormatter iso8601Date = DateTimeFormatter.ISO_DATE; + private DateTimeFormatter iso8601DateTime = DateTimeFormatter.ISO_DATE_TIME; + + private String templateExtension; + protected CodegenIgnoreProcessor ignoreProcessor; + protected TemplateProcessor templateProcessor = null; + + public PythonExperimentalClientCodegen() { + super(); + + modifyFeatureSet(features -> features + .includeSchemaSupportFeatures( + SchemaSupportFeature.Simple, + SchemaSupportFeature.Composite, + SchemaSupportFeature.Polymorphism, + SchemaSupportFeature.Union + ) + .includeDocumentationFeatures(DocumentationFeature.Readme) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.Custom)) + .securityFeatures(EnumSet.of( + SecurityFeature.BasicAuth, + SecurityFeature.BearerToken, + SecurityFeature.ApiKey, + SecurityFeature.OAuth2_Implicit + )) + .includeGlobalFeatures( + GlobalFeature.ParameterizedServer, + GlobalFeature.ParameterStyling + ) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects + ) + .excludeSchemaSupportFeatures( + ) + .excludeParameterFeatures( + ParameterFeature.Cookie + ) + ); + + // clear import mapping (from default generator) as python does not use it + // at the moment + importMapping.clear(); + + modelPackage = "model"; + apiPackage = "api"; + outputFolder = "generated-code" + File.separatorChar + "python"; + + embeddedTemplateDir = templateDir = "python-experimental"; + + testFolder = "test"; + + // default HIDE_GENERATION_TIMESTAMP to true + hideGenerationTimestamp = Boolean.TRUE; + + // from https://docs.python.org/3/reference/lexical_analysis.html#keywords + setReservedWordsLowerCase( + Arrays.asList( + // local variable name used in API methods (endpoints) + "all_params", "resource_path", "path_params", "query_params", + "header_params", "form_params", "local_var_files", "body_params", "auth_settings", + // @property + "property", + // python reserved words + "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", + "assert", "else", "if", "pass", "yield", "break", "except", "import", + "print", "class", "exec", "in", "raise", "continue", "finally", "is", + "return", "def", "for", "lambda", "try", "self", "nonlocal", "None", "True", + "False", "async", "await", + // types + "float", "int", "str", "bool", "none_type", "dict", "frozendict", "list", "tuple", "file_type")); + + regexModifiers = new HashMap(); + regexModifiers.put('i', "IGNORECASE"); + regexModifiers.put('l', "LOCALE"); + regexModifiers.put('m', "MULTILINE"); + regexModifiers.put('s', "DOTALL"); + regexModifiers.put('u', "UNICODE"); + regexModifiers.put('x', "VERBOSE"); + + cliOptions.clear(); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).") + .defaultValue("openapi_client")); + cliOptions.add(new CliOption(CodegenConstants.PROJECT_NAME, "python project name in setup.py (e.g. petstore-api).")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "python package version.") + .defaultValue("1.0.0")); + cliOptions.add(new CliOption(PACKAGE_URL, "python package URL.")); + // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG + // this generator uses the following order for endpoint paramters and model properties + // required params + // optional params which are set to unset as their default for method signatures only + // optional params as **kwargs + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) + .defaultValue(Boolean.TRUE.toString())); + cliOptions.add(new CliOption(CodegenConstants.SOURCECODEONLY_GENERATION, CodegenConstants.SOURCECODEONLY_GENERATION_DESC) + .defaultValue(Boolean.FALSE.toString())); + cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework"). + defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(RECURSION_LIMIT, "Set the recursion limit. If not set, use the system default value.")); + + supportedLibraries.put("urllib3", "urllib3-based client"); + supportedLibraries.put("asyncio", "Asyncio-based client (python 3.5+)"); + supportedLibraries.put("tornado", "tornado-based client"); + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use: asyncio, tornado, urllib3"); + libraryOption.setDefault(DEFAULT_LIBRARY); + cliOptions.add(libraryOption); + setLibrary(DEFAULT_LIBRARY); + + // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. + // In principle, this should be enabled by default for all code generators. However due to limitations + // in other code generators, support needs to be enabled on a case-by-case basis. + supportsAdditionalPropertiesWithComposedSchema = true; + + // When the 'additionalProperties' keyword is not present in a OAS schema, allow + // undeclared properties. This is compliant with the JSON schema specification. + this.setDisallowAdditionalPropertiesIfNotPresent(false); + + // this may set datatype right for additional properties + instantiationTypes.put("map", "dict"); + + languageSpecificPrimitives.add("file_type"); + languageSpecificPrimitives.add("none_type"); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.EXPERIMENTAL) + .build(); + } + + @Override + public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); + + super.processOpts(); + + TemplatingEngineAdapter te = getTemplatingEngine(); + if (te instanceof HandlebarsEngineAdapter) { + HandlebarsEngineAdapter hea = (HandlebarsEngineAdapter) te; + hea.infiniteLoops(true); + hea.setPrettyPrint(true); + } else { + throw new RuntimeException("Only the HandlebarsEngineAdapter is supported for this generator"); + } + + TemplatePathLocator commonTemplateLocator = new CommonTemplateContentLocator(); + TemplatePathLocator generatorTemplateLocator = new GeneratorTemplateContentLocator(this); + TemplateManagerOptions templateManagerOptions = new TemplateManagerOptions(this.isEnableMinimalUpdate(),this.isSkipOverwrite()); + templateProcessor = new TemplateManager( + templateManagerOptions, + te, + new TemplatePathLocator[]{generatorTemplateLocator, commonTemplateLocator} + ); + templateExtension = te.getIdentifier(); + + String ignoreFileLocation = this.getIgnoreFilePathOverride(); + if (ignoreFileLocation != null) { + final File ignoreFile = new File(ignoreFileLocation); + if (ignoreFile.exists() && ignoreFile.canRead()) { + this.ignoreProcessor = new CodegenIgnoreProcessor(ignoreFile); + } else { + LOGGER.warn("Ignore file specified at {} is not valid. This will fall back to an existing ignore file if present in the output directory.", ignoreFileLocation); + } + } + + if (this.ignoreProcessor == null) { + this.ignoreProcessor = new CodegenIgnoreProcessor(this.getOutputDir()); + } + + modelTemplateFiles.put("model." + templateExtension, ".py"); + apiTemplateFiles.put("api." + templateExtension, ".py"); + modelTestTemplateFiles.put("model_test." + templateExtension, ".py"); + apiTestTemplateFiles.put("api_test." + templateExtension, ".py"); + modelDocTemplateFiles.put("model_doc." + templateExtension, ".md"); + apiDocTemplateFiles.put("api_doc." + templateExtension, ".md"); + + if (StringUtils.isEmpty(System.getenv("PYTHON_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable PYTHON_POST_PROCESS_FILE not defined so the Python code may not be properly formatted. To define it, try 'export PYTHON_POST_PROCESS_FILE=\"/usr/local/bin/yapf -i\"' (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + + Boolean excludeTests = false; + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } + + if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) { + setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME)); + } else { + // default: set project based on package name + // e.g. petstore_api (package name) => petstore-api (project name) + setProjectName(packageName.replaceAll("_", "-")); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } + + additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName); + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + + if (additionalProperties.containsKey(CodegenConstants.EXCLUDE_TESTS)) { + excludeTests = Boolean.valueOf(additionalProperties.get(CodegenConstants.EXCLUDE_TESTS).toString()); + } + + Boolean generateSourceCodeOnly = false; + if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { + generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); + } + + if (generateSourceCodeOnly) { + // tests in /test + testFolder = packagePath() + File.separatorChar + testFolder; + // api/model docs in /docs + apiDocPath = packagePath() + File.separatorChar + apiDocPath; + modelDocPath = packagePath() + File.separatorChar + modelDocPath; + } + // make api and model doc path available in templates + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + if (additionalProperties.containsKey(PACKAGE_URL)) { + setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); + } + + if (additionalProperties.containsKey(USE_NOSE)) { + setUseNose((String) additionalProperties.get(USE_NOSE)); + } + + // check to see if setRecursionLimit is set and whether it's an integer + if (additionalProperties.containsKey(RECURSION_LIMIT)) { + try { + Integer.parseInt((String) additionalProperties.get(RECURSION_LIMIT)); + } catch (NumberFormatException | NullPointerException e) { + throw new IllegalArgumentException("recursionLimit must be an integer, e.g. 2000."); + } + } + + String readmePath = "README.md"; + String readmeTemplate = "README." + templateExtension; + if (generateSourceCodeOnly) { + readmePath = packagePath() + "_" + readmePath; + readmeTemplate = "README_onlypackage." + templateExtension; + } + supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); + + if (!generateSourceCodeOnly) { + supportingFiles.add(new SupportingFile("tox." + templateExtension, "", "tox.ini")); + supportingFiles.add(new SupportingFile("test-requirements." + templateExtension, "", "test-requirements.txt")); + supportingFiles.add(new SupportingFile("requirements." + templateExtension, "", "requirements.txt")); + supportingFiles.add(new SupportingFile("setup_cfg." + templateExtension, "", "setup.cfg")); + + supportingFiles.add(new SupportingFile("git_push.sh." + templateExtension, "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore." + templateExtension, "", ".gitignore")); + supportingFiles.add(new SupportingFile("travis." + templateExtension, "", ".travis.yml")); + supportingFiles.add(new SupportingFile("gitlab-ci." + templateExtension, "", ".gitlab-ci.yml")); + supportingFiles.add(new SupportingFile("setup." + templateExtension, "", "setup.py")); + } + supportingFiles.add(new SupportingFile("configuration." + templateExtension, packagePath(), "configuration.py")); + supportingFiles.add(new SupportingFile("__init__package." + templateExtension, packagePath(), "__init__.py")); + + // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files. + String[] packageNameSplits = packageName.split("\\."); + String currentPackagePath = ""; + for (int i = 0; i < packageNameSplits.length - 1; i++) { + if (i > 0) { + currentPackagePath = currentPackagePath + File.separatorChar; + } + currentPackagePath = currentPackagePath + packageNameSplits[i]; + supportingFiles.add(new SupportingFile("__init__." + templateExtension, currentPackagePath, "__init__.py")); + } + + supportingFiles.add(new SupportingFile("exceptions." + templateExtension, packagePath(), "exceptions.py")); + + if (Boolean.FALSE.equals(excludeTests)) { + supportingFiles.add(new SupportingFile("__init__." + templateExtension, testFolder, "__init__.py")); + } + + supportingFiles.add(new SupportingFile("api_client." + templateExtension, packagePath(), "api_client.py")); + + if ("asyncio".equals(getLibrary())) { + supportingFiles.add(new SupportingFile("asyncio/rest." + templateExtension, packagePath(), "rest.py")); + additionalProperties.put("asyncio", "true"); + } else if ("tornado".equals(getLibrary())) { + supportingFiles.add(new SupportingFile("tornado/rest." + templateExtension, packagePath(), "rest.py")); + additionalProperties.put("tornado", "true"); + } else { + supportingFiles.add(new SupportingFile("rest." + templateExtension, packagePath(), "rest.py")); + } + + supportingFiles.add(new SupportingFile("schemas." + templateExtension, packagePath(), "schemas.py")); + + // add the models and apis folders + supportingFiles.add(new SupportingFile("__init__models." + templateExtension, packagePath() + File.separatorChar + "models", "__init__.py")); + supportingFiles.add(new SupportingFile("__init__model." + templateExtension, packagePath() + File.separatorChar + modelPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__apis." + templateExtension, packagePath() + File.separatorChar + "apis", "__init__.py")); + supportingFiles.add(new SupportingFile("__init__api." + templateExtension, packagePath() + File.separatorChar + apiPackage, "__init__.py")); + // 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; + List authMethods = fromSecurity(securitySchemeMap); + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { + supportingFiles.add(new SupportingFile("signing." + templateExtension, packagePath(), "signing.py")); + } + + // default this to true so the python ModelSimple models will be generated + ModelUtils.setGenerateAliasAsModel(true); + LOGGER.info(CodegenConstants.GENERATE_ALIAS_AS_MODEL + " is hard coded to true in this generator. Alias models will only be generated if they contain validations or enums"); + + // check library option to ensure only urllib3 is supported + if (!DEFAULT_LIBRARY.equals(getLibrary())) { + throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); + } + } + + public String endpointFilename(String templateName, String tag, String operationId) { + return apiFileFolder() + File.separator + toApiFilename(tag) + "_endpoints" + File.separator + operationId + ".py"; + } + + protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { + String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); + File target = new File(adjustedOutputFilename); + if (ignoreProcessor.allowsFile(target)) { + if (shouldGenerate) { + Path outDir = java.nio.file.Paths.get(this.getOutputDir()).toAbsolutePath(); + Path absoluteTarget = target.toPath().toAbsolutePath(); + if (!absoluteTarget.startsWith(outDir)) { + throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); + } + return this.templateProcessor.write(templateData,templateName, target); + } else { + this.templateProcessor.skip(target.toPath(), String.format(Locale.ROOT, "Skipped by %s options supplied by user.", skippedByOption)); + return null; + } + } else { + this.templateProcessor.ignore(target.toPath(), "Ignored by rule in ignore file."); + return null; + } + } + + /* + I made this method because endpoint parameters not contain a lot of needed metadata + It is very verbose to write all of this info into the api template + This ingests all operations under a tag in the objs input and writes out one file for each endpoint + */ + protected void generateEndpoints(Map objs) { + if (!(Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS)) { + return; + } + HashMap operations = (HashMap) objs.get("operations"); + ArrayList codegenOperations = (ArrayList) operations.get("operation"); + for (CodegenOperation co: codegenOperations) { + for (Tag tag: co.tags) { + String tagName = tag.getName(); + String pythonTagName = toVarName(tagName); + Map operationMap = new HashMap<>(); + operationMap.put("operation", co); + operationMap.put("imports", co.imports); + operationMap.put("packageName", packageName); + + String templateName = "endpoint.handlebars"; + String filename = endpointFilename(templateName, pythonTagName, co.operationId); + try { + File written = processTemplateToFile(operationMap, templateName, filename, true, CodegenConstants.APIS); + } catch (IOException e) { + LOGGER.error("Error when writing template file {}", e.toString()); + } + } + } + } + + /* + We have a custom version of this method so for composed schemas and object schemas we add properties only if they + are defined in that schema (x.properties). We do this because validation should be done independently in each schema + If properties are hosted into composed schemas, they can collide or incorrectly list themself as required when + they are not. + */ + @Override + protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property){ + setAddProps(schema, property); + if (schema instanceof ComposedSchema && supportsAdditionalPropertiesWithComposedSchema) { + // if schema has properties outside of allOf/oneOf/anyOf also add them + ComposedSchema cs = (ComposedSchema) schema; + if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " + + "For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'."); + } + HashSet requiredVars = new HashSet<>(); + if (schema.getRequired() != null) { + requiredVars.addAll(schema.getRequired()); + } + addVars(property, property.getVars(), schema.getProperties(), requiredVars); + } + return; + } else if (ModelUtils.isTypeObjectSchema(schema)) { + HashSet requiredVars = new HashSet<>(); + if (schema.getRequired() != null) { + requiredVars.addAll(schema.getRequired()); + property.setHasRequired(true); + } + addVars(property, property.getVars(), schema.getProperties(), requiredVars); + if (property.getVars() != null && !property.getVars().isEmpty()) { + property.setHasVars(true); + } + } + return; + } + + /** + * Configures a friendly name for the generator. This will be used by the + * generator to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "python-experimental"; + } + + @Override + public String getHelp() { + String newLine = System.getProperty("line.separator"); + return String.join(newLine, + "Generates a Python client library", + "", + "Features in this generator:", + "- type hints on endpoints and model creation", + "- model parameter names use the spec defined keys and cases", + "- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only", + "- endpoint parameter names use the spec defined keys and cases", + "- inline schemas are supported at any location including composition", + "- multiple content types supported in request body and response bodies", + "- run time type checking", + "- quicker load time for python modules (a single endpoint can be imported and used without loading others)", + "- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed", + "- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)", + "- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor", + " - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int"); + } + + @Override + public Schema unaliasSchema(Schema schema, Map usedImportMappings) { + Map allSchemas = ModelUtils.getSchemas(openAPI); + if (allSchemas == null || allSchemas.isEmpty()) { + // skip the warning as the spec can have no model defined + //LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'"); + return schema; + } + + if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { + String simpleRef = ModelUtils.getSimpleRef(schema.get$ref()); + if (usedImportMappings.containsKey(simpleRef)) { + LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, usedImportMappings.get(simpleRef)); + return schema; + } + Schema ref = allSchemas.get(simpleRef); + if (ref == null) { + once(LOGGER).warn("{} is not defined", schema.get$ref()); + return schema; + } else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) { + // top-level enum class + return schema; + } else if (ModelUtils.isArraySchema(ref)) { + if (ModelUtils.isGenerateAliasAsModel(ref)) { + return schema; // generate a model extending array + } else { + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), + usedImportMappings); + } + } else if (ModelUtils.isComposedSchema(ref)) { + return schema; + } else if (ModelUtils.isMapSchema(ref)) { + if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property + return schema; // treat it as model + else { + if (ModelUtils.isGenerateAliasAsModel(ref)) { + return schema; // generate a model extending map + } else { + // treat it as a typical map + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), + usedImportMappings); + } + } + } else if (ModelUtils.isObjectSchema(ref)) { // model + if (ref.getProperties() != null && !ref.getProperties().isEmpty()) { // has at least one property + return schema; + } else { + // free form object (type: object) + if (ModelUtils.hasValidation(ref)) { + return schema; + } else if (getAllOfDescendants(simpleRef, openAPI).size() > 0) { + return schema; + } + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), + usedImportMappings); + } + } else if (ModelUtils.hasValidation(ref)) { + // non object non array non map schemas that have validations + // are returned so we can generate those schemas as models + // we do this to: + // - preserve the validations in that model class in python + // - use those validations when we use this schema in composed oneOf schemas + return schema; + } else if (Boolean.TRUE.equals(ref.getNullable()) && ref.getEnum() == null) { + // non enum primitive with nullable True + // we make these models so instances of this will be subclasses of this model + return schema; + } else { + return unaliasSchema(allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), usedImportMappings); + } + } + return schema; + } + + public String pythonDate(Object dateValue) { + String strValue = null; + if (dateValue instanceof OffsetDateTime) { + OffsetDateTime date = null; + try { + date = (OffsetDateTime) dateValue; + } catch (ClassCastException e) { + LOGGER.warn("Invalid `date` format for value {}", dateValue.toString()); + date = ((Date) dateValue).toInstant().atOffset(ZoneOffset.UTC); + } + strValue = date.format(iso8601Date); + } else { + strValue = dateValue.toString(); + } + return "isoparse('" + strValue + "').date()"; + } + + public String pythonDateTime(Object dateTimeValue) { + String strValue = null; + if (dateTimeValue instanceof OffsetDateTime) { + OffsetDateTime dateTime = null; + try { + dateTime = (OffsetDateTime) dateTimeValue; + } catch (ClassCastException e) { + LOGGER.warn("Invalid `date-time` format for value {}", dateTimeValue.toString()); + dateTime = ((Date) dateTimeValue).toInstant().atOffset(ZoneOffset.UTC); + } + strValue = dateTime.format(iso8601DateTime); + } else { + strValue = dateTimeValue.toString(); + } + return "isoparse('" + strValue + "')"; + } + + /** + * Return the default value of the property + * + * @param p OpenAPI property object + * @return string presentation of the default value of the property + */ + @Override + public String toDefaultValue(Schema p) { + Object defaultObject = null; + if (p.getDefault() != null) { + defaultObject = p.getDefault(); + } + + if (defaultObject == null) { + return null; + } + + String defaultValue = defaultObject.toString(); + if (ModelUtils.isDateSchema(p)) { + defaultValue = pythonDate(defaultObject); + } else if (ModelUtils.isDateTimeSchema(p)) { + defaultValue = pythonDateTime(defaultObject); + } else if (ModelUtils.isStringSchema(p) && !ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p)) { + defaultValue = ensureQuotes(defaultValue); + } else if (ModelUtils.isBooleanSchema(p)) { + if (Boolean.valueOf(defaultValue) == false) { + defaultValue = "False"; + } else { + defaultValue = "True"; + } + } + return defaultValue; + } + + @Override + public String toModelImport(String name) { + // name looks like Cat + return "from " + packagePath() + "." + modelPackage() + "." + toModelFilename(name) + " import " + toModelName(name); + } + + @Override + @SuppressWarnings("static-method") + public Map postProcessOperationsWithModels(Map objs, List allModels) { + // fix the imports that each model has, add the module reference to the model + // loops through imports and converts them all + // from 'Pet' to 'from petstore_api.model.pet import Pet' + + HashMap val = (HashMap) objs.get("operations"); + ArrayList operations = (ArrayList) val.get("operation"); + ArrayList> imports = (ArrayList>) objs.get("imports"); + for (CodegenOperation operation : operations) { + if (operation.imports.size() == 0) { + continue; + } + String[] modelNames = operation.imports.toArray(new String[0]); + operation.imports.clear(); + for (String modelName : modelNames) { + operation.imports.add(toModelImport(modelName)); + } + } + generateEndpoints(objs); + return objs; + } + + /*** + * Override with special post-processing for all models. + * we have a custom version of this method to: + * - remove any primitive models that do not contain validations + * these models are unaliased as inline definitions wherever the spec has them as refs + * this means that the generated client does not use these models + * because they are not used we do not write them + * - fix the model imports, go from model name to the full import string with toModelImport + globalImportFixer + * + * @param objs a map going from the model name to a object hoding the model info + * @return the updated objs + */ + @Override + public Map postProcessAllModels(Map objs) { + super.postProcessAllModels(objs); + + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + for (String schemaName : allDefinitions.keySet()) { + Schema refSchema = new Schema().$ref("#/components/schemas/" + schemaName); + Schema unaliasedSchema = unaliasSchema(refSchema, importMapping); + String modelName = toModelName(schemaName); + if (unaliasedSchema.get$ref() == null) { + continue; + } else { + HashMap objModel = (HashMap) objs.get(modelName); + if (objModel != null) { // to avoid form parameter's models that are not generated (skipFormModel=true) + List> models = (List>) objModel.get("models"); + for (Map model : models) { + CodegenModel cm = (CodegenModel) model.get("model"); + String[] importModelNames = cm.imports.toArray(new String[0]); + cm.imports.clear(); + for (String importModelName : importModelNames) { + cm.imports.add(toModelImport(importModelName)); + } + } + } + } + } + + return objs; + } + + public CodegenParameter fromParameter(Parameter parameter, Set imports) { + CodegenParameter cp = super.fromParameter(parameter, imports); + switch(parameter.getStyle()) { + case MATRIX: + cp.style = "MATRIX"; + break; + case LABEL: + cp.style = "LABEL"; + break; + case FORM: + cp.style = "FORM"; + break; + case SIMPLE: + cp.style = "SIMPLE"; + break; + case SPACEDELIMITED: + cp.style = "SPACE_DELIMITED"; + break; + case PIPEDELIMITED: + cp.style = "PIPE_DELIMITED"; + break; + case DEEPOBJECT: + cp.style = "DEEP_OBJECT"; + break; + } + // clone this so we can change some properties on it + CodegenProperty schemaProp = cp.getSchema().clone(); + // parameters may have valid python names like some_val or invalid ones like Content-Type + // we always set nameInSnakeCase to null so special handling will not be done for these names + // invalid python names will be handled in python by using a TypedDict which will allow us to have a type hint + // for keys that cannot be variable names to the schema baseName + if (schemaProp != null) { + schemaProp.nameInSnakeCase = null; + schemaProp.baseName = toModelName(cp.baseName) + "Schema"; + cp.setSchema(schemaProp); + } + return cp; + } + + private boolean isValidPythonVarOrClassName(String name) { + return name.matches("^[_a-zA-Z][_a-zA-Z0-9]*$"); + } + + + /** + * Convert OAS Property object to Codegen Property object + * We have a custom version of this method to always set allowableValues.enumVars on all enum variables + * Together with unaliasSchema this sets primitive types with validations as models + * This method is used by fromResponse + * + * @param name name of the property + * @param p OAS property object + * @return Codegen Property object + */ + @Override + public CodegenProperty fromProperty(String name, Schema p) { + CodegenProperty cp = super.fromProperty(name, p); + if (cp.isAnyType && cp.isNullable) { + cp.isNullable = false; + } + if (cp.isNullable && cp.complexType == null) { + cp.setIsNull(true); + cp.isNullable = false; + cp.setHasMultipleTypes(true); + } + postProcessPattern(cp.pattern, cp.vendorExtensions); + // if we have a property that has a difficult name, either: + // 1. name is reserved, like class int float + // 2. name is invalid in python like '3rd' or 'Content-Type' + // set cp.nameInSnakeCase to a value so we can tell that we are in this use case + // we handle this in the schema templates + // templates use its presence to handle these badly named variables / keys + if ((isReservedWord(name) || !isValidPythonVarOrClassName(name)) && !name.equals(cp.name)) { + cp.nameInSnakeCase = cp.name; + } else { + cp.nameInSnakeCase = null; + } + if (cp.isEnum) { + updateCodegenPropertyEnum(cp); + } + Schema unaliasedSchema = unaliasSchema(p, importMapping); + if (cp.isPrimitiveType && unaliasedSchema.get$ref() != null) { + cp.complexType = cp.dataType; + } + setAdditionalPropsAndItemsVarNames(cp); + return cp; + } + + private void setAdditionalPropsAndItemsVarNames(IJsonSchemaValidationProperties item) { + if (item.getAdditionalProperties() != null) { + item.getAdditionalProperties().setBaseName("_additional_properties"); + } + if (item.getItems() != null) { + item.getItems().setBaseName("_items"); + } + } + + /** + * checks if the data should be classified as "string" in enum + * e.g. double in C# needs to be double-quoted (e.g. "2.8") by treating it as a string + * In the future, we may rename this function to "isEnumString" + * + * @param dataType data type + * @return true if it's a enum string + */ + @Override + public boolean isDataTypeString(String dataType) { + return "str".equals(dataType); + } + + /** + * Update codegen property's enum by adding "enumVars" (with name and value) + * + * @param var list of CodegenProperty + */ + @Override + public void updateCodegenPropertyEnum(CodegenProperty var) { + // we have a custom version of this method to omit overwriting the defaultValue + Map allowableValues = var.allowableValues; + + // handle array + if (var.mostInnerItems != null) { + allowableValues = var.mostInnerItems.allowableValues; + } + + if (allowableValues == null) { + return; + } + + List values = (List) allowableValues.get("values"); + if (values == null) { + return; + } + + String varDataType = var.mostInnerItems != null ? var.mostInnerItems.dataType : var.dataType; + Schema referencedSchema = getModelNameToSchemaCache().get(varDataType); + String dataType = (referencedSchema != null) ? getTypeDeclaration(referencedSchema) : varDataType; + + // put "enumVars" map into `allowableValues", including `name` and `value` + List> enumVars = buildEnumVars(values, dataType); + + // if "x-enum-varnames" or "x-enum-descriptions" defined, update varnames + Map extensions = var.mostInnerItems != null ? var.mostInnerItems.getVendorExtensions() : var.getVendorExtensions(); + if (referencedSchema != null) { + extensions = referencedSchema.getExtensions(); + } + updateEnumVarsWithExtensions(enumVars, extensions, dataType); + allowableValues.put("enumVars", enumVars); + // overwriting defaultValue omitted from here + } + + /*** + * We have a custom version of this method to produce links to models when they are + * primitive type (not map, not array, not object) and include validations or are enums + * + * @param body requesst body + * @param imports import collection + * @param bodyParameterName body parameter name + * @return the resultant CodegenParameter + */ + @Override + public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { + CodegenParameter cp = super.fromRequestBody(body, imports, bodyParameterName); + cp.baseName = "body"; + Schema schema = ModelUtils.getSchemaFromRequestBody(body); + if (schema.get$ref() == null) { + return cp; + } + Schema unaliasedSchema = unaliasSchema(schema, importMapping); + CodegenProperty unaliasedProp = fromProperty("body", unaliasedSchema); + Boolean dataTypeMismatch = !cp.dataType.equals(unaliasedProp.dataType); + Boolean baseTypeMismatch = !cp.baseType.equals(unaliasedProp.complexType) && unaliasedProp.complexType != null; + if (dataTypeMismatch || baseTypeMismatch) { + cp.dataType = unaliasedProp.dataType; + cp.baseType = unaliasedProp.complexType; + } + return cp; + } + + /*** + * Adds the body model schema to the body parameter + * We have a custom version of this method so we can flip forceSimpleRef + * to True based upon the results of unaliasSchema + * With this customization, we ensure that when schemas are passed to getSchemaType + * - if they have ref in them they are a model + * - if they do not have ref in them they are not a model + * + * @param codegenParameter the body parameter + * @param name model schema ref key in components + * @param schema the model schema (not refed) + * @param imports collection of imports + * @param bodyParameterName body parameter name + * @param forceSimpleRef if true use a model reference + */ + @Override + protected void addBodyModelSchema(CodegenParameter codegenParameter, String name, Schema schema, Set imports, String bodyParameterName, boolean forceSimpleRef) { + if (name != null) { + Schema bodySchema = new Schema().$ref("#/components/schemas/" + name); + Schema unaliased = unaliasSchema(bodySchema, importMapping); + if (unaliased.get$ref() != null) { + forceSimpleRef = true; + } + } + super.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, forceSimpleRef); + + } + + + /** + * Return the sanitized variable name for enum + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized variable name for enum + */ + public String toEnumVarName(String value, String datatype) { + // our enum var names are keys in a python dict, so change spaces to underscores + if (value.length() == 0) { + return "EMPTY"; + } + + String intPattern = "^[-\\+]?\\d+$"; + String floatPattern = "^[-\\+]?\\d+\\.\\d+$"; + Boolean intMatch = Pattern.matches(intPattern, value); + Boolean floatMatch = Pattern.matches(floatPattern, value); + if (intMatch || floatMatch) { + String plusSign = "^\\+.+"; + String negSign = "^-.+"; + if (Pattern.matches(plusSign, value)) { + value = value.replace("+", "POSITIVE_"); + } else if (Pattern.matches(negSign, value)) { + value = value.replace("-", "NEGATIVE_"); + } else { + value = "POSITIVE_" + value; + } + if (floatMatch) { + value = value.replace(".", "_PT_"); + } + return value; + } + // Replace " " with _ + String usedValue = value.replaceAll("\\s+", "_").toUpperCase(Locale.ROOT); + // strip first character if it is invalid + usedValue = usedValue.replaceAll("^[^_a-zA-Z]", ""); + usedValue = usedValue.replaceAll("[^_a-zA-Z0-9]*", ""); + if (usedValue.length() == 0) { + for (int i = 0; i < value.length(); i++){ + Character c = value.charAt(i); + String charName = Character.getName(c.hashCode()); + usedValue += charNameToVarName(charName); + } + // remove trailing _ + usedValue = usedValue.replaceAll("[_]$", ""); + } + return usedValue; + } + + /** + * Replace - and " " with _ + * Remove SIGN + * + * @param charName + * @return + */ + private String charNameToVarName(String charName) { + String varName = charName.replaceAll("[\\-\\s]", "_"); + varName = varName.replaceAll("SIGN", ""); + return varName; + } + + /** + * Return the enum value in the language specified format + * e.g. status becomes "status" + * + * @param value enum variable name + * @param datatype data type + * @return the sanitized value for enum + */ + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "float".equals(datatype) || datatype.equals("int, float")) { + return value; + } else if ("bool".equals(datatype)) { + return value.substring(0, 1).toUpperCase(Locale.ROOT) + value.substring(1); + } else { + return ensureQuotes(value); + } + } + + @Override + public void postProcessParameter(CodegenParameter p) { + postProcessPattern(p.pattern, p.vendorExtensions); + if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { + // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives + p.baseType = null; + } + } + + /** + * Sets the value of the 'model.parent' property in CodegenModel + * We have a custom version of this function so we can add the dataType on the ArrayModel + */ + @Override + protected void addParentContainer(CodegenModel model, String name, Schema schema) { + super.addParentContainer(model, name, schema); + + List referencedModelNames = new ArrayList(); + model.dataType = getTypeString(schema, "", "", referencedModelNames); + } + + /** + * Convert OAS Model object to Codegen Model object + * We have a custom version of this method so we can: + * - set the correct regex values for requiredVars + optionalVars + * - set model.defaultValue and model.hasRequired per the three use cases defined in this method + * + * @param name the name of the model + * @param sc OAS Model object + * @return Codegen Model object + */ + @Override + public CodegenModel fromModel(String name, Schema sc) { + CodegenModel cm = super.fromModel(name, sc); + if (cm.isNullable) { + cm.setIsNull(true); + cm.isNullable = false; + cm.setHasMultipleTypes(true); + } + // TODO improve this imports addition code + if (cm.isArray && cm.getItems() != null && cm.getItems().complexType != null) { + cm.imports.add(cm.getItems().complexType); + } + if (cm.isArray && cm.getItems() != null && cm.getItems().mostInnerItems != null && cm.getItems().mostInnerItems.complexType != null) { + cm.imports.add(cm.getItems().mostInnerItems.complexType); + } + Boolean isNotPythonModelSimpleModel = (ModelUtils.isComposedSchema(sc) || ModelUtils.isObjectSchema(sc) || ModelUtils.isMapSchema(sc)); + setAdditionalPropsAndItemsVarNames(cm); + if (isNotPythonModelSimpleModel) { + return cm; + } + String defaultValue = toDefaultValue(sc); + if (sc.getDefault() != null) { + cm.defaultValue = defaultValue; + } + return cm; + } + + /** + * Returns the python type for the property. + * + * @param schema property schema + * @return string presentation of the type + **/ + @SuppressWarnings("static-method") + @Override + public String getSchemaType(Schema schema) { + String openAPIType = getSingleSchemaType(schema); + if (typeMapping.containsKey(openAPIType)) { + String type = typeMapping.get(openAPIType); + return type; + } + return toModelName(openAPIType); + } + + public String getModelName(Schema sc) { + if (sc.get$ref() != null) { + Schema unaliasedSchema = unaliasSchema(sc, importMapping); + if (unaliasedSchema.get$ref() != null) { + return toModelName(ModelUtils.getSimpleRef(sc.get$ref())); + } + } + return null; + } + + /** + * Return a string representation of the Python types for the specified OAS 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 referencedModelNames a list of models that are being referenced while generating the types, + * 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) { + String fullSuffix = suffix; + if (")".equals(suffix)) { + fullSuffix = "," + suffix; + } + if (StringUtils.isNotEmpty(p.get$ref())) { + // The input schema is a reference. If the resolved schema is + // a composed schema, convert the name to a Python class. + Schema unaliasedSchema = unaliasSchema(p, importMapping); + if (unaliasedSchema.get$ref() != null) { + String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref())); + if (referencedModelNames != null) { + referencedModelNames.add(modelName); + } + return prefix + modelName + fullSuffix; + } + } + if (isAnyTypeSchema(p)) { + return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; + } + // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. + if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { + fullSuffix = ", none_type" + suffix; + } + if (isFreeFormObject(p) && getAdditionalProperties(p) == null) { + return prefix + "bool, date, datetime, dict, float, int, list, str" + fullSuffix; + } else if (ModelUtils.isNumberSchema(p)) { + return prefix + "int, float" + fullSuffix; + } else if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { + Schema inner = getAdditionalProperties(p); + return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; + } else if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + if (inner == null) { + // In OAS 3.0.x, the array "items" attribute is required. + // In OAS >= 3.1, the array "items" attribute is optional such that the OAS + // specification is aligned with the JSON schema specification. + // When "items" is not specified, the elements of the array may be anything at all. + // In that case, the return value should be: + // "[bool, date, datetime, dict, float, int, list, str, none_type]" + // Using recursion to wrap the allowed python types in an array. + Schema anyType = new Schema(); // A Schema without any attribute represents 'any type'. + return getTypeString(anyType, "[", "]", referencedModelNames); + } else { + return prefix + getTypeString(inner, "[", "]", referencedModelNames) + fullSuffix; + } + } + if (ModelUtils.isFileSchema(p)) { + return prefix + "file_type" + fullSuffix; + } + String baseType = getSchemaType(p); + return prefix + baseType + fullSuffix; + } + + /** + * Output the type declaration of a given name + * + * @param p property schema + * @return a string presentation of the type + */ + @Override + public String getTypeDeclaration(Schema p) { + // this is used to set dataType, which defines a python tuple of classes + // in Python we will wrap this in () to make it a tuple but here we + // will omit the parens so the generated documentaion will not include + // them + return getTypeString(p, "", "", null); + } + + @Override + public String toInstantiationType(Schema property) { + if (ModelUtils.isArraySchema(property) || ModelUtils.isMapSchema(property) || property.getAdditionalProperties() != null) { + return getSchemaType(property); + } + return super.toInstantiationType(property); + } + + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { + Schema addProps = getAdditionalProperties(schema); + if (addProps != null) { + // if AdditionalProperties exists, get its datatype and + // store it in codegenModel.additionalPropertiesType. + // The 'addProps' may be a reference, getTypeDeclaration will resolve + // the reference. + List referencedModelNames = new ArrayList(); + codegenModel.additionalPropertiesType = getTypeString(addProps, "", "", referencedModelNames); + if (referencedModelNames.size() != 0) { + // Models that are referenced in the 'additionalPropertiesType' keyword + // must be added to the imports. + codegenModel.imports.addAll(referencedModelNames); + } + } + // If addProps is null, the value of the 'additionalProperties' keyword is set + // to false, i.e. no additional properties are allowed. + } + + /** + * Gets an example if it exists + * + * @param sc input schema + * @return the example value + */ + protected Object getObjectExample(Schema sc) { + Schema schema = sc; + String ref = sc.get$ref(); + if (ref != null) { + schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + // TODO handle examples in object models in the future + Boolean objectModel = (ModelUtils.isObjectSchema(schema) || ModelUtils.isMapSchema(schema) || ModelUtils.isComposedSchema(schema)); + if (objectModel) { + return null; + } + if (schema.getExample() != null) { + return schema.getExample(); + } + if (schema.getDefault() != null) { + return schema.getDefault(); + } else if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { + return schema.getEnum().get(0); + } + return null; + } + + /*** + * Ensures that the string has a leading and trailing quote + * + * @param in input string + * @return quoted string + */ + private String ensureQuotes(String in) { + Pattern pattern = Pattern.compile("\r\n|\r|\n"); + Matcher matcher = pattern.matcher(in); + if (matcher.find()) { + // if a string has a new line in it add triple quotes to make it a python multiline string + return "'''" + in + "'''"; + } + String strPattern = "^['\"].*?['\"]$"; + if (in.matches(strPattern)) { + return in; + } + return "\"" + in + "\""; + } + + public String toExampleValue(Schema schema, Object objExample) { + String modelName = getModelName(schema); + return toExampleValueRecursive(modelName, schema, objExample, 1, "", 0); + } + + private Boolean simpleStringSchema(Schema schema) { + Schema sc = schema; + String ref = schema.get$ref(); + if (ref != null) { + sc = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + if (ModelUtils.isStringSchema(sc) && !ModelUtils.isDateSchema(sc) && !ModelUtils.isDateTimeSchema(sc) && !"Number".equalsIgnoreCase(sc.getFormat()) && !ModelUtils.isByteArraySchema(sc) && !ModelUtils.isBinarySchema(sc) && schema.getPattern() == null) { + return true; + } + return false; + } + + private MappedModel getDiscriminatorMappedModel(CodegenDiscriminator disc) { + for (MappedModel mm : disc.getMappedModels()) { + String modelName = mm.getModelName(); + Schema modelSchema = getModelNameToSchemaCache().get(modelName); + if (ModelUtils.isObjectSchema(modelSchema)) { + return mm; + } + } + return null; + } + + /*** + * Recursively generates string examples for schemas + * + * @param modelName the string name of the refed model that will be generated for the schema or null + * @param schema the schema that we need an example for + * @param objExample the example that applies to this schema, for now only string example are used + * @param indentationLevel integer indentation level that we are currently at + * we assume the indentaion amount is 4 spaces times this integer + * @param prefix the string prefix that we will use when assigning an example for this line + * this is used when setting key: value, pairs "key: " is the prefix + * and this is used when setting properties like some_property='some_property_example' + * @param exampleLine this is the current line that we are generatign an example for, starts at 0 + * we don't indentin the 0th line because using the example value looks like: + * prop = ModelName( line 0 + * some_property='some_property_example' line 1 + * ) line 2 + * and our example value is: + * ModelName( line 0 + * some_property='some_property_example' line 1 + * ) line 2 + * @return the string example + */ + private String toExampleValueRecursive(String modelName, Schema schema, Object objExample, int indentationLevel, String prefix, Integer exampleLine) { + final String indentionConst = " "; + String currentIndentation = ""; + String closingIndentation = ""; + for (int i = 0; i < indentationLevel; i++) currentIndentation += indentionConst; + if (exampleLine.equals(0)) { + closingIndentation = currentIndentation; + currentIndentation = ""; + } else { + closingIndentation = currentIndentation; + } + String openChars = ""; + String closeChars = ""; + if (modelName != null) { + openChars = modelName + "("; + closeChars = ")"; + } + + String fullPrefix = currentIndentation + prefix + openChars; + + String example = null; + if (objExample != null) { + example = objExample.toString(); + } + if (null != schema.get$ref()) { + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + String ref = ModelUtils.getSimpleRef(schema.get$ref()); + Schema refSchema = allDefinitions.get(ref); + if (null == refSchema) { + LOGGER.warn("Unable to find referenced schema " + schema.get$ref() + "\n"); + return fullPrefix + "None" + closeChars; + } + String refModelName = getModelName(schema); + return toExampleValueRecursive(refModelName, refSchema, objExample, indentationLevel, prefix, exampleLine); + } else if (ModelUtils.isNullType(schema) || isAnyTypeSchema(schema)) { + // The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x, + // though this tooling supports it. + return fullPrefix + "None" + closeChars; + } else if (ModelUtils.isBooleanSchema(schema)) { + if (objExample == null) { + example = "True"; + } else { + if ("false".equalsIgnoreCase(objExample.toString())) { + example = "False"; + } else { + example = "True"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isDateSchema(schema)) { + if (objExample == null) { + example = pythonDate("1970-01-01"); + } else { + example = pythonDate(objExample); + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isDateTimeSchema(schema)) { + if (objExample == null) { + example = pythonDateTime("1970-01-01T00:00:00.00Z"); + } else { + example = pythonDateTime(objExample); + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isBinarySchema(schema)) { + if (objExample == null) { + example = "/path/to/file"; + } + example = "open('" + example + "', 'rb')"; + return fullPrefix + example + closeChars; + } else if (ModelUtils.isByteArraySchema(schema)) { + if (objExample == null) { + example = "'YQ=='"; + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isStringSchema(schema)) { + if (objExample == null) { + // a BigDecimal: + if ("Number".equalsIgnoreCase(schema.getFormat())) { + example = "2"; + return fullPrefix + example + closeChars; + } else if (StringUtils.isNotBlank(schema.getPattern())) { + String pattern = schema.getPattern(); + RgxGen rgxGen = new RgxGen(pattern); + // this seed makes it so if we have [a-z] we pick a + Random random = new Random(18); + String sample = rgxGen.generate(random); + // omit leading / and trailing /, omit trailing /i + Pattern valueExtractor = Pattern.compile("^/?(.+?)/?.?$"); + Matcher m = valueExtractor.matcher(sample); + if (m.find()) { + example = m.group(m.groupCount()); + } else { + example = ""; + } + } else if (schema.getMinLength() != null) { + example = ""; + int len = schema.getMinLength().intValue(); + for (int i = 0; i < len; i++) example += "a"; + } else if (ModelUtils.isUUIDSchema(schema)) { + example = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; + } else { + example = "string_example"; + } + } + return fullPrefix + ensureQuotes(example) + closeChars; + } else if (ModelUtils.isIntegerSchema(schema)) { + if (objExample == null) { + if (schema.getMinimum() != null) { + example = schema.getMinimum().toString(); + } else { + example = "1"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isNumberSchema(schema)) { + if (objExample == null) { + if (schema.getMinimum() != null) { + example = schema.getMinimum().toString(); + } else { + example = "3.14"; + } + } + return fullPrefix + example + closeChars; + } else if (ModelUtils.isArraySchema(schema)) { + if (objExample instanceof Iterable) { + // If the example is already a list, return it directly instead of wrongly wrap it in another list + return fullPrefix + objExample.toString(); + } + ArraySchema arrayschema = (ArraySchema) schema; + Schema itemSchema = arrayschema.getItems(); + String itemModelName = getModelName(itemSchema); + example = fullPrefix + "[" + "\n" + toExampleValueRecursive(itemModelName, itemSchema, objExample, indentationLevel + 1, "", exampleLine + 1) + ",\n" + closingIndentation + "]" + closeChars; + return example; + } else if (ModelUtils.isMapSchema(schema)) { + if (modelName == null) { + fullPrefix += "dict("; + closeChars = ")"; + } + Object addPropsObj = schema.getAdditionalProperties(); + // TODO handle true case for additionalProperties + if (addPropsObj instanceof Schema) { + Schema addPropsSchema = (Schema) addPropsObj; + String key = "key"; + Object addPropsExample = getObjectExample(addPropsSchema); + if (addPropsSchema.getEnum() != null && !addPropsSchema.getEnum().isEmpty()) { + key = addPropsSchema.getEnum().get(0).toString(); + } + addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); + String addPropPrefix = key + "="; + if (modelName == null) { + addPropPrefix = ensureQuotes(key) + ": "; + } + String addPropsModelName = getModelName(addPropsSchema); + example = fullPrefix + "\n" + toExampleValueRecursive(addPropsModelName, addPropsSchema, addPropsExample, indentationLevel + 1, addPropPrefix, exampleLine + 1) + ",\n" + closingIndentation + closeChars; + } else { + example = fullPrefix + closeChars; + } + return example; + } else if (ModelUtils.isObjectSchema(schema)) { + if (modelName == null) { + fullPrefix += "dict("; + closeChars = ")"; + } + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); + if (disc != null) { + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm != null) { + String discPropNameValue = mm.getMappingName(); + String chosenModelName = mm.getModelName(); + // TODO handle this case in the future, this is when the discriminated + // schema allOf includes this schema, like Cat allOf includes Pet + // so this is the composed schema use case + } else { + return fullPrefix + closeChars; + } + } + return exampleForObjectModel(schema, fullPrefix, closeChars, null, indentationLevel, exampleLine, closingIndentation); + } else if (ModelUtils.isComposedSchema(schema)) { + // TODO add examples for composed schema models without discriminators + + CodegenDiscriminator disc = createDiscriminator(modelName, schema, openAPI); + if (disc != null) { + MappedModel mm = getDiscriminatorMappedModel(disc); + if (mm != null) { + String discPropNameValue = mm.getMappingName(); + String chosenModelName = mm.getModelName(); + Schema modelSchema = getModelNameToSchemaCache().get(chosenModelName); + CodegenProperty cp = new CodegenProperty(); + cp.setName(disc.getPropertyName()); + cp.setExample(discPropNameValue); + return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation); + } else { + return fullPrefix + closeChars; + } + } + return fullPrefix + closeChars; + } else { + LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); + } + + return example; + } + + private String exampleForObjectModel(Schema schema, String fullPrefix, String closeChars, CodegenProperty discProp, int indentationLevel, int exampleLine, String closingIndentation) { + Map requiredAndOptionalProps = schema.getProperties(); + if (requiredAndOptionalProps == null || requiredAndOptionalProps.isEmpty()) { + return fullPrefix + closeChars; + } + + String example = fullPrefix + "\n"; + for (Map.Entry entry : requiredAndOptionalProps.entrySet()) { + String propName = entry.getKey(); + Schema propSchema = entry.getValue(); + propName = toVarName(propName); + String propModelName = null; + Object propExample = null; + if (discProp != null && propName.equals(discProp.name)) { + propModelName = null; + propExample = discProp.example; + } else { + propModelName = getModelName(propSchema); + propExample = exampleFromStringOrArraySchema(propSchema, null, propName); + } + example += toExampleValueRecursive(propModelName, propSchema, propExample, indentationLevel + 1, propName + "=", exampleLine + 1) + ",\n"; + } + // TODO handle additionalProperties also + example += closingIndentation + closeChars; + return example; + } + + private Object exampleFromStringOrArraySchema(Schema sc, Object currentExample, String propName) { + if (currentExample != null) { + return currentExample; + } + Schema schema = sc; + String ref = sc.get$ref(); + if (ref != null) { + schema = ModelUtils.getSchema(this.openAPI, ModelUtils.getSimpleRef(ref)); + } + Object example = getObjectExample(schema); + if (example != null) { + return example; + } else if (simpleStringSchema(schema)) { + return propName + "_example"; + } else if (ModelUtils.isArraySchema(schema)) { + ArraySchema arraySchema = (ArraySchema) schema; + Schema itemSchema = arraySchema.getItems(); + example = getObjectExample(itemSchema); + if (example != null) { + return example; + } else if (simpleStringSchema(itemSchema)) { + return propName + "_example"; + } + } + return null; + } + + + /*** + * + * Set the codegenParameter example value + * We have a custom version of this function so we can invoke toExampleValue + * + * @param codegenParameter the item we are setting the example on + * @param parameter the base parameter that came from the spec + */ + @Override + public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) { + Schema schema = parameter.getSchema(); + if (schema == null) { + LOGGER.warn("CodegenParameter.example defaulting to null because parameter lacks a schema"); + return; + } + + Object example = null; + if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { + example = codegenParameter.vendorExtensions.get("x-example"); + } else if (parameter.getExample() != null) { + example = parameter.getExample(); + } else if (parameter.getExamples() != null && !parameter.getExamples().isEmpty() && parameter.getExamples().values().iterator().next().getValue() != null) { + example = parameter.getExamples().values().iterator().next().getValue(); + } else { + example = getObjectExample(schema); + } + example = exampleFromStringOrArraySchema(schema, example, parameter.getName()); + String finalExample = toExampleValue(schema, example); + codegenParameter.example = finalExample; + } + + /** + * Return the example value of the parameter. + * + * @param codegenParameter Codegen parameter + * @param requestBody Request body + */ + @Override + public void setParameterExampleValue(CodegenParameter codegenParameter, RequestBody requestBody) { + if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { + codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); + } + + Content content = requestBody.getContent(); + + if (content.size() > 1) { + // @see ModelUtils.getSchemaFromContent() + once(LOGGER).warn("Multiple MediaTypes found, using only the first one"); + } + + MediaType mediaType = content.values().iterator().next(); + Schema schema = mediaType.getSchema(); + if (schema == null) { + LOGGER.warn("CodegenParameter.example defaulting to null because requestBody content lacks a schema"); + return; + } + + Object example = null; + if (mediaType.getExample() != null) { + example = mediaType.getExample(); + } else if (mediaType.getExamples() != null && !mediaType.getExamples().isEmpty() && mediaType.getExamples().values().iterator().next().getValue() != null) { + example = mediaType.getExamples().values().iterator().next().getValue(); + } else { + example = getObjectExample(schema); + } + example = exampleFromStringOrArraySchema(schema, example, codegenParameter.paramName); + codegenParameter.example = toExampleValue(schema, example); + } + + /** + * Create a CodegenParameter for a Form Property + * We have a custom version of this method so we can invoke + * setParameterExampleValue(codegenParameter, parameter) + * rather than setParameterExampleValue(codegenParameter) + * This ensures that all of our samples are generated in + * toExampleValueRecursive + * + * @param name the property name + * @param propertySchema the property schema + * @param imports our import set + * @return the resultant CodegenParameter + */ + @Override + public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set imports) { + CodegenParameter cp = super.fromFormProperty(name, propertySchema, imports); + Parameter p = new Parameter(); + p.setSchema(propertySchema); + p.setName(cp.paramName); + setParameterExampleValue(cp, p); + return cp; + } + + /** + * Return a map from model name to Schema for efficient lookup. + * + * @return map from model name to Schema. + */ + protected Map getModelNameToSchemaCache() { + if (modelNameToSchemaCache == null) { + // Create a cache to efficiently lookup schema based on model name. + Map m = new HashMap(); + ModelUtils.getSchemas(openAPI).forEach((key, schema) -> { + m.put(toModelName(key), schema); + }); + modelNameToSchemaCache = Collections.unmodifiableMap(m); + } + return modelNameToSchemaCache; + } + + @Override + protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property){ + if (schema.equals(new Schema())) { + // if we are trying to set additionalProperties on an empty schema stop recursing + return; + } + boolean additionalPropertiesIsAnyType = false; + CodegenModel m = null; + if (property instanceof CodegenModel) { + m = (CodegenModel) property; + } + CodegenProperty addPropProp = null; + boolean isAdditionalPropertiesTrue = false; + if (schema.getAdditionalProperties() == null) { + if (!disallowAdditionalPropertiesIfNotPresent) { + isAdditionalPropertiesTrue = true; + // pass in the hashCode as the name to ensure that the returned property is not from the cache + // if we need to set indent on every one, then they need to be different + addPropProp = fromProperty(String.valueOf(property.hashCode()), new Schema()); + addPropProp.name = ""; + addPropProp.baseName = ""; + addPropProp.nameInSnakeCase = null; + additionalPropertiesIsAnyType = true; + } + } else if (schema.getAdditionalProperties() instanceof Boolean) { + if (Boolean.TRUE.equals(schema.getAdditionalProperties())) { + isAdditionalPropertiesTrue = true; + addPropProp = fromProperty(String.valueOf(property.hashCode()), new Schema()); + addPropProp.name = ""; + addPropProp.baseName = ""; + addPropProp.nameInSnakeCase = null; + additionalPropertiesIsAnyType = true; + } + } else { + addPropProp = fromProperty(String.valueOf(property.hashCode()), (Schema) schema.getAdditionalProperties()); + addPropProp.name = ""; + addPropProp.baseName = ""; + addPropProp.nameInSnakeCase = null; + if (isAnyTypeSchema((Schema) schema.getAdditionalProperties())) { + additionalPropertiesIsAnyType = true; + } + } + if (additionalPropertiesIsAnyType) { + property.setAdditionalPropertiesIsAnyType(true); + } + if (m != null && isAdditionalPropertiesTrue) { + m.isAdditionalPropertiesTrue = true; + } + if (ModelUtils.isComposedSchema(schema) && !supportsAdditionalPropertiesWithComposedSchema) { + return; + } + if (addPropProp != null) { + property.setAdditionalProperties(addPropProp); + } + } + + /** + * Update property for array(list) container + * + * @param property Codegen property + * @param innerProperty Codegen inner property of map or list + */ + @Override + protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) { + if (innerProperty == null) { + if(LOGGER.isWarnEnabled()) { + LOGGER.warn("skipping invalid array property {}", Json.pretty(property)); + } + return; + } + property.dataFormat = innerProperty.dataFormat; + if (languageSpecificPrimitives.contains(innerProperty.baseType)) { + property.isPrimitiveType = true; + } + property.items = innerProperty; + property.mostInnerItems = getMostInnerItems(innerProperty); + // inner item is Enum + if (isPropertyInnerMostEnum(property)) { + // isEnum is set to true when the type is an enum + // or the inner type of an array/map is an enum + property.isEnum = true; + // update datatypeWithEnum and default value for array + // e.g. List => List + updateDataTypeWithEnumForArray(property); + // set allowable values to enum values (including array/map of enum) + property.allowableValues = getInnerEnumAllowableValues(property); + } + + } + + protected void updatePropertyForString(CodegenProperty property, Schema p) { + if (ModelUtils.isByteArraySchema(p)) { + property.isByteArray = true; + property.setIsString(false); + } else if (ModelUtils.isBinarySchema(p)) { + property.isBinary = true; + property.isFile = true; // file = binary in OAS3 + } else if (ModelUtils.isUUIDSchema(p)) { + property.isUuid = true; + } else if (ModelUtils.isURISchema(p)) { + property.isUri = true; + } else if (ModelUtils.isEmailSchema(p)) { + property.isEmail = true; + } else if (ModelUtils.isDateSchema(p)) { // date format + property.setIsString(false); // for backward compatibility with 2.x + property.isDate = true; + } else if (ModelUtils.isDateTimeSchema(p)) { // date-time format + property.setIsString(false); // for backward compatibility with 2.x + property.isDateTime = true; + } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number + property.isDecimal = true; + property.setIsString(false); + } + property.pattern = toRegularExpression(p.getPattern()); + } + + @Override + protected void updatePropertyForObject(CodegenProperty property, Schema p) { + addVarsRequiredVarsAdditionalProps(p, property); + } + + @Override + protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { + // The 'null' value is allowed when the OAS schema is 'any type'. + // See https://github.com/OAI/OpenAPI-Specification/issues/1389 + if (Boolean.FALSE.equals(p.getNullable())) { + LOGGER.warn("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", p.getName()); + } + addVarsRequiredVarsAdditionalProps(p, property); + } + + @Override + protected void updateModelForObject(CodegenModel m, Schema schema) { + if (schema.getProperties() != null || schema.getRequired() != null) { + // passing null to allProperties and allRequired as there's no parent + addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); + } + // an object or anyType composed schema that has additionalProperties set + addAdditionPropertiesToCodeGenModel(m, schema); + // process 'additionalProperties' + setAddProps(schema, m); + } + + @Override + protected void updateModelForAnyType(CodegenModel m, Schema schema) { + // The 'null' value is allowed when the OAS schema is 'any type'. + // See https://github.com/OAI/OpenAPI-Specification/issues/1389 + if (Boolean.FALSE.equals(schema.getNullable())) { + LOGGER.error("Schema '{}' is any type, which includes the 'null' value. 'nullable' cannot be set to 'false'", m.name); + } + // todo add items support here in the future + if (schema.getProperties() != null || schema.getRequired() != null) { + // passing null to allProperties and allRequired as there's no parent + addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); + } + addAdditionPropertiesToCodeGenModel(m, schema); + // process 'additionalProperties' + setAddProps(schema, m); + } + + @Override + protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map allDefinitions) { + final ComposedSchema composed = (ComposedSchema) schema; + + // TODO revise the logic below to set discriminator, xml attributes + if (composed.getAllOf() != null) { + int modelImplCnt = 0; // only one inline object allowed in a ComposedModel + int modelDiscriminators = 0; // only one discriminator allowed in a ComposedModel + for (Schema innerSchema : composed.getAllOf()) { // TODO need to work with anyOf, oneOf as well + if (m.discriminator == null && innerSchema.getDiscriminator() != null) { + LOGGER.debug("discriminator is set to null (not correctly set earlier): {}", m.name); + m.setDiscriminator(createDiscriminator(m.name, innerSchema, this.openAPI)); + if (!this.getLegacyDiscriminatorBehavior()) { + m.addDiscriminatorMappedModelsImports(); + } + modelDiscriminators++; + } + + if (innerSchema.getXml() != null) { + m.xmlPrefix = innerSchema.getXml().getPrefix(); + m.xmlNamespace = innerSchema.getXml().getNamespace(); + m.xmlName = innerSchema.getXml().getName(); + } + if (modelDiscriminators > 1) { + LOGGER.error("Allof composed schema is inheriting >1 discriminator. Only use one discriminator: {}", composed); + } + + if (modelImplCnt++ > 1) { + LOGGER.warn("More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored."); + break; // only one schema with discriminator allowed in allOf + } + } + } + + CodegenComposedSchemas cs = m.getComposedSchemas(); + if (cs != null) { + if (cs.getAllOf() != null && !cs.getAllOf().isEmpty()) { + for (CodegenProperty cp: cs.getAllOf()) { + if (cp.complexType != null) { + addImport(m, cp.complexType); + } + } + } + if (cs.getOneOf() != null && !cs.getOneOf().isEmpty()) { + for (CodegenProperty cp: cs.getOneOf()) { + if (cp.complexType != null) { + addImport(m, cp.complexType); + } + } + } + if (cs.getAnyOf() != null && !cs.getAnyOf().isEmpty()) { + for (CodegenProperty cp: cs.getAnyOf()) { + if (cp.complexType != null) { + addImport(m, cp.complexType); + } + } + } + } + } + + @Override + public Map postProcessModels(Map objs) { + // process enum in models + return postProcessModelsEnum(objs); + } + + /* + * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python + * does not support this in as natural a way so it needs to convert it. See + * https://docs.python.org/2/howto/regex.html#compilation-flags for details. + */ + public void postProcessPattern(String pattern, Map vendorExtensions) { + if (pattern != null) { + int i = pattern.lastIndexOf('/'); + + //Must follow Perl /pattern/modifiers convention + if (pattern.charAt(0) != '/' || i < 2) { + throw new IllegalArgumentException("Pattern must follow the Perl " + + "/pattern/modifiers convention. " + pattern + " is not valid."); + } + + String regex = pattern.substring(1, i).replace("'", "\\'"); + List modifiers = new ArrayList(); + + for (char c : pattern.substring(i).toCharArray()) { + if (regexModifiers.containsKey(c)) { + String modifier = regexModifiers.get(c); + modifiers.add(modifier); + } + } + + vendorExtensions.put("x-regex", regex); + vendorExtensions.put("x-modifiers", modifiers); + } + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + modelDocPath); + } + + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + @Override + public String addRegularExpressionDelimiter(String pattern) { + if (StringUtils.isEmpty(pattern)) { + return pattern; + } + + if (!pattern.matches("^/.*")) { + // Perform a negative lookbehind on each `/` to ensure that it is escaped. + return "/" + pattern.replaceAll("(? + * (PEP 0008) Python packages should also have short, all-lowercase names, + * although the use of underscores is discouraged. + * + * @param packageName Package name + * @return Python package name that conforms to PEP 0008 + */ + @SuppressWarnings("static-method") + public String generatePackageName(String packageName) { + return underscore(packageName.replaceAll("[^\\w]+", "")); + } + + /** + * A custom version of this method is needed to ensure that the form object parameter is kept as-is + * as an object and is not exploded into separate parameters + * @param body the body that is being handled + * @param imports the imports for this body + * @return the list of length one containing a single type object CodegenParameter + */ + @Override + public List fromRequestBodyToFormParameters(RequestBody body, Set imports) { + List parameters = new ArrayList<>(); + LOGGER.debug("debugging fromRequestBodyToFormParameters= {}", body); + Schema schema = ModelUtils.getSchemaFromRequestBody(body); + schema = ModelUtils.getReferencedSchema(this.openAPI, schema); + CodegenParameter cp = fromFormProperty("body", schema, imports); + cp.setContent(getContent(body.getContent(), imports, "RequestBody")); + cp.isFormParam = false; + cp.isBodyParam = true; + parameters.add(cp); + return parameters; + } + + /** + * Custom version of this method so we can move the body parameter into bodyParam + * + * @param path the path of the operation + * @param httpMethod HTTP method + * @param operation OAS operation object + * @param servers list of servers + * @return the resultant CodegenOperation instance + */ + @Override + public CodegenOperation fromOperation(String path, + String httpMethod, + Operation operation, + List servers) { + CodegenOperation co = super.fromOperation(path, httpMethod, operation, servers); + if (co.bodyParam == null) { + for (CodegenParameter cp: co.allParams) { + if (cp.isBodyParam) { + co.bodyParam = cp; + co.bodyParams.add(cp); + } + } + } + return co; + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 727ec5d990f..c353b2a2846 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -102,6 +102,7 @@ org.openapitools.codegen.languages.ProtobufSchemaCodegen org.openapitools.codegen.languages.PythonLegacyClientCodegen org.openapitools.codegen.languages.PythonClientCodegen org.openapitools.codegen.languages.PythonFastAPIServerCodegen +org.openapitools.codegen.languages.PythonExperimentalClientCodegen org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen org.openapitools.codegen.languages.PythonBluePlanetServerCodegen diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars new file mode 100644 index 00000000000..e03e96972ab --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars @@ -0,0 +1,57 @@ +# {{{projectName}}} +{{#if appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/if}} + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{#unless hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/unless}} +- Build package: {{generatorClass}} +{{#if infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/if}} + +## Requirements. + +Python >= 3.9 +v3.9 is needed so one can combine classmethod and property decorators to define +object schema properties as classes + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) + +Then import the package: +```python +import {{{packageName}}} +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import {{{packageName}}} +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +{{> README_common }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars new file mode 100644 index 00000000000..17663663d7c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars @@ -0,0 +1,111 @@ +```python +{{#with apiInfo}}{{#each apis}}{{#unless hasMore}}{{#if hasHttpSignatureMethods}}import datetime{{/if}}{{/unless}}{{/each}}{{/with}} +import time +import {{{packageName}}} +from pprint import pprint +{{#with apiInfo}} +{{#each apis}} +{{#if @first}} +from {{packageName}}.{{apiPackage}} import {{classVarName}} +{{#each imports}} +{{{import}}} +{{/each}} +{{#with operations}} +{{#each operation}} +{{#if @first}} +{{> 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 = {{classVarName}}.{{{classname}}}(api_client) + {{#each allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{#unless required}} (optional){{/unless}}{{#if defaultValue}} (default to {{{.}}}){{/if}} + {{/each}} + + try: + {{#if summary}} # {{{summary}}} + {{/if}} {{#if returnType}}api_response = {{/if}}api_instance.{{{operationId}}}({{#each allParams}}{{#if required}}{{paramName}}{{/if}}{{#unless required}}{{paramName}}={{paramName}}{{/unless}}{{#if hasMore}}, {{/if}}{{/each}}){{#if returnType}} + pprint(api_response){{/if}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/if}} +{{/each}} +{{/with}} +{{/if}} +{{/each}} +{{/with}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#with apiInfo}}{{#each apis}}{{#with operations}}{{#each operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#if summary}}{{summary}}{{/if}} +{{/each}}{{/with}}{{/each}}{{/with}} + +## Documentation For Models + +{{#each models}}{{#with model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/with}}{{/each}} + +## Documentation For Authorization + +{{#unless authMethods}} + All endpoints do not require authorization. +{{/unless}} +{{#each authMethods}} +{{#if @last}} Authentication schemes defined for the API:{{/if}} +## {{{name}}} + +{{#if isApiKey}} +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#if isKeyInQuery}}URL query string{{/if}}{{#if isKeyInHeader}}HTTP header{{/if}} +{{/if}} +{{#if isBasic}} +{{#if isBasicBasic}} +- **Type**: HTTP basic authentication +{{/if}} +{{#if isBasicBearer}} +- **Type**: Bearer authentication{{#if bearerFormat}} ({{{bearerFormat}}}){{/if}} +{{/if}} +{{#if isHttpSignature}} +- **Type**: HTTP signature authentication +{{/if}} +{{/if}} +{{#if isOAuth}} +- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{#unless scopes}}N/A{{/unless}} +{{#each scopes}} - **{{{scope}}}**: {{{description}}} +{{/each}} +{{/if}} + +{{/each}} + +## Author + +{{#with apiInfo}}{{#each apis}}{{#unless hasMore}}{{infoEmail}} +{{/unless}}{{/each}}{{/with}} + +## 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}}}.{{apiPackage}}.default_api import DefaultApi` +- `from {{{packageName}}}.{{modelPackage}}.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-experimental/README_onlypackage.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars new file mode 100644 index 00000000000..f9fda7de212 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars @@ -0,0 +1,43 @@ +# {{{projectName}}} +{{#if appDescription}} +{{{appDescription}}} +{{/if}} + +The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{#unless hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/unless}} +- Build package: {{generatorClass}} +{{#if infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/if}} + +## Requirements. + +Python >= 3.6 + +## Installation & Usage + +This python library package is generated without supporting files like setup.py or requirements files + +To be able to use it, you will need these dependencies in your own package that uses this library: + +* urllib3 >= 1.15 +* certifi +* python-dateutil +{{#if asyncio}} +* aiohttp +{{/if}} +{{#if tornado}} +* tornado>=4.2,<5 +{{/if}} + +## Getting Started + +In your own code, to use this library to connect and interact with {{{projectName}}}, +you can run the following: + +{{> README_common }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__.handlebars new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__api.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__api.handlebars new file mode 100644 index 00000000000..1e059f73613 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__api.handlebars @@ -0,0 +1,9 @@ +{{#with apiInfo}} +{{#each apis}} +{{#if @first}} +# 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 apis from one package, import them with +# from {{packageName}}.apis import {{classname}} +{{/if}} +{{/each}} +{{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars new file mode 100644 index 00000000000..c8466369da7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars @@ -0,0 +1,24 @@ +{{#with apiInfo}} +{{#each apis}} +{{#if @first}} +# coding: utf-8 + +# flake8: noqa + +# Import all APIs into this package. +# If you have many APIs here with many many models used in each API this may +# raise a `RecursionError`. +# In order to avoid this, import only the API that you directly need like: +# +# from {{packagename}}.{{apiPackage}}.{{classVarName}} import {{classname}} +# +# or import this package, but before doing it, use: +# +# import sys +# sys.setrecursionlimit(n) + +# Import APIs into API package: +{{/if}} +from {{packageName}}.{{apiPackage}}.{{classVarName}} import {{classname}} +{{/each}} +{{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__model.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__model.handlebars new file mode 100644 index 00000000000..b6b698b0452 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__model.handlebars @@ -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/modules/openapi-generator/src/main/resources/python-experimental/__init__models.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__models.handlebars new file mode 100644 index 00000000000..31eac9cd544 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__models.handlebars @@ -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 {{packageName}}.{{modelPackage}}.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +{{#each models}} +{{#with model}} +from {{packageName}}.{{modelPackage}}.{{classFilename}} import {{classname}} +{{/with}} +{{/each}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__package.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__package.handlebars new file mode 100644 index 00000000000..26350c7252d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__package.handlebars @@ -0,0 +1,28 @@ +# coding: utf-8 + +# flake8: noqa + +{{>partial_header}} + +__version__ = "{{packageVersion}}" + +# import ApiClient +from {{packageName}}.api_client import ApiClient + +# import Configuration +from {{packageName}}.configuration import Configuration +{{#if hasHttpSignatureMethods}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/if}} + +# 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 +{{#if recursionLimit}} + +__import__('sys').setrecursionlimit({{recursionLimit}}) +{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api.handlebars new file mode 100644 index 00000000000..c6c0b423707 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/api.handlebars @@ -0,0 +1,26 @@ +# coding: utf-8 + +{{>partial_header}} + +from {{packageName}}.api_client import ApiClient +{{#with operations}} +{{#each operation}} +from {{packageName}}.api.{{classFilename}}_endpoints.{{operationId}} import {{operationIdCamelCase}} +{{/each}} +{{/with}} + + +{{#with operations}} +class {{classname}}( +{{#each operation}} + {{operationIdCamelCase}}, +{{/each}} + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass +{{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars new file mode 100644 index 00000000000..47c28bff18d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars @@ -0,0 +1,1380 @@ +# coding: utf-8 +{{>partial_header}} + +from dataclasses import dataclass +from decimal import Decimal +import enum +import json +import os +import io +import atexit +from multiprocessing.pool import ThreadPool +import re +import tempfile +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict +from urllib.parse import quote +from urllib3.fields import RequestField as RequestFieldBase + +{{#if tornado}} +import tornado.gen +{{/if}} + +from {{packageName}} import rest +from {{packageName}}.configuration import Configuration +from {{packageName}}.exceptions import ApiTypeError, ApiValueError +from {{packageName}}.schemas import ( + Decimal, + NoneClass, + BoolClass, + Schema, + FileIO, + BinarySchema, + InstantiationMetadata, + date, + datetime, + none_type, + frozendict, + Unset, + unset, +) + + +class RequestField(RequestFieldBase): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, (str, int, float)): + # instances based on primitive classes + return obj + elif isinstance(obj, Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, NoneClass): + return None + elif isinstance(obj, BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class ParameterSerializerBase: + @staticmethod + def __serialize_number( + in_data: typing.Union[int, float], name: str, prefix='' + ) -> typing.Tuple[typing.Tuple[str, str]]: + return tuple([(name, prefix + str(in_data))]) + + @staticmethod + def __serialize_str( + in_data: str, name: str, prefix='' + ) -> typing.Tuple[typing.Tuple[str, str]]: + return tuple([(name, prefix + quote(in_data))]) + + @staticmethod + def __serialize_bool(in_data: bool, name: str, prefix='') -> typing.Tuple[typing.Tuple[str, str]]: + if in_data: + return tuple([(name, prefix + 'true')]) + return tuple([(name, prefix + 'false')]) + + @staticmethod + def __urlencode(in_data: typing.Any) -> str: + return quote(str(in_data)) + + def __serialize_list( + self, + in_data: typing.List[typing.Any], + style: ParameterStyle, + name: str, + explode: bool, + empty_val: typing.Union[typing.Tuple[str, str], typing.Tuple] = tuple(), + prefix: str = '', + separator: str = ',', + ) -> typing.Tuple[typing.Union[typing.Tuple[str, str], typing.Tuple], ...]: + if not in_data: + return empty_val + if explode and style in { + ParameterStyle.FORM, + ParameterStyle.MATRIX, + ParameterStyle.SPACE_DELIMITED, + ParameterStyle.PIPE_DELIMITED + }: + if style is ParameterStyle.FORM: + return tuple((name, prefix + self.__urlencode(val)) for val in in_data) + else: + joined_vals = prefix + separator.join(name + '=' + self.__urlencode(val) for val in in_data) + else: + joined_vals = prefix + separator.join(map(self.__urlencode, in_data)) + return tuple([(name, joined_vals)]) + + def __form_item_representation(self, in_data: typing.Any) -> typing.Optional[str]: + if isinstance(in_data, none_type): + return None + elif isinstance(in_data, list): + if not in_data: + return None + raise ApiValueError('Unable to generate a form representation of {}'.format(in_data)) + elif isinstance(in_data, dict): + if not in_data: + return None + raise ApiValueError('Unable to generate a form representation of {}'.format(in_data)) + elif isinstance(in_data, (bool, bytes)): + raise ApiValueError('Unable to generate a form representation of {}'.format(in_data)) + # str, float, int + return self.__urlencode(in_data) + + def __serialize_dict( + self, + in_data: typing.Dict[str, typing.Any], + style: ParameterStyle, + name: str, + explode: bool, + empty_val: typing.Union[typing.Tuple[str, str], typing.Tuple] = tuple(), + prefix: str = '', + separator: str = ',', + ) -> typing.Tuple[typing.Tuple[str, str]]: + if not in_data: + return empty_val + if all(val is None for val in in_data.values()): + return empty_val + + form_items = {} + if style is ParameterStyle.FORM: + for key, val in in_data.items(): + new_val = self.__form_item_representation(val) + if new_val is None: + continue + form_items[key] = new_val + + if explode: + if style is ParameterStyle.FORM: + return tuple((key, prefix + val) for key, val in form_items.items()) + elif style in { + ParameterStyle.SIMPLE, + ParameterStyle.LABEL, + ParameterStyle.MATRIX, + ParameterStyle.SPACE_DELIMITED, + ParameterStyle.PIPE_DELIMITED + }: + joined_vals = prefix + separator.join(key + '=' + self.__urlencode(val) for key, val in in_data.items()) + else: + raise ApiValueError(f'Invalid style {style} for dict serialization with explode=True') + elif style is ParameterStyle.FORM: + joined_vals = prefix + separator.join(key + separator + val for key, val in form_items.items()) + else: + joined_vals = prefix + separator.join( + key + separator + self.__urlencode(val) for key, val in in_data.items()) + return tuple([(name, joined_vals)]) + + def _serialize_x( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + style: ParameterStyle, + name: str, + explode: bool, + empty_val: typing.Union[typing.Tuple[str, str], typing.Tuple] = (), + prefix: str = '', + separator: str = ',', + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + if isinstance(in_data, none_type): + return empty_val + elif isinstance(in_data, bool): + # must be before int check + return self.__serialize_bool(in_data, name=name, prefix=prefix) + elif isinstance(in_data, (int, float)): + return self.__serialize_number(in_data, name=name, prefix=prefix) + elif isinstance(in_data, str): + return self.__serialize_str(in_data, name=name, prefix=prefix) + elif isinstance(in_data, list): + return self.__serialize_list( + in_data, + style=style, + name=name, + explode=explode, + empty_val=empty_val, + prefix=prefix, + separator=separator + ) + elif isinstance(in_data, dict): + return self.__serialize_dict( + in_data, + style=style, + name=name, + explode=explode, + empty_val=empty_val, + prefix=prefix, + separator=separator + ) + + +class StyleFormSerializer(ParameterSerializerBase): + + def _serialize_form( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + return self._serialize_x(in_data, style=ParameterStyle.FORM, name=name, explode=explode) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + def _serialize_simple_tuple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + in_type: ParameterInType, + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + if in_type is ParameterInType.HEADER: + empty_val = () + else: + empty_val = ((name, ''),) + return self._serialize_x(in_data, style=ParameterStyle.SIMPLE, name=name, explode=explode, empty_val=empty_val) + + +@dataclass +class ParameterBase: + name: str + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] + + __style_to_in_type = { + ParameterStyle.MATRIX: {ParameterInType.PATH}, + ParameterStyle.LABEL: {ParameterInType.PATH}, + ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, + ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, + ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, + } + __in_type_to_default_style = { + ParameterInType.QUERY: ParameterStyle.FORM, + ParameterInType.PATH: ParameterStyle.SIMPLE, + ParameterInType.HEADER: ParameterStyle.SIMPLE, + ParameterInType.COOKIE: ParameterStyle.FORM, + } + __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} + _json_encoder = JSONEncoder() + _json_content_type = 'application/json' + + @classmethod + def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): + if style is None: + return + in_type_set = cls.__style_to_in_type[style] + if in_type not in in_type_set: + raise ValueError( + 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( + style, in_type_set + ) + ) + + def __init__( + self, + name: str, + in_type: ParameterInType, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + if schema is None and content is None: + raise ValueError('Value missing; Pass in either schema or content') + if schema and content: + raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') + if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: + raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) + self.__verify_style_to_in_type(style, in_type) + if content is None and style is None: + style = self.__in_type_to_default_style[in_type] + if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: + raise ValueError('Invalid content length, content length must equal 1') + self.in_type = in_type + self.name = name + self.required = required + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + self.schema = schema + self.content = content + + @staticmethod + def _remove_empty_and_cast( + in_data: typing.Tuple[typing.Tuple[str, str]], + ) -> typing.Dict[str, str]: + data = tuple(t for t in in_data if t) + if not data: + return dict() + return dict(data) + + def _serialize_json( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Tuple[typing.Tuple[str, str]]: + return tuple([(self.name, json.dumps(in_data))]) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.PATH, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_label( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + empty_val = ((self.name, ''),) + prefix = '.' + separator = '.' + return self._remove_empty_and_cast( + self._serialize_x( + in_data, + style=ParameterStyle.LABEL, + name=self.name, + explode=self.explode, + empty_val=empty_val, + prefix=prefix, + separator=separator + ) + ) + + def __serialize_matrix( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + separator = ',' + if in_data == '': + prefix = ';' + self.name + elif isinstance(in_data, (dict, list)) and self.explode: + prefix = ';' + separator = ';' + else: + prefix = ';' + self.name + '=' + empty_val = ((self.name, ''),) + return self._remove_empty_and_cast( + self._serialize_x( + in_data, + style=ParameterStyle.MATRIX, + name=self.name, + explode=self.explode, + prefix=prefix, + empty_val=empty_val, + separator=separator + ) + ) + + def _serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + tuple_data = self._serialize_simple_tuple(in_data, self.name, self.explode, self.in_type) + return self._remove_empty_and_cast(tuple_data) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if self.style: + if self.style is ParameterStyle.SIMPLE: + return self._serialize_simple(cast_in_data) + elif self.style is ParameterStyle.LABEL: + return self.__serialize_label(cast_in_data) + elif self.style is ParameterStyle.MATRIX: + return self.__serialize_matrix(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + tuple_data = self._serialize_json(cast_in_data) + return self._remove_empty_and_cast(tuple_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.QUERY, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_space_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + separator = '%20' + empty_val = () + return self._serialize_x( + in_data, + style=ParameterStyle.SPACE_DELIMITED, + name=self.name, + explode=self.explode, + separator=separator, + empty_val=empty_val + ) + + def __serialize_pipe_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + separator = '|' + empty_val = () + return self._serialize_x( + in_data, + style=ParameterStyle.PIPE_DELIMITED, + name=self.name, + explode=self.explode, + separator=separator, + empty_val=empty_val + ) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> typing.Tuple[typing.Tuple[str, str]]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if self.style: + # TODO update query ones to omit setting values when [] {} or None is input + if self.style is ParameterStyle.FORM: + return self._serialize_form(cast_in_data, explode=self.explode, name=self.name) + elif self.style is ParameterStyle.SPACE_DELIMITED: + return self.__serialize_space_delimited(cast_in_data) + elif self.style is ParameterStyle.PIPE_DELIMITED: + return self.__serialize_pipe_delimited(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + return self._serialize_json(cast_in_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.COOKIE, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> typing.Tuple[typing.Tuple[str, str]]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if self.style: + return self._serialize_form(cast_in_data, explode=self.explode, name=self.name) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + return self._serialize_json(cast_in_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(ParameterBase, StyleSimpleSerializer): + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.HEADER, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict[str, str]: + data = tuple(t for t in in_data if t) + headers = HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + def _serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> HTTPHeaderDict[str, str]: + tuple_data = self._serialize_simple_tuple(in_data, self.name, self.explode, self.in_type) + return self.__to_headers(tuple_data) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> HTTPHeaderDict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if self.style: + return self._serialize_simple(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + tuple_data = self._serialize_json(cast_in_data) + return self.__to_headers(tuple_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + + def __init__( + self, + schema: typing.Type[Schema], + encoding: typing.Optional[typing.Dict[str, Encoding]] = None, + ): + self.schema = schema + self.encoding = encoding + + +@dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[Unset, typing.Type[Schema]] + headers: typing.Union[Unset, typing.List[HeaderParameter]] + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[Unset, typing.Type[Schema]], + headers: typing.Union[Unset, typing.List[HeaderParameter]] + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[Unset, typing.Type[Schema]] = unset + headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset + + +class OpenApiResponse: + def __init__( + self, + response_cls: typing.Type[ApiResponse] = ApiResponse, + content: typing.Optional[typing.Dict[str, MediaType]] = None, + headers: typing.Optional[typing.List[HeaderParameter]] = None, + ): + self.headers = headers + if content is not None and len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + self.response_cls = response_cls + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + decoded_data = response.data.decode("utf-8") + return json.loads(decoded_data) + + @staticmethod + def __file_name_from_content_disposition(content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = re.search('filename="(.+?)"', content_disposition) + if not match: + return None + return match.group(1) + + def __deserialize_application_octet_stream( + self, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = self.__file_name_from_content_disposition(response.headers.get('content-disposition')) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + # TODO get file_name from the filename at the end of the url if it exists + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + content_type = response.getheader('content-type') + deserialized_body = unset + streamed = response.supports_chunked_reads() + if self.content is not None: + if content_type == 'application/json': + body_data = self.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = self.__deserialize_application_octet_stream(response) + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + body_schema = self.content[content_type].schema + _instantiation_metadata = InstantiationMetadata(from_server=True, configuration=configuration) + deserialized_body = body_schema._from_openapi_data( + body_data, _instantiation_metadata=_instantiation_metadata) + elif streamed: + response.release_conn() + + deserialized_headers = unset + if self.headers is not None: + deserialized_headers = unset + + return self.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + __json_encoder = JSONEncoder() + + def __init__( + self, + configuration: typing.Optional[Configuration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = '{{#if httpUserAgent}}{{{httpUserAgent}}}{{/if}}{{#unless httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/unless}}' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + {{#if tornado}} + @tornado.gen.coroutine + {{/if}} + {{#if asyncio}}async {{/if}}def __call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + headers = headers or {} + headers.update(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # path parameters + if path_params: + for k, v in path_params.items(): + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=self.configuration.safe_chars_for_path_param) + ) + + # auth setting + self.update_params_for_auth(headers, query_params, + auth_settings, resource_path, method, body) + + # request url + if host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = host + resource_path + + # perform request and return response + response = {{#if asyncio}}await {{/if}}{{#if tornado}}yield {{/if}}self.request( + method, + url, + query_params=query_params, + headers=headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings: Auth Settings names for the request. + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystme file and the BinarySchema + instance will also inherit from FileSchema and FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + path_params, + query_params, + headers, + body, + fields, + auth_settings, + stream, + timeout, + host, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + path_params, + query_params, + headers, + body, + json, + fields, + auth_settings, + stream, + timeout, + host, + ) + ) + + def request( + self, + method: str, + url: str, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) +{{#if hasHttpSignatureMethods}} + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers.add(key, value) +{{/if}} + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + +class Api: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + def get_host( + self, + operation_id: str, + servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), + host_index: typing.Optional[int] = None + ) -> typing.Optional[str]: + configuration = self.api_client.configuration + try: + if host_index is None: + index = configuration.server_operation_index.get( + operation_id, configuration.server_index + ) + else: + index = host_index + server_variables = configuration.server_operation_variables.get( + operation_id, configuration.server_variables + ) + host = configuration.get_host_from_settings( + index, variables=server_variables, servers=servers + ) + except IndexError: + if servers: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(servers) + ) + host = None + return host + + +class SerializedRequestBody(typing.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer): + """ + A request body parameter + content: content_type to MediaType Schema info + """ + __json_encoder = JSONEncoder() + + def __init__( + self, + content: typing.Dict[str, MediaType], + required: bool = False, + ): + self.required = required + if len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + + def __serialize_json( + self, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = self.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict): + raise ValueError('Unable to serialize type frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + def __multipart_json_item(self, key: str, value: Schema) -> RequestField: + json_value = self.__json_encoder.default(value) + return RequestField(name=key, data=json.dumps(json_value), headers={'Content-Type': 'application/json'}) + + def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + if isinstance(value, str): + return RequestField(name=key, data=str(value), headers={'Content-Type': 'text/plain'}) + elif isinstance(value, bytes): + return RequestField(name=key, data=value, headers={'Content-Type': 'application/octet-stream'}) + elif isinstance(value, FileIO): + request_field = RequestField( + name=key, + data=value.read(), + filename=os.path.basename(value.name), + headers={'Content-Type': 'application/octet-stream'} + ) + value.close() + return request_field + else: + return self.__multipart_json_item(key=key, value=value) + + def __serialize_multipart_form_data( + self, in_data: Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = self.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = self.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = self.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + def __serialize_application_x_www_form_data( + self, in_data: typing.Any + ) -> typing.Dict[str, tuple[tuple[str, str], ...]]: + if not isinstance(in_data, frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = self.__json_encoder.default(in_data) + fields = self._serialize_form(cast_in_data, explode=True, name='') + if not fields: + return {} + return {'fields': fields} + + def serialize( + self, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = self.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if content_type == 'application/json': + return self.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return self.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return self.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return self.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return self.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_doc.handlebars new file mode 100644 index 00000000000..6e74b8abb83 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_doc.handlebars @@ -0,0 +1,212 @@ +# {{packageName}}.{{classname}}{{#if description}} +{{description}}{{/if}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#with operations}}{{#each operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#if summary}}{{summary}}{{/if}} +{{/each}}{{/with}} + +{{#with operations}} +{{#each operation}} +# **{{{operationId}}}** +> {{#if returnType}}{{{returnType}}} {{/if}}{{{operationId}}}({{#each requiredParams}}{{#unless defaultValue}}{{paramName}}{{#if hasMore}}, {{/if}}{{/unless}}{{/each}}) + +{{{summary}}}{{#if notes}} + +{{{notes}}}{{/if}} + +### Example + +{{#if hasAuthMethods}} +{{#each authMethods}} +{{#if isBasic}} +{{#if isBasicBasic}} +* Basic Authentication ({{name}}): +{{/if}} +{{#if isBasicBearer}} +* Bearer{{#if bearerFormat}} ({{{bearerFormat}}}){{/if}} Authentication ({{name}}): +{{/if}} +{{/if}} +{{#if isApiKey}} +* Api Key Authentication ({{name}}): +{{/if}} +{{#if isOAuth}} +* OAuth Authentication ({{name}}): +{{/if}} +{{/each}} +{{/if}} +{{> api_doc_example }} +### Parameters +{{#if allParams}} + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#with bodyParam}} +{{baseName}} | typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{this.schema.baseName}}{{/each}}{{#unless required}}, Unset]{{else}}]{{/unless}} | {{#if required}}required{{else}}optional, default is unset{{/if}} | + {{/with}} + {{#if queryParams}} +query_params | RequestQueryParams | | + {{/if}} + {{#if headerParams}} +header_params | RequestHeaderParams | | + {{/if}} + {{#if pathParams}} +path_params | RequestPathParams | | + {{/if}} + {{#if cookieParams}} +cookie_params | RequestCookieParams | | + {{/if}} + {{#with bodyParam}} + {{#each content}} + {{#if @first}} +content_type | str | optional, default is '{{@key}}' | Selects the schema and serialization of the request body + {{/if}} + {{/each}} + {{/with}} + {{#if produces}} +accept_content_types | typing.Tuple[str] | default is ({{#each produces}}'{{this.mediaType}}', {{/each}}) | Tells the server the content type(s) that are accepted by the client + {{/if}} + {{#if servers}} +host_index | typing.Optional[int] | default is None | Allows one to select a different host + {{/if}} +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + {{#with bodyParam}} + +### body + {{#each content}} + {{#with this.schema}} +{{> api_doc_schema_type_hint }} + {{/with}} + {{/each}} + {{/with}} + {{#if queryParams}} + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each queryParams}} +{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + + {{#each queryParams}} + {{#with schema}} +{{> api_doc_schema_type_hint }} + {{/with}} + {{/each}} + {{/if}} + {{#if headerParams}} + +### header_params +#### RequestHeaderParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each headerParams}} +{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + {{#each headerParams}} + {{#with schema}} +{{> api_doc_schema_type_hint }} + {{/with}} + {{/each}} + {{/if}} + {{#if pathParams}} + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each pathParams}} +{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + {{#each pathParams}} + {{#with schema}} +{{> api_doc_schema_type_hint }} + {{/with}} + {{/each}} + {{/if}} + {{#if cookieParams}} + +### cookie_params +#### RequestCookieParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each cookieParams}} +{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + {{#each cookieParams}} + {{#with schema}} +{{> api_doc_schema_type_hint }} + {{/with}} + {{/each}} + {{/if}} +{{else}} +This endpoint does not need any parameter. +{{/if}} + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +{{#each responses}} +{{#if isDefault}} +default | ApiResponseForDefault | {{message}} {{description}} +{{else}} +{{code}} | ApiResponseFor{{code}} | {{message}} {{description}} +{{/if}} +{{/each}} +{{#each responses}} +{{#if isDefault}} + +#### ApiResponseForDefault +{{else}} + +#### ApiResponseFor{{code}} +{{/if}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | {{#unless content}}Unset{{else}}typing.Union[{{#each content}}{{this.schema.baseName}}, {{/each}}]{{/unless}} | {{#unless content}}body was not defined{{/unless}} | +headers | {{#unless responseHeaders}}Unset{{else}}ResponseHeadersFor{{code}}{{/unless}} | {{#unless responseHeaders}}headers were not defined{{/unless}} | +{{#each content}} +{{#with this.schema}} +{{> api_doc_schema_type_hint }} +{{/with}} +{{/each}} +{{#if responseHeaders}} +#### ResponseHeadersFor{{code}} + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + {{#each responseHeaders}} +{{baseName}} | {{#with schema}}{{baseName}}{{/with}} | | {{#unless required}}optional{{/unless}} + {{/each}} + {{#each responseHeaders}} + {{#with schema}} +{{> api_doc_schema_type_hint }} + {{/with}} + {{/each}} + +{{/if}} +{{/each}} + + +{{#if returnType}}{{#if returnTypeIsPrimitive}}**{{{returnType}}}**{{/if}}{{#unless returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/unless}}{{/if}}{{#unless returnType}}void (empty response body){{/unless}} + +### Authorization + +{{#unless authMethods}}No authorization required{{/unless}}{{#each authMethods}}[{{{name}}}](../README.md#{{{name}}}){{#unless @last}}, {{/unless}}{{/each}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/each}} +{{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars new file mode 100644 index 00000000000..eaa2260e3f0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars @@ -0,0 +1,163 @@ +```python +import {{{packageName}}} +from {{packageName}}.{{apiPackage}} import {{classVarName}} +{{#each imports}} +{{{.}}} +{{/each}} +from pprint import pprint +{{> 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 = {{classVarName}}.{{{classname}}}(api_client) +{{#if requiredParams}} + + # example passing only required values which don't have defaults set +{{#if pathParams}} + path_params = { + {{#each pathParams}} + {{#if required}} + '{{baseName}}': {{{example}}}, + {{/if}} + {{/each}} + } +{{/if}} +{{#if queryParams}} + query_params = { + {{#each queryParams}} + {{#if required}} + '{{baseName}}': {{{example}}}, + {{/if}} + {{/each}} + } +{{/if}} +{{#if cookieParams}} + cookie_params = { + {{#each cookieParams}} + {{#if required}} + '{{baseName}}': {{{example}}}, + {{/if}} + {{/each}} + } +{{/if}} +{{#if headerParams}} + header_params = { + {{#each headerParams}} + {{#if required}} + '{{baseName}}': {{{example}}}, + {{/if}} + {{/each}} + } +{{/if}} +{{#with bodyParam}} + {{#if required}} + body = {{{example}}} + {{/if}} +{{/with}} + try: +{{#if summary}} + # {{{summary}}} +{{/if}} + api_response = api_instance.{{{operationId}}}( + {{#if pathParams}} + path_params=path_params, + {{/if}} + {{#if queryParams}} + query_params=query_params, + {{/if}} + {{#if headerParams}} + header_params=header_params, + {{/if}} + {{#if cookieParams}} + cookie_params=cookie_params, + {{/if}} + {{#with bodyParam}} + {{#if required}} + body=body, + {{/if}} + {{/with}} + ) +{{#if returnType}} + pprint(api_response) +{{/if}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/if}} +{{#if optionalParams}} + + # example passing only optional values +{{#if pathParams}} + path_params = { + {{#each pathParams}} + '{{baseName}}': {{{example}}}, + {{/each}} + } +{{/if}} +{{#if queryParams}} + query_params = { + {{#each queryParams}} + '{{baseName}}': {{{example}}}, + {{/each}} + } +{{/if}} +{{#if cookieParams}} + cookie_params = { + {{#each cookieParams}} + '{{baseName}}': {{{example}}}, + {{/each}} + } +{{/if}} +{{#if headerParams}} + header_params = { + {{#each headerParams}} + '{{baseName}}': {{{example}}}, + {{/each}} + } +{{/if}} +{{#with bodyParam}} + body = {{{example}}} +{{/with}} + try: +{{#if summary}} + # {{{summary}}} +{{/if}} + api_response = api_instance.{{{operationId}}}( + {{#if pathParams}} + path_params=path_params, + {{/if}} + {{#if queryParams}} + query_params=query_params, + {{/if}} + {{#if headerParams}} + header_params=header_params, + {{/if}} + {{#if cookieParams}} + cookie_params=cookie_params, + {{/if}} + {{#if bodyParam}} + body=body, + {{/if}} + ) +{{#if returnType}} + pprint(api_response) +{{/if}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/if}} +{{#unless requiredParams}} +{{#unless optionalParams}} + + # example, this endpoint has no required or optional parameters + try: +{{#if summary}} + # {{{summary}}} +{{/if}} + api_response = api_instance.{{{operationId}}}() +{{#if returnType}} + pprint(api_response) +{{/if}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/unless}} +{{/unless}} +``` diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc_schema_type_hint.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_doc_schema_type_hint.handlebars new file mode 100644 index 00000000000..0698320ad88 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_doc_schema_type_hint.handlebars @@ -0,0 +1,10 @@ + +#### {{baseName}} +{{#if complexType}} +Type | Description | Notes +------------- | ------------- | ------------- +[**{{dataType}}**]({{complexType}}.md) | {{description}} | {{#if isReadOnly}}[readonly] {{/if}} + +{{else}} +{{> schema_doc }} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars new file mode 100644 index 00000000000..a999b4b16c9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars @@ -0,0 +1,34 @@ +# coding: utf-8 + +{{>partial_header}} + +import unittest + +import {{packageName}} +from {{packageName}}.api.{{classFilename}} import {{classname}} # noqa: E501 + + +class {{#with operations}}Test{{classname}}(unittest.TestCase): + """{{classname}} unit test stubs""" + + def setUp(self): + self.api = {{classname}}() # noqa: E501 + + def tearDown(self): + pass + + {{#each operation}} + def test_{{operationId}}(self): + """Test case for {{{operationId}}} + +{{#if summary}} + {{{summary}}} # noqa: E501 +{{/if}} + """ + pass + + {{/each}} +{{/with}} + +if __name__ == '__main__': + unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python-experimental/configuration.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/configuration.handlebars new file mode 100644 index 00000000000..c0a0dc7dcc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/configuration.handlebars @@ -0,0 +1,636 @@ +# coding: utf-8 + +{{>partial_header}} + +import copy +import logging +{{#unless asyncio}} +import multiprocessing +{{/unless}} +import sys +import urllib3 + +from http import client as http_client +from {{packageName}}.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems', + 'uniqueItems', 'maxProperties', 'minProperties', +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. +{{#if hasHttpSignatureMethods}} + :param signing_info: Configuration parameters for the HTTP signature security scheme. + Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration +{{/if}} + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + +{{#if hasAuthMethods}} + :Example: +{{#if hasApiKeyMethods}} + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = {{{packageName}}}.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 +{{/if}} +{{#if hasHttpBasicMethods}} + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', +) + +{{/if}} +{{#if hasHttpSignatureMethods}} + + HTTP Signature Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: signature + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the {{{packageName}}}.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + +conf = {{{packageName}}}.Configuration( + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, + signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) +{{/if}} +{{/if}} + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", +{{#if hasHttpSignatureMethods}} + signing_info=None, +{{/if}} + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ): + """Constructor + """ + self._base_path = "{{{basePath}}}" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations +{{#if hasHttpSignatureMethods}} + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ +{{/if}} +{{#if hasOAuthMethods}} + self.access_token = None + """access token for OAuth/Bearer + """ +{{/if}} +{{#unless hasOAuthMethods}} +{{#if hasBearerMethods}} + self.access_token = None + """access token for OAuth/Bearer + """ +{{/if}} +{{/unless}} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("{{packageName}}") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + {{#if asyncio}} + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + {{/if}} + {{#unless asyncio}} + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + {{/unless}} + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s +{{#if hasHttpSignatureMethods}} + if name == "signing_info" and value is not None: + # Ensure the host paramater from signing info is the same as + # Configuration.host. + value.host = self.host +{{/if}} + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} +{{#each authMethods}} +{{#if isApiKey}} + if '{{name}}' in self.api_key{{#each vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/each}}: + auth['{{name}}'] = { + 'type': 'api_key', + 'in': {{#if isKeyInCookie}}'cookie'{{/if}}{{#if isKeyInHeader}}'header'{{/if}}{{#if isKeyInQuery}}'query'{{/if}}, + 'key': '{{keyParamName}}', + 'value': self.get_api_key_with_prefix( + '{{name}}',{{#each vendorExtensions.x-auth-id-alias}} + alias='{{.}}',{{/each}} + ), + } +{{/if}} +{{#if isBasic}} + {{#if isBasicBasic}} + if self.username is not None and self.password is not None: + auth['{{name}}'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + {{/if}} + {{#if isBasicBearer}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'bearer', + 'in': 'header', + {{#if bearerFormat}} + 'format': '{{{bearerFormat}}}', + {{/if}} + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + {{/if}} + {{#if isHttpSignature}} + if self.signing_info is not None: + auth['{{name}}'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } + {{/if}} +{{/if}} +{{#if isOAuth}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } +{{/if}} +{{/each}} + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: {{version}}\n"\ + "SDK Package Version: {{packageVersion}}".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + {{#each servers}} + { + 'url': "{{{url}}}", + 'description': "{{{description}}}{{#unless description}}No description provided{{/unless}}", + {{#each variables}} + {{#if @first}} + 'variables': { + {{/if}} + '{{{name}}}': { + 'description': "{{{description}}}{{#unless description}}No description provided{{/unless}}", + 'default_value': "{{{defaultValue}}}", + {{#each enumValues}} + {{#if @first}} + 'enum_values': [ + {{/if}} + "{{{.}}}"{{#unless @last}},{{/unless}} + {{#if @last}} + ] + {{/if}} + {{/each}} + }{{#unless @last}},{{/unless}} + {{#if @last}} + } + {{/if}} + {{/each}} + }{{#unless @last}},{{/unless}} + {{/each}} + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/modules/openapi-generator/src/main/resources/python-experimental/doc_auth_partial.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/doc_auth_partial.handlebars new file mode 100644 index 00000000000..b16451d867e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/doc_auth_partial.handlebars @@ -0,0 +1,109 @@ +# Defining the host is optional and defaults to {{{basePath}}} +# See configuration.py for a list of all supported configuration parameters. +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}" +) + +{{#if hasAuthMethods}} +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. +{{#each authMethods}} +{{#if isBasic}} +{{#if isBasicBasic}} + +# Configure HTTP basic authorization: {{{name}}} +configuration = {{{packageName}}}.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) +{{/if}} +{{#if isBasicBearer}} + +# Configure Bearer authorization{{#if bearerFormat}} ({{{bearerFormat}}}){{/if}}: {{{name}}} +configuration = {{{packageName}}}.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) +{{/if}} +{{#if isHttpSignature}} + +# Configure HTTP message signature: {{{name}}} +# The HTTP Signature Header mechanism that can be used by a client to +# authenticate the sender of a message and ensure that particular headers +# have not been modified in transit. +# +# You can specify the signing key-id, private key path, signing scheme, +# signing algorithm, list of signed headers and signature max validity. +# The 'key_id' parameter is an opaque string that the API server can use +# to lookup the client and validate the signature. +# The 'private_key_path' parameter should be the path to a file that +# contains a DER or base-64 encoded private key. +# The 'private_key_passphrase' parameter is optional. Set the passphrase +# if the private key is encrypted. +# The 'signed_headers' parameter is used to specify the list of +# HTTP headers included when generating the signature for the message. +# You can specify HTTP headers that you want to protect with a cryptographic +# signature. Note that proxies may add, modify or remove HTTP headers +# for legitimate reasons, so you should only add headers that you know +# will not be modified. For example, if you want to protect the HTTP request +# body, you can specify the Digest header. In that case, the client calculates +# the digest of the HTTP request body and includes the digest in the message +# signature. +# The 'signature_max_validity' parameter is optional. It is configured as a +# duration to express when the signature ceases to be valid. The client calculates +# the expiration date every time it generates the cryptographic signature +# of an HTTP request. The API server may have its own security policy +# that controls the maximum validity of the signature. The client max validity +# must be lower than the server max validity. +# The time on the client and server must be synchronized, otherwise the +# server may reject the client signature. +# +# The client must use a combination of private key, signing scheme, +# signing algorithm and hash algorithm that matches the security policy of +# the API server. +# +# See {{{packageName}}}.signing for a list of all supported parameters. +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}", + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'private_key.pem', + private_key_passphrase = 'YOUR_PASSPHRASE', + signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, + hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256, + signed_headers = [ + {{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) +{{/if}} +{{/if}} +{{#if isApiKey}} + +# Configure API key authorization: {{{name}}} +configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['{{name}}'] = 'Bearer' +{{/if}} +{{#if isOAuth}} + +# Configure OAuth2 access token for authorization: {{{name}}} +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}" +) +configuration.access_token = 'YOUR_ACCESS_TOKEN' +{{/if}} +{{/each}} +{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars new file mode 100644 index 00000000000..f6de978e478 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint.handlebars @@ -0,0 +1,549 @@ +# coding: utf-8 + +{{>partial_header}} + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +{{#with operation}} +{{#or headerParams bodyParam produces}} +from urllib3._collections import HTTPHeaderDict +{{/or}} +{{/with}} + +from {{packageName}} import api_client, exceptions +{{> model_templates/imports_schema_types }} +{{> model_templates/imports_schemas }} + +{{#with operation}} +{{#if queryParams}} +# query params +{{#each queryParams}} +{{#with schema}} +{{> model_templates/schema }} +{{/with}} +{{/each}} +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { +{{#each queryParams}} +{{#if required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/if}} +{{/each}} + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { +{{#each queryParams}} +{{#unless required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/unless}} +{{/each}} + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +{{#each queryParams}} +{{> endpoint_parameter }} +{{/each}} +{{/if}} +{{#if headerParams}} +# header params +{{#each headerParams}} +{{#with schema}} +{{> model_templates/schema }} +{{/with}} +{{/each}} +RequestRequiredHeaderParams = typing.TypedDict( + 'RequestRequiredHeaderParams', + { +{{#each headerParams}} +{{#if required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/if}} +{{/each}} + } +) +RequestOptionalHeaderParams = typing.TypedDict( + 'RequestOptionalHeaderParams', + { +{{#each headerParams}} +{{#unless required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/unless}} +{{/each}} + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +{{#each headerParams}} +{{> endpoint_parameter }} +{{/each}} +{{/if}} +{{#if pathParams}} +# path params +{{#each pathParams}} +{{#with schema}} +{{> model_templates/schema }} +{{/with}} +{{/each}} +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { +{{#each pathParams}} +{{#if required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/if}} +{{/each}} + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { +{{#each pathParams}} +{{#unless required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/unless}} +{{/each}} + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +{{#each pathParams}} +{{> endpoint_parameter }} +{{/each}} +{{/if}} +{{#if cookieParams}} +# cookie params +{{#each cookieParams}} +{{#with schema}} +{{> model_templates/schema }} +{{/with}} +{{/each}} +RequestRequiredCookieParams = typing.TypedDict( + 'RequestRequiredCookieParams', + { +{{#each cookieParams}} +{{#if required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/if}} +{{/each}} + } +) +RequestOptionalCookieParams = typing.TypedDict( + 'RequestOptionalCookieParams', + { +{{#each cookieParams}} +{{#unless required}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/unless}} +{{/each}} + }, + total=False +) + + +class RequestCookieParams(RequestRequiredCookieParams, RequestOptionalCookieParams): + pass + + +{{#each cookieParams}} +{{> endpoint_parameter }} +{{/each}} +{{/if}} +{{#with bodyParam}} +# body param +{{#each content}} +{{#with this.schema}} +{{> model_templates/schema }} +{{/with}} +{{/each}} + + +request_body_{{paramName}} = api_client.RequestBody( + content={ +{{#each content}} + '{{@key}}': api_client.MediaType( + schema={{this.schema.baseName}}), +{{/each}} + }, +{{#if required}} + required=True, +{{/if}} +) +{{/with}} +_path = '{{{path}}}' +_method = '{{httpMethod}}' +{{#each authMethods}} +{{#if @first}} +_auth = [ +{{/if}} + '{{name}}', +{{#if @last}} +] +{{/if}} +{{/each}} +{{#each servers}} +{{#if @first}} +_servers = ( +{{/if}} + { + 'url': "{{{url}}}", + 'description': "{{{description}}}{{#unless description}}No description provided{{/unless}}", + {{#each variables}} + {{#if @first}} + 'variables': { + {{/if}} + '{{{name}}}': { + 'description': "{{{description}}}{{#unless description}}No description provided{{/unless}}", + 'default_value': "{{{defaultValue}}}", + {{#each enumValues}} + {{#if @first}} + 'enum_values': [ + {{/if}} + "{{{.}}}"{{#unless @last}},{{/unless}} + {{#if @last}} + ] + {{/if}} + {{/each}} + }{{#unless @last}},{{/unless}} + {{#if @last}} + } + {{/if}} + {{/each}} + }, +{{#if @last}} +) +{{/if}} +{{/each}} +{{#each responses}} +{{#each responseHeaders}} +{{#with schema}} +{{> model_templates/schema }} +{{/with}} +{{paramName}}_parameter = api_client.HeaderParameter( + name="{{baseName}}", +{{#if style}} + style=api_client.ParameterStyle.{{style}}, +{{/if}} +{{#if schema}} +{{#with schema}} + schema={{baseName}}, +{{/with}} +{{/if}} +{{#if required}} + required=True, +{{/if}} +{{#if isExplode}} + explode=True, +{{/if}} +) +{{/each}} +{{#each content}} +{{#with this.schema}} +{{> model_templates/schema }} +{{/with}} +{{/each}} +{{#if responseHeaders}} +ResponseHeadersFor{{code}} = typing.TypedDict( + 'ResponseHeadersFor{{code}}', + { +{{#each responseHeaders}} + '{{baseName}}': {{#with schema}}{{baseName}},{{/with}} +{{/each}} + } +) +{{/if}} + + +@dataclass +{{#if isDefault}} +class ApiResponseForDefault(api_client.ApiResponse): +{{else}} +class ApiResponseFor{{code}}(api_client.ApiResponse): +{{/if}} + response: urllib3.HTTPResponse +{{#and responseHeaders content}} + body: typing.Union[ +{{#each content}} + {{this.schema.baseName}}, +{{/each}} + ] + headers: ResponseHeadersFor{{code}} +{{else}} +{{#or responseHeaders content}} +{{#if responseHeaders}} + headers: ResponseHeadersFor{{code}} + body: Unset = unset +{{else}} + body: typing.Union[ +{{#each content}} + {{this.schema.baseName}}, +{{/each}} + ] + headers: Unset = unset +{{/if}} +{{/or}} +{{/and}} +{{#unless responseHeaders}} +{{#unless content}} + body: Unset = unset + headers: Unset = unset +{{/unless}} +{{/unless}} + + +{{#if isDefault}} +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, +{{else}} +_response_for_{{code}} = api_client.OpenApiResponse( + response_cls=ApiResponseFor{{code}}, +{{/if}} +{{#each content}} +{{#if @first}} + content={ +{{/if}} + '{{@key}}': api_client.MediaType( + schema={{this.schema.baseName}}), +{{#if @last}} + }, +{{/if}} +{{/each}} +{{#if responseHeaders}} + headers=[ +{{#each responseHeaders}} + {{paramName}}_parameter, +{{/each}} + ] +{{/if}} +) +{{/each}} +_status_code_to_response = { +{{#each responses}} +{{#if isDefault}} + 'default': _response_for_default, +{{else}} + '{{code}}': _response_for_{{code}}, +{{/if}} +{{/each}} +} +{{#each produces}} +{{#if @first}} +_all_accept_content_types = ( +{{/if}} + '{{this.mediaType}}', +{{#if @last}} +) +{{/if}} +{{/each}} + + +class {{operationIdCamelCase}}(api_client.Api): + + def {{operationId}}( + self: api_client.Api, + {{#if bodyParam}} + {{#with bodyParam}} + {{baseName}}: typing.Union[{{#each content}}{{#unless @first}}, {{/unless}}{{this.schema.baseName}}{{/each}}{{#unless required}}, Unset] = unset{{else}}]{{/unless}}, + {{/with}} + {{/if}} + {{#if queryParams}} + query_params: RequestQueryParams = frozendict(), + {{/if}} + {{#if headerParams}} + header_params: RequestHeaderParams = frozendict(), + {{/if}} + {{#if pathParams}} + path_params: RequestPathParams = frozendict(), + {{/if}} + {{#if cookieParams}} + cookie_params: RequestCookieParams = frozendict(), + {{/if}} + {{#with bodyParam}} + {{#each content}} + {{#if @first}} + content_type: str = '{{@key}}', + {{/if}} + {{/each}} + {{/with}} + {{#if produces}} + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + {{/if}} + {{#if servers}} + host_index: typing.Optional[int] = None, + {{/if}} + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + {{#each responses}} + {{#if isDefault}} + ApiResponseForDefault, + {{else}} + {{#if is2xx}} + ApiResponseFor{{code}}, + {{/if}} + {{/if}} + {{/each}} + api_client.ApiResponseWithoutDeserialization + ]: + """ + {{#if summary}} + {{summary}} + {{/if}} + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + {{#if queryParams}} + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + {{/if}} + {{#if headerParams}} + self._verify_typed_dict_inputs(RequestHeaderParams, header_params) + {{/if}} + {{#if pathParams}} + self._verify_typed_dict_inputs(RequestPathParams, path_params) + {{/if}} + {{#if cookieParams}} + self._verify_typed_dict_inputs(RequestCookieParams, cookie_params) + {{/if}} + {{#if pathParams}} + + _path_params = {} + for parameter in ( + {{#each pathParams}} + request_path_{{paramName}}, + {{/each}} + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + {{/if}} + {{#if queryParams}} + + _query_params = [] + for parameter in ( + {{#each queryParams}} + request_query_{{paramName}}, + {{/each}} + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + {{/if}} + {{#or headerParams bodyParam produces}} + + _headers = HTTPHeaderDict() + {{else}} + {{/or}} + {{#if headerParams}} + for parameter in ( + {{#each headerParams}} + request_header_{{paramName}}, + {{/each}} + ): + parameter_data = header_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + {{/if}} + # TODO add cookie handling + {{#if produces}} + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + {{/if}} + {{#with bodyParam}} + + {{#if required}} + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + {{/if}} + _fields = None + _body = None + {{#if required}} + {{> endpoint_body_serialization }} + {{else}} + if body is not unset: + {{> endpoint_body_serialization }} + {{/if}} + {{/with}} + {{#if servers}} + + host = self.get_host('{{operationId}}', _servers, host_index) + {{/if}} + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + {{#if pathParams}} + path_params=_path_params, + {{/if}} + {{#if queryParams}} + query_params=tuple(_query_params), + {{/if}} + {{#or headerParams bodyParam produces}} + headers=_headers, + {{/or}} + {{#if bodyParam}} + fields=_fields, + body=_body, + {{/if}} + {{#if hasAuthMethods}} + auth_settings=_auth, + {{/if}} + {{#if servers}} + host=host, + {{/if}} + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + {{#if hasDefaultResponse}} + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + {{else}} + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + {{/if}} + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response +{{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_body_serialization.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_body_serialization.handlebars new file mode 100644 index 00000000000..f00d9f05d27 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_body_serialization.handlebars @@ -0,0 +1,6 @@ +serialized_data = request_body_{{paramName}}.serialize(body, content_type) +_headers.add('Content-Type', content_type) +if 'fields' in serialized_data: + _fields = serialized_data['fields'] +elif 'body' in serialized_data: + _body = serialized_data['body'] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/endpoint_parameter.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_parameter.handlebars new file mode 100644 index 00000000000..4b9d815af83 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/endpoint_parameter.handlebars @@ -0,0 +1,17 @@ +request_{{#if isQueryParam}}query{{/if}}{{#if isPathParam}}path{{/if}}{{#if isHeaderParam}}header{{/if}}{{#if isCookieParam}}cookie{{/if}}_{{paramName}} = api_client.{{#if isQueryParam}}Query{{/if}}{{#if isPathParam}}Path{{/if}}{{#if isHeaderParam}}Header{{/if}}{{#if isCookieParam}}Cookie{{/if}}Parameter( + name="{{baseName}}", +{{#if style}} + style=api_client.ParameterStyle.{{style}}, +{{/if}} +{{#if schema}} +{{#with schema}} + schema={{baseName}}, +{{/with}} +{{/if}} +{{#if required}} + required=True, +{{/if}} +{{#if isExplode}} + explode=True, +{{/if}} +) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/exceptions.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/exceptions.handlebars new file mode 100644 index 00000000000..fa5f7534789 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/exceptions.handlebars @@ -0,0 +1,129 @@ +# coding: utf-8 + +{{>partial_header}} + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, api_response: '{{packageName}}.api_client.ApiResponse' = None): + if api_response: + self.status = api_response.response.status + self.reason = api_response.response.reason + self.body = api_response.response.data + self.headers = api_response.response.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/modules/openapi-generator/src/main/resources/python-experimental/git_push.sh.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/git_push.sh.handlebars new file mode 100644 index 00000000000..8b3f689c912 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/git_push.sh.handlebars @@ -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="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + 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/modules/openapi-generator/src/main/resources/python-experimental/gitignore.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/gitignore.handlebars new file mode 100644 index 00000000000..a62e8aba43f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/gitignore.handlebars @@ -0,0 +1,67 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt +dev-requirements.txt.log + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/modules/openapi-generator/src/main/resources/python-experimental/gitlab-ci.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/gitlab-ci.handlebars new file mode 100644 index 00000000000..0cfe8f74ecf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/gitlab-ci.handlebars @@ -0,0 +1,29 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.tests: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + {{#if useNose}} + - nosetests + {{/if}} + {{#unless useNose}} + - pytest --cov={{{packageName}}} + {{/unless}} + +test-3.5: + extends: .tests + image: python:3.5-alpine +test-3.6: + extends: .tests + image: python:3.6-alpine +test-3.7: + extends: .tests + image: python:3.7-alpine +test-3.8: + extends: .tests + image: python:3.8-alpine diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars new file mode 100644 index 00000000000..d8c1e63ae4d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model.handlebars @@ -0,0 +1,17 @@ +# coding: utf-8 + +{{>partial_header}} + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +{{#each models}} +{{#with model}} +{{> model_templates/imports_schema_types }} +{{> model_templates/schema }} +{{> model_templates/imports_schemas }} +{{/with}} +{{/each}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_doc.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_doc.handlebars new file mode 100644 index 00000000000..2c4136a142a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_doc.handlebars @@ -0,0 +1,9 @@ +{{#each models}} +{{#with model}} +# {{classname}} +{{> schema_doc }} +{{/with}} +{{/each}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/composed_schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/composed_schemas.handlebars new file mode 100644 index 00000000000..6aef3311b6e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/composed_schemas.handlebars @@ -0,0 +1,86 @@ +@classmethod +@property +def _composed_schemas(cls): + # 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 because 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 +{{#with composedSchemas}} +{{#each allOf}} +{{#unless complexType}} +{{#unless isAnyType}} + {{> model_templates/schema }} +{{/unless}} +{{/unless}} +{{#if isAnyType}} + {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = AnyTypeSchema +{{/if}} +{{/each}} +{{#each oneOf}} +{{#unless complexType}} +{{#unless isAnyType}} + {{> model_templates/schema }} +{{/unless}} +{{/unless}} +{{#if isAnyType}} + {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = AnyTypeSchema +{{/if}} +{{/each}} +{{#each anyOf}} +{{#unless complexType}} +{{#unless isAnyType}} + {{> model_templates/schema }} +{{/unless}} +{{/unless}} +{{#if isAnyType}} + {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = AnyTypeSchema +{{/if}} +{{/each}} +{{/with}} + return { + 'allOf': [ +{{#with composedSchemas}} +{{#each allOf}} +{{#if complexType}} + {{complexType}}, +{{/if}} +{{#unless complexType}} + {{#if nameInSnakeCase}}{{name}}{{/if}}{{#unless nameInSnakeCase}}{{baseName}}{{/unless}}, +{{/unless}} +{{/each}} + ], + 'oneOf': [ +{{#each oneOf}} +{{#if complexType}} + {{complexType}}, +{{/if}} +{{#unless complexType}} +{{#if isAnyType}} + AnyTypeSchema, +{{/if}} +{{#unless isAnyType}} + {{#if nameInSnakeCase}}{{name}}{{/if}}{{#unless nameInSnakeCase}}{{baseName}}{{/unless}}, +{{/unless}} +{{/unless}} +{{/each}} + ], + 'anyOf': [ +{{#each anyOf}} +{{#if complexType}} + {{complexType}}, +{{/if}} +{{#unless complexType}} +{{#if isAnyType}} + AnyTypeSchema, +{{/if}} +{{#unless isAnyType}} + {{#if nameInSnakeCase}}{{name}}{{/if}}{{#unless nameInSnakeCase}}{{baseName}}{{/unless}}, +{{/unless}} +{{/unless}} +{{/each}} +{{/with}} + ], + } diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars new file mode 100644 index 00000000000..15338b38f1d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/dict_partial.handlebars @@ -0,0 +1,54 @@ +{{#if getHasRequired}} + _required_property_names = set(( + {{#each requiredVars}} + '{{baseName}}', + {{/each}} + )) +{{/if}} +{{#each vars}} +{{#if complexType}} + + @classmethod + @property + def {{baseName}}(cls) -> typing.Type['{{complexType}}']: + return {{complexType}} +{{else}} + {{> model_templates/schema }} +{{/if}} +{{/each}} +{{#if getHasDiscriminatorWithNonEmptyMapping}} +{{#with discriminator}} +{{#each mappedModels}} +{{#if @first}} + + @classmethod + @property + def _discriminator(cls): + return { + '{{{propertyBaseName}}}': { +{{/if}} + '{{mappingName}}': {{{modelName}}}, +{{#if @last}} + } + } +{{/if}} +{{/each}} +{{/with}} +{{/if}} +{{#with additionalProperties}} +{{#if complexType}} + + @classmethod + @property + def _additional_properties(cls) -> typing.Type['{{complexType}}']: + return {{complexType}} +{{/if}} +{{#unless complexType}} +{{#unless isAnyType}} + {{> model_templates/schema }} +{{/unless}} +{{/unless}} +{{/with}} +{{#unless additionalProperties}} + _additional_properties = None +{{/unless}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enum_value_to_name.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enum_value_to_name.handlebars new file mode 100644 index 00000000000..ea2cb759fbe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enum_value_to_name.handlebars @@ -0,0 +1,12 @@ +_SchemaEnumMaker( + enum_value_to_name={ +{{#if isNull}} + None: "NONE", +{{/if}} +{{#with allowableValues}} +{{#each enumVars}} + {{{value}}}: "{{name}}", +{{/each}} +{{/with}} + } +), diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enums.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enums.handlebars new file mode 100644 index 00000000000..5cbc68dc173 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/enums.handlebars @@ -0,0 +1,16 @@ +{{#if isNull}} + +@classmethod +@property +def NONE(cls): + return cls._enum_by_value[None](None) +{{/if}} +{{#with allowableValues}} +{{#each enumVars}} + +@classmethod +@property +def {{name}}(cls): + return cls._enum_by_value[{{{value}}}]({{{value}}}) +{{/each}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars new file mode 100644 index 00000000000..0741ba482fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars @@ -0,0 +1,41 @@ +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from {{packageName}}.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schemas.handlebars new file mode 100644 index 00000000000..b925cf92c69 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schemas.handlebars @@ -0,0 +1,6 @@ +{{#each imports}} +{{#if @first}} + +{{/if}} +{{{.}}} +{{/each}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars new file mode 100644 index 00000000000..bb220e4b8f3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars @@ -0,0 +1,53 @@ +def __new__( + cls, + *args: typing.Union[{{#if isAnyType}}dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes{{/if}}{{#if isUnboundedInteger}}int, {{/if}}{{#if isNumber}}float, {{/if}}{{#if isBoolean}}bool, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict, {{/if}}{{#if isString}}str, {{/if}}{{#if isNull}}None, {{/if}}], +{{#unless isNull}} +{{#if getHasRequired}} +{{#each requiredVars}} +{{#unless nameInSnakeCase}} + {{baseName}}: {{baseName}}, +{{/unless}} +{{/each}} +{{/if}} +{{/unless}} +{{#each vars}} +{{#unless nameInSnakeCase}} +{{#unless getRequired}} +{{#unless complexType}} + {{baseName}}: typing.Union[{{baseName}}, Unset] = unset, +{{/unless}} +{{#if complexType}} + {{baseName}}: typing.Union['{{complexType}}', Unset] = unset, +{{/if}} +{{/unless}} +{{/unless}} +{{/each}} + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, +{{#with additionalProperties}} + **kwargs: typing.Type[Schema], +{{/with}} +): + return super().__new__( + cls, + *args, +{{#unless isNull}} +{{#if getHasRequired}} +{{#each requiredVars}} +{{#unless nameInSnakeCase}} + {{baseName}}={{baseName}}, +{{/unless}} +{{/each}} +{{/if}} +{{/unless}} +{{#each vars}} +{{#unless getRequired}} +{{#unless nameInSnakeCase}} + {{baseName}}={{baseName}}, +{{/unless}} +{{/unless}} +{{/each}} + _instantiation_metadata=_instantiation_metadata, +{{#with additionalProperties}} + **kwargs, +{{/with}} + ) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars new file mode 100644 index 00000000000..7523d39f0ea --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema.handlebars @@ -0,0 +1,46 @@ +{{#if composedSchemas}} +{{> model_templates/schema_composed_or_anytype }} +{{/if}} +{{#unless composedSchemas}} + {{#if getHasMultipleTypes}} +{{> model_templates/schema_composed_or_anytype }} + {{else}} + {{#or isMap isArray isAnyType}} + {{#if isMap}} + {{#or hasVars hasValidation hasRequiredVars getHasDiscriminatorWithNonEmptyMapping}} +{{> model_templates/schema_dict }} + {{else}} + {{#if additionalPropertiesIsAnyType}} +{{> model_templates/var_equals_cls }} + {{else}} +{{> model_templates/schema_dict }} + {{/if}} + {{/or}} + {{/if}} + {{#if isArray}} + {{#or hasItems hasValidation}} +{{> model_templates/schema_list }} + {{else}} +{{> model_templates/var_equals_cls }} + {{/or}} + {{/if}} + {{#if isAnyType}} + {{#or isEnum hasVars hasValidation hasRequiredVars getHasDiscriminatorWithNonEmptyMapping items}} +{{> model_templates/schema_composed_or_anytype }} + {{else}} +{{> model_templates/var_equals_cls }} + {{/or}} + {{/if}} + {{else}} + {{#or isEnum hasValidation}} +{{> model_templates/schema_simple }} + {{else}} +{{> model_templates/var_equals_cls }} + {{/or}} + {{/or}} + {{#if nameInSnakeCase}} +locals()['{{baseName}}'] = {{name}} +del locals()['{{name}}'] + {{/if}} + {{/if}} +{{/unless}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars new file mode 100644 index 00000000000..18527e02eff --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars @@ -0,0 +1,67 @@ + + +class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( +{{#if hasValidation}} + {{> model_templates/validations }} +{{/if}} +{{#if getIsAnyType}} + {{#if composedSchemas}} + ComposedSchema + {{else}} + AnyTypeSchema + {{/if}} +{{else}} + {{#if getHasMultipleTypes}} + _SchemaTypeChecker(typing.Union[{{#if isArray}}tuple, {{/if}}{{#if isMap}}frozendict, {{/if}}{{#if isNull}}none_type, {{/if}}{{#if isString}}str, {{/if}}{{#if isByteArray}}str, {{/if}}{{#if isUnboundedInteger}}Decimal, {{/if}}{{#if isShort}}Decimal, {{/if}}{{#if isLong}}Decimal, {{/if}}{{#if isFloat}}Decimal, {{/if}}{{#if isDouble}}Decimal, {{/if}}{{#if isNumber}}Decimal, {{/if}}{{#if isDate}}str, {{/if}}{{#if isDateTime}}str, {{/if}}{{#if isBoolean}}bool, {{/if}}]), + {{/if}} + {{#if composedSchemas}} + ComposedBase, + {{/if}} + {{#if isEnum}} + {{> model_templates/enum_value_to_name }} + {{/if}} + {{> model_templates/xbase_schema }} +{{/if}} +): +{{#if this.classname}} + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + + Attributes: +{{#each vars}} + {{baseName}} ({{#if isArray}}tuple,{{/if}}{{#if isBoolean}}bool,{{/if}}{{#if isDate}}date,{{/if}}{{#if isDateTime}}datetime,{{/if}}{{#if isMap}}dict,{{/if}}{{#if isFloat}}float,{{/if}}{{#if isNumber}}float,{{/if}}{{#if isUnboundedInteger}}int,{{/if}}{{#if isShort}}int,{{/if}}{{#if isLong}}int,{{/if}}{{#if isString}}str,{{/if}}{{#if isByteArray}}str,{{/if}}{{#if isNull}} none_type,{{/if}}): {{#if description}}{{description}}{{/if}} +{{/each}} +{{#if hasValidation}} + _validations (dict): the validations which apply to the current Schema + 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. +{{/if}} +{{#with additionalProperties}} + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties +{{/with}} +{{#if getHasDiscriminatorWithNonEmptyMapping}} + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class +{{/if}} + """ +{{/if}} +{{#or isMap isAnyType}} +{{> model_templates/dict_partial }} +{{/or}} +{{#if composedSchemas}} + + {{> model_templates/composed_schemas }} +{{/if}} +{{#if isEnum}} + {{> model_templates/enums }} +{{/if}} + + {{> model_templates/new }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars new file mode 100644 index 00000000000..f811b092e50 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars @@ -0,0 +1,42 @@ + + +class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( +{{#if hasValidation}} + {{> model_templates/validations }} +{{/if}} + DictSchema +): +{{#if this.classname}} + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + + Attributes: +{{#each vars}} + {{baseName}} ({{#if isArray}}tuple,{{/if}}{{#if isBoolean}}bool,{{/if}}{{#if isDate}}date,{{/if}}{{#if isDateTime}}datetime,{{/if}}{{#if isMap}}dict,{{/if}}{{#if isFloat}}float,{{/if}}{{#if isDouble}}float,{{/if}}{{#if isNumber}}int, float,{{/if}}{{#if isUnboundedInteger}}int,{{/if}}{{#if isShort}}int,{{/if}}{{#if isLong}}int,{{/if}}{{#if isString}}str,{{/if}}{{#if isByteArray}}str,{{/if}}{{#if isNull}} none_type,{{/if}}): {{#if description}}{{description}}{{/if}} +{{/each}} +{{#if hasValidation}} + _validations (dict): the validations which apply to the current Schema + 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. +{{/if}} +{{#with additionalProperties}} + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties +{{/with}} +{{#if getHasDiscriminatorWithNonEmptyMapping}} + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class +{{/if}} + """ +{{/if}} +{{> model_templates/dict_partial }} + + + {{> model_templates/new }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars new file mode 100644 index 00000000000..8617eeb0559 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars @@ -0,0 +1,39 @@ + + +class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( +{{#if hasValidation}} + {{> model_templates/validations }} +{{/if}} + ListSchema +): +{{#if this.classname}} + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + + Attributes: + _items (Schema): the schema definition of the array items +{{#if hasValidation}} + _validations (dict): the validations which apply to the current Schema + 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. +{{/if}} + """ +{{/if}} +{{#with items}} +{{#if complexType}} + + @classmethod + @property + def _items(cls) -> typing.Type['{{complexType}}']: + return {{complexType}} +{{else}} + {{> model_templates/schema }} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars new file mode 100644 index 00000000000..06ba2af1917 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars @@ -0,0 +1,35 @@ + + +class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}( +{{#if hasValidation}} + {{> model_templates/validations }} +{{/if}} +{{#if isEnum}} + {{> model_templates/enum_value_to_name }} +{{/if}} + {{> model_templates/xbase_schema }} +): +{{#if this.classname}} + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. +{{#if description}} + + {{{unescapedDescription}}} +{{/if}} + + Attributes: +{{#if hasValidation}} + _validations (dict): the validations which apply to the current Schema + 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. +{{/if}} + """ +{{/if}} +{{#if isEnum}} + {{> model_templates/enums }} +{{else}} + pass +{{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/validations.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/validations.handlebars new file mode 100644 index 00000000000..2384ac063d2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/validations.handlebars @@ -0,0 +1,50 @@ +_SchemaValidator( +{{#if getUniqueItems}} + unique_items=True, +{{/if}} +{{#if maxLength}} + max_length={{maxLength}}, +{{/if}} +{{#if minLength}} + min_length={{minLength}}, +{{/if}} +{{#if maxItems}} + max_items={{maxItems}}, +{{/if}} +{{#if minItems}} + min_items={{minItems}}, +{{/if}} +{{#if maxProperties}} + max_properties={{maxProperties}}, +{{/if}} +{{#if minProperties}} + min_properties={{minProperties}}, +{{/if}} +{{#if maximum}} + {{#if exclusiveMaximum}}exclusive_maximum{{/if}}inclusive_maximum{{#unless exclusiveMaximum}}{{/unless}}={{maximum}}, +{{/if}} +{{#if minimum}} + {{#if exclusiveMinimum}}exclusive_minimum{{/if}}inclusive_minimum{{#unless exclusiveMinimum}}{{/unless}}={{minimum}}, +{{/if}} +{{#if pattern}} + regex=[{ +{{#if vendorExtensions.x-regex}} + 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501 +{{else}} + 'pattern': r'{{{pattern}}}', # noqa: E501 +{{/if}} +{{#each vendorExtensions.x-modifiers}} +{{#if @first}} + 'flags': ( +{{/if}} + {{#unless @first}}| {{/unless}}re.{{.}} +{{#if @last}} + ) +{{/if}} +{{/each}} + }], +{{/if}} +{{#if multipleOf}} + multiple_of=[{{multipleOf}}], +{{/if}} +), diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars new file mode 100644 index 00000000000..14b4c5e0648 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars @@ -0,0 +1 @@ +{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = {{#if complexType}}{{complexType}}{{else}}{{#if isNullable}}Nullable{{/if}}{{#if getIsNull}}None{{/if}}{{#if isAnyType}}AnyType{{/if}}{{#if isMap}}Dict{{/if}}{{#if isArray}}List{{/if}}{{#if isString}}Str{{/if}}{{#if isByteArray}}Str{{/if}}{{#if isUnboundedInteger}}Int{{/if}}{{#if isShort}}Int32{{/if}}{{#if isLong}}Int64{{/if}}{{#if isFloat}}Float32{{/if}}{{#if isDouble}}Float64{{/if}}{{#if isNumber}}Number{{/if}}{{#if isDate}}Date{{/if}}{{#if isDateTime}}DateTime{{/if}}{{#if isBoolean}}Bool{{/if}}{{#if isBinary}}Binary{{/if}}Schema{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars new file mode 100644 index 00000000000..0b345344c43 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars @@ -0,0 +1,48 @@ +{{#if isArray}} +List{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isMap}} +Dict{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isString}} +Str{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isByteArray}} +Str{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isUnboundedInteger}} +Int{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isNumber}} +Number{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#isShort}} +Int32{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/isShort}} +{{#isLong}} +Int64{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/isLong}} +{{#isFloat}} +Float32{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/isFloat}} +{{#isDouble}} +Float64{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/isDouble}} +{{#if isDate}} +Date{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isDateTime}} +DateTime{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isBoolean}} +Bool{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isBinary}} +Binary{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if isNull}} +None{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} +{{#if getHasMultipleTypes}} +Schema +{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars new file mode 100644 index 00000000000..094d7f49b65 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars @@ -0,0 +1,33 @@ +# coding: utf-8 + +{{>partial_header}} + +import sys +import unittest + +import {{packageName}} +{{#each models}} +{{#with model}} +from {{modelPackage}}.{{classFilename}} import {{classname}} + + +class Test{{classname}}(unittest.TestCase): + """{{classname}} unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_{{classname}}(self): + """Test {{classname}}""" + # FIXME: construct object with mandatory attributes with example values + # model = {{classname}}() # noqa: E501 + pass + +{{/with}} +{{/each}} + +if __name__ == '__main__': + unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python-experimental/partial_header.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/partial_header.handlebars new file mode 100644 index 00000000000..19b633be257 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/partial_header.handlebars @@ -0,0 +1,17 @@ +""" +{{#if appName}} + {{{appName}}} +{{/if}} + +{{#if appDescription}} + {{{appDescription}}} # noqa: E501 +{{/if}} + + {{#if version}} + The version of the OpenAPI document: {{{version}}} + {{/if}} + {{#if infoEmail}} + Contact: {{{infoEmail}}} + {{/if}} + Generated by: https://openapi-generator.tech +""" diff --git a/modules/openapi-generator/src/main/resources/python-experimental/requirements.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/requirements.handlebars new file mode 100644 index 00000000000..c9227e58a1b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/requirements.handlebars @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +frozendict >= 2.0.3 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/modules/openapi-generator/src/main/resources/python-experimental/rest.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/rest.handlebars new file mode 100644 index 00000000000..e30831938f1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/rest.handlebars @@ -0,0 +1,251 @@ +# coding: utf-8 + +{{>partial_header}} + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from {{packageName}}.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def GET(self, url, headers=None, query_params=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + query_params=query_params, fields=fields) + + def HEAD(self, url, headers=None, query_params=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + query_params=query_params, fields=fields) + + def OPTIONS(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def DELETE(self, url, headers=None, query_params=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def POST(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PUT(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PATCH(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars new file mode 100644 index 00000000000..556d2cbb5f9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/schema_doc.handlebars @@ -0,0 +1,32 @@ + +{{#if description}} +{{&description}} + +{{/if}} +{{#or vars additionalProperties}} +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + {{#each vars}} +**{{baseName}}** | {{#unless complexType}}**{{dataType}}**{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexType}}.md){{/if}} | {{description}} | {{#unless required}}[optional] {{/unless}}{{#if isReadOnly}}[readonly] {{/if}}{{#if defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/if}} + {{/each}} + {{#with additionalProperties}} +**any string name** | **{{dataType}}** | any string name can be used but the value must be the correct type | [optional] + {{/with}} +{{else}} +Type | Description | Notes +------------- | ------------- | ------------- + {{#if isAnyType}} +typing.Union[dict, frozendict, str, date, datetime, int, float, bool, Decimal, None, list, tuple, bytes] | | + {{else}} + {{#if hasMultipleTypes}} +typing.Union[{{#if isMap}}dict, frozendict, {{/if}}{{#if isString}}str, {{/if}}{{#if isDate}}date, {{/if}}{{#if isDataTime}}datetime, {{/if}}{{#or isLong isShort isUnboundedInteger}}int, {{/or}}{{#or isFloat isDouble}}float, {{/or}}{{#if isNumber}}Decimal, {{/if}}{{#if isBoolean}}bool, {{/if}}{{#if isNull}}None, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isBinary}}bytes{{/if}}] | | {{#with allowableValues}}{{#if defaultValue}}, {{/if}} must be one of [{{#each enumVars}}{{{value}}}, {{/each}}]{{/with}} + {{else}} + {{#if isArray}} +{{#unless arrayModelType}}**{{dataType}}**{{/unless}}{{#if arrayModelType}}[**{{dataType}}**]({{arrayModelType}}.md){{/if}} | {{description}} | {{#if defaultValue}}{{#if hasRequired}} if omitted the server will use the default value of {{/if}}{{#unless hasRequired}}defaults to {{/unless}}{{{defaultValue}}}{{/if}} + {{else}} +{{#unless arrayModelType}}**{{dataType}}**{{/unless}} | {{description}} | {{#if defaultValue}}{{#if hasRequired}} if omitted the server will use the default value of {{/if}}{{#unless hasRequired}}defaults to {{/unless}}{{{defaultValue}}}{{/if}}{{#with allowableValues}}{{#if defaultValue}}, {{/if}} must be one of [{{#each enumVars}}{{{value}}}, {{/each}}]{{/with}} + {{/if}} + {{/if}} + {{/if}} +{{/or}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars new file mode 100644 index 00000000000..b238468f73a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -0,0 +1,1987 @@ +# coding: utf-8 + +{{>partial_header}} + +from collections import defaultdict +from datetime import date, datetime, timedelta # noqa: F401 +from dataclasses import dataclass +import functools +from decimal import Decimal +import io +import os +import re +import tempfile +import typing + +from dateutil.parser.isoparser import isoparser, _takes_ascii +from frozendict import frozendict + +from {{packageName}}.exceptions import ( + ApiTypeError, + ApiValueError, +) +from {{packageName}}.configuration import ( + Configuration, +) + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type = type(None) +file_type = io.IOBase + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + arg.close() + inst = super(FileIO, cls).__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) + return inst + raise ApiValueError('FileIO must be passed arg which contains the open file') + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is defaultdict(set) + """ + for k, v in u.items(): + d[k] = d[k].union(v) + return d + + +class InstantiationMetadata: + """ + A class to store metadata that is needed when instantiating OpenApi Schema subclasses + """ + def __init__( + self, + path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), + from_server: bool = False, + configuration: typing.Optional[Configuration] = None, + base_classes: typing.FrozenSet[typing.Type] = frozenset(), + path_to_schemas: typing.Optional[typing.Dict[str, typing.Set[typing.Type]]] = None, + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + from_server: whether or not this data came form the server + True when receiving server data + False when instantiating model with client side data not form the server + configuration: the Configuration instance to use + This is needed because in Configuration: + - one can disable validation checking + base_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + path_to_schemas: a dict that goes from path to a list of classes at each path location + """ + self.path_to_item = path_to_item + self.from_server = from_server + self.configuration = configuration + self.base_classes = base_classes + if path_to_schemas is None: + path_to_schemas = defaultdict(set) + self.path_to_schemas = path_to_schemas + + def __repr__(self): + return str(self.__dict__) + + def __eq__(self, other): + if not isinstance(other, InstantiationMetadata): + return False + return self.__dict__ == other.__dict__ + + +class ValidatorBase: + @staticmethod + def __is_json_validation_enabled(schema_keyword, configuration=None): + """Returns true if JSON schema validation is enabled for the specified + validation keyword. This can be used to skip JSON schema structural validation + as requested in the configuration. + + Args: + schema_keyword (string): the name of a JSON schema validation keyword. + configuration (Configuration): the configuration class. + """ + + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) + + @staticmethod + def __raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + @classmethod + def __check_str_validations(cls, + validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if (cls.__is_json_validation_enabled('maxLength', _instantiation_metadata.configuration) and + 'max_length' in validations and + len(input_values) > validations['max_length']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="length must be less than or equal to", + constraint_value=validations['max_length'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minLength', _instantiation_metadata.configuration) and + 'min_length' in validations and + len(input_values) < validations['min_length']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="length must be greater than or equal to", + constraint_value=validations['min_length'], + path_to_item=_instantiation_metadata.path_to_item + ) + + checked_value = input_values + if (cls.__is_json_validation_enabled('pattern', _instantiation_metadata.configuration) and + 'regex' in validations): + for regex_dict in validations['regex']: + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], checked_value, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=_instantiation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def __check_tuple_validations( + cls, validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if (cls.__is_json_validation_enabled('maxItems', _instantiation_metadata.configuration) and + 'max_items' in validations and + len(input_values) > validations['max_items']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of items must be less than or equal to", + constraint_value=validations['max_items'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minItems', _instantiation_metadata.configuration) and + 'min_items' in validations and + len(input_values) < validations['min_items']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of items must be greater than or equal to", + constraint_value=validations['min_items'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('uniqueItems', _instantiation_metadata.configuration) and + 'unique_items' in validations and validations['unique_items'] and input_values): + unique_items = [] + # print(validations) + for item in input_values: + if item not in unique_items: + unique_items.append(item) + if len(input_values) > len(unique_items): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def __check_dict_validations( + cls, validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if (cls.__is_json_validation_enabled('maxProperties', _instantiation_metadata.configuration) and + 'max_properties' in validations and + len(input_values) > validations['max_properties']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of properties must be less than or equal to", + constraint_value=validations['max_properties'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minProperties', _instantiation_metadata.configuration) and + 'min_properties' in validations and + len(input_values) < validations['min_properties']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=validations['min_properties'], + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def __check_numeric_validations( + cls, validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if cls.__is_json_validation_enabled('multipleOf', + _instantiation_metadata.configuration) and 'multiple_of' in validations: + multiple_of_values = validations['multiple_of'] + for multiple_of_value in multiple_of_values: + if (isinstance(input_values, Decimal) and + not (float(input_values) / multiple_of_value).is_integer() + ): + # Note 'multipleOf' will be as good as the floating point arithmetic. + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of_value, + path_to_item=_instantiation_metadata.path_to_item + ) + + checking_max_or_min_values = {'exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum'}.isdisjoint(validations) is False + if not checking_max_or_min_values: + return + max_val = input_values + min_val = input_values + + if (cls.__is_json_validation_enabled('exclusiveMaximum', _instantiation_metadata.configuration) and + 'exclusive_maximum' in validations and + max_val >= validations['exclusive_maximum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value less than", + constraint_value=validations['exclusive_maximum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('maximum', _instantiation_metadata.configuration) and + 'inclusive_maximum' in validations and + max_val > validations['inclusive_maximum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value less than or equal to", + constraint_value=validations['inclusive_maximum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('exclusiveMinimum', _instantiation_metadata.configuration) and + 'exclusive_minimum' in validations and + min_val <= validations['exclusive_minimum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value greater than", + constraint_value=validations['exclusive_maximum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minimum', _instantiation_metadata.configuration) and + 'inclusive_minimum' in validations and + min_val < validations['inclusive_minimum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value greater than or equal to", + constraint_value=validations['inclusive_minimum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def _check_validations_for_types( + cls, + validations, + input_values, + _instantiation_metadata: InstantiationMetadata + ): + if isinstance(input_values, str): + cls.__check_str_validations(validations, input_values, _instantiation_metadata) + elif isinstance(input_values, tuple): + cls.__check_tuple_validations(validations, input_values, _instantiation_metadata) + elif isinstance(input_values, frozendict): + cls.__check_dict_validations(validations, input_values, _instantiation_metadata) + elif isinstance(input_values, Decimal): + cls.__check_numeric_validations(validations, input_values, _instantiation_metadata) + try: + return super()._validate_validations_pass(input_values, _instantiation_metadata) + except AttributeError: + return True + + +class Validator(typing.Protocol): + def _validate_validations_pass( + cls, + input_values, + _instantiation_metadata: InstantiationMetadata + ): + pass + + +def _SchemaValidator(**validations: typing.Union[str, bool, None, int, float, list[dict[str, typing.Union[str, int, float]]]]) -> Validator: + class SchemaValidator(ValidatorBase): + @classmethod + def _validate_validations_pass( + cls, + input_values, + _instantiation_metadata: InstantiationMetadata + ): + cls._check_validations_for_types(validations, input_values, _instantiation_metadata) + try: + return super()._validate_validations_pass(input_values, _instantiation_metadata) + except AttributeError: + return True + + return SchemaValidator + + +class TypeChecker(typing.Protocol): + @classmethod + def _validate_type( + cls, arg_simple_class: type + ) -> typing.Tuple[type]: + pass + + +def _SchemaTypeChecker(union_type_cls: typing.Union[typing.Any]) -> TypeChecker: + if typing.get_origin(union_type_cls) is typing.Union: + union_classes = typing.get_args(union_type_cls) + else: + # note: when a union of a single class is passed in, the union disappears + union_classes = tuple([union_type_cls]) + """ + I want the type hint... union_type_cls + and to use it as a base class but when I do, I get + TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases + """ + class SchemaTypeChecker: + @classmethod + def _validate_type(cls, arg_simple_class: type): + if arg_simple_class not in union_classes: + return union_classes + try: + return super()._validate_type(arg_simple_class) + except AttributeError: + return tuple() + + return SchemaTypeChecker + + +class EnumMakerBase: + @classmethod + @property + def _enum_by_value( + cls + ) -> type: + enum_classes = {} + if not hasattr(cls, "_enum_value_to_name"): + return enum_classes + for enum_value, enum_name in cls._enum_value_to_name.items(): + base_class = type(enum_value) + if base_class is none_type: + enum_classes[enum_value] = get_new_class( + "Dynamic" + cls.__name__, (cls, NoneClass)) + log_cache_usage(get_new_class) + elif base_class is bool: + enum_classes[enum_value] = get_new_class( + "Dynamic" + cls.__name__, (cls, BoolClass)) + log_cache_usage(get_new_class) + else: + enum_classes[enum_value] = get_new_class( + "Dynamic" + cls.__name__, (cls, Singleton, base_class)) + log_cache_usage(get_new_class) + return enum_classes + + +class EnumMakerInterface(typing.Protocol): + @classmethod + @property + def _enum_value_to_name( + cls + ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + pass + + @classmethod + @property + def _enum_by_value( + cls + ) -> type: + pass + + +def _SchemaEnumMaker(enum_value_to_name: typing.Dict[typing.Union[str, Decimal, bool, none_type], str]) -> EnumMakerInterface: + class SchemaEnumMaker(EnumMakerBase): + @classmethod + @property + def _enum_value_to_name( + cls + ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + pass + try: + super_enum_value_to_name = super()._enum_value_to_name + except AttributeError: + return enum_value_to_name + intersection = dict(enum_value_to_name.items() & super_enum_value_to_name.items()) + return intersection + + return SchemaEnumMaker + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg) + """ + # TODO use bidict to store this so boolean enums can move through it in reverse to get their own arg value? + _instances = {} + + def __new__(cls, *args, **kwargs): + if not args: + raise ValueError('arg must be passed') + arg = args[0] + key = (cls, arg) + if key not in cls._instances: + if arg in {None, True, False}: + inst = super().__new__(cls) + # inst._value = arg + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg) + return cls._instances[key] + + def __repr__(self): + return '({}, {})'.format(self.__class__.__name__, self) + + +class NoneClass(Singleton): + @classmethod + @property + def NONE(cls): + return cls(None) + + def is_none(self) -> bool: + return True + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classmethod + @property + def TRUE(cls): + return cls(True) + + @classmethod + @property + def FALSE(cls): + return cls(False) + + @functools.cache + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return key[1] + raise ValueError('Unable to find the boolean value of this instance') + + def is_true(self): + return bool(self) + + def is_false(self): + return bool(self) + + +class BoolBase: + pass + + +class NoneBase: + pass + + +class StrBase: + @property + def as_str(self) -> str: + return self + + @property + def as_date(self) -> date: + raise Exception('not implemented') + + @property + def as_datetime(self) -> datetime: + raise Exception('not implemented') + + +class CustomIsoparser(isoparser): + + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime(*components) + timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +class DateBase(StrBase): + @property + @functools.cache + def as_date(self) -> date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + @classmethod + def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, str): + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return True + except ValueError: + raise ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DateBase _validate + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + +class DateTimeBase: + @property + @functools.cache + def as_datetime(self) -> datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + @classmethod + def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, str): + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return True + except ValueError: + raise ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DateTimeBase _validate + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + +class NumberBase: + @property + def as_int(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise ApiValueError(f'{self} is not an float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + @classmethod + def _validate_items(cls, list_items, _instantiation_metadata: InstantiationMetadata): + """ + Ensures that: + - values passed in for items are valid + Exceptions will be raised if: + - invalid arguments were passed in + + Args: + list_items: the input list of items + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + + # if we have definitions for an items schema, use it + # otherwise accept anything + item_cls = getattr(cls, '_items', AnyTypeSchema) + path_to_schemas = defaultdict(set) + for i, value in enumerate(list_items): + if isinstance(value, item_cls): + continue + item_instantiation_metadata = InstantiationMetadata( + from_server=_instantiation_metadata.from_server, + configuration=_instantiation_metadata.configuration, + path_to_item=_instantiation_metadata.path_to_item+(i,) + ) + other_path_to_schemas = item_cls._validate( + value, _instantiation_metadata=item_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + ListBase _validate + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + arg = args[0] + _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + if not isinstance(arg, tuple): + return _path_to_schemas + if cls in _instantiation_metadata.base_classes: + # we have already moved through this class so stop here + return _path_to_schemas + _instantiation_metadata.base_classes |= frozenset({cls}) + other_path_to_schemas = cls._validate_items(arg, _instantiation_metadata=_instantiation_metadata) + update(_path_to_schemas, other_path_to_schemas) + return _path_to_schemas + + @classmethod + def _get_items(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + ''' + ListBase _get_items + ''' + _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata + + list_items = args[0] + cast_items = [] + # if we have definitions for an items schema, use it + # otherwise accept anything + + cls_item_cls = getattr(cls, '_items', AnyTypeSchema) + for i, value in enumerate(list_items): + item_path_to_item = _instantiation_metadata.path_to_item+(i,) + if item_path_to_item in _instantiation_metadata.path_to_schemas: + item_cls = _instantiation_metadata.path_to_schemas[item_path_to_item] + else: + item_cls = cls_item_cls + + if isinstance(value, item_cls): + cast_items.append(value) + continue + item_instantiation_metadata = InstantiationMetadata( + configuration=_instantiation_metadata.configuration, + from_server=_instantiation_metadata.from_server, + path_to_item=item_path_to_item, + path_to_schemas=_instantiation_metadata.path_to_schemas, + ) + + if _instantiation_metadata.from_server: + new_value = item_cls._from_openapi_data(value, _instantiation_metadata=item_instantiation_metadata) + else: + new_value = item_cls(value, _instantiation_metadata=item_instantiation_metadata) + cast_items.append(new_value) + + return cast_items + + +class Discriminable: + @classmethod + def _ensure_discriminator_value_present(cls, disc_property_name: str, _instantiation_metadata: InstantiationMetadata, *args): + if not args or args and disc_property_name not in args[0]: + # The input data does not contain the discriminator property + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls, '_discriminator'): + return None + disc = cls._discriminator + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + elif not hasattr(cls, '_composed_schemas'): + return None + # TODO stop traveling if a cycle is hit + for allof_cls in cls._composed_schemas['allOf']: + discriminated_cls = allof_cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + for oneof_cls in cls._composed_schemas['oneOf']: + discriminated_cls = oneof_cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + for anyof_cls in cls._composed_schemas['anyOf']: + discriminated_cls = anyof_cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + + +class DictBase(Discriminable): + # subclass properties + _required_property_names = set() + + @classmethod + def _validate_arg_presence(cls, arg): + """ + Ensures that: + - all required arguments are passed in + - the input variable names are valid + - present in properties or + - accepted because additionalProperties exists + Exceptions will be raised if: + - invalid arguments were passed in + - a var_name is invalid if additionProperties == None and var_name not in _properties + - required properties were not passed in + + Args: + arg: the input dict + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + seen_required_properties = set() + invalid_arguments = [] + for property_name in arg: + if property_name in cls._required_property_names: + seen_required_properties.add(property_name) + elif property_name in cls._property_names: + continue + elif cls._additional_properties: + continue + else: + invalid_arguments.append(property_name) + missing_required_arguments = list(cls._required_property_names - seen_required_properties) + if missing_required_arguments: + missing_required_arguments.sort() + raise ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + if invalid_arguments: + invalid_arguments.sort() + raise ApiTypeError( + "{} was passed {} invalid argument{}: {}".format( + cls.__name__, + len(invalid_arguments), + "s" if len(invalid_arguments) > 1 else "", + invalid_arguments + ) + ) + + @classmethod + def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): + """ + Ensures that: + - values passed in for properties are valid + Exceptions will be raised if: + - invalid arguments were passed in + + Args: + arg: the input dict + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + path_to_schemas = defaultdict(set) + for property_name, value in arg.items(): + if property_name in cls._required_property_names or property_name in cls._property_names: + schema = getattr(cls, property_name) + elif cls._additional_properties: + schema = cls._additional_properties + else: + raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( + value, cls, _instantiation_metadata.path_to_item+(property_name,) + )) + if isinstance(value, schema): + continue + arg_instantiation_metadata = InstantiationMetadata( + from_server=_instantiation_metadata.from_server, + configuration=_instantiation_metadata.configuration, + path_to_item=_instantiation_metadata.path_to_item+(property_name,) + ) + other_path_to_schemas = schema._validate(value, _instantiation_metadata=arg_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + _instantiation_metadata.path_to_schemas.update(arg_instantiation_metadata.path_to_schemas) + return path_to_schemas + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DictBase _validate + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + if args and isinstance(args[0], cls): + # an instance of the correct type was passed in + return {} + arg = args[0] + _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + if not isinstance(arg, frozendict): + return _path_to_schemas + cls._validate_arg_presence(args[0]) + other_path_to_schemas = cls._validate_args(args[0], _instantiation_metadata=_instantiation_metadata) + update(_path_to_schemas, other_path_to_schemas) + try: + _discriminator = cls._discriminator + except AttributeError: + return _path_to_schemas + # discriminator exists + disc_prop_name = list(_discriminator.keys())[0] + cls._ensure_discriminator_value_present(disc_prop_name, _instantiation_metadata, *args) + discriminated_cls = cls._get_discriminated_class( + disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) + if discriminated_cls is None: + raise ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(_discriminator[disc_prop_name].keys()), + _instantiation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls in _instantiation_metadata.base_classes: + # we have already moved through this class so stop here + return _path_to_schemas + _instantiation_metadata.base_classes |= frozenset({cls}) + other_path_to_schemas = discriminated_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + update(_path_to_schemas, other_path_to_schemas) + return _path_to_schemas + + @classmethod + @property + def _additional_properties(cls): + return AnyTypeSchema + + @classmethod + @property + @functools.cache + def _property_names(cls): + property_names = set() + for var_name, var_value in cls.__dict__.items(): + # referenced models are classmethods + is_classmethod = type(var_value) is classmethod + if is_classmethod: + property_names.add(var_name) + continue + is_class = type(var_value) is type + if not is_class: + continue + if not issubclass(var_value, Schema): + continue + if var_name == '_additional_properties': + continue + property_names.add(var_name) + property_names = list(property_names) + property_names.sort() + return tuple(property_names) + + @classmethod + def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + # if we have definitions for property schemas convert values using it + # otherwise accept anything + + _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata + + for property_name_js, value in arg.items(): + property_cls = getattr(cls, property_name_js, cls._additional_properties) + property_path_to_item = _instantiation_metadata.path_to_item+(property_name_js,) + stored_property_cls = _instantiation_metadata.path_to_schemas.get(property_path_to_item) + if stored_property_cls: + property_cls = stored_property_cls + + if isinstance(value, property_cls): + dict_items[property_name_js] = value + continue + + prop_instantiation_metadata = InstantiationMetadata( + configuration=_instantiation_metadata.configuration, + from_server=_instantiation_metadata.from_server, + path_to_item=property_path_to_item, + path_to_schemas=_instantiation_metadata.path_to_schemas, + ) + if _instantiation_metadata.from_server: + new_value = property_cls._from_openapi_data(value, _instantiation_metadata=prop_instantiation_metadata) + else: + new_value = property_cls(value, _instantiation_metadata=prop_instantiation_metadata) + dict_items[property_name_js] = new_value + return dict_items + + def __setattr__(self, name, value): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name): + if isinstance(self, frozendict): + # if an attribute does not exist + try: + return self[name] + except KeyError as ex: + raise AttributeError(str(ex)) + # print(('non-frozendict __getattr__', name)) + return super().__getattr__(self, name) + + def __getattribute__(self, name): + # print(('__getattribute__', name)) + # if an attribute does exist (for example as a class property but not as an instance method) + try: + return self[name] + except (KeyError, TypeError): + return super().__getattribute__(name) + + +inheritable_primitive_types_set = {Decimal, str, tuple, frozendict, FileIO, bytes} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + + ensures that: + - payload passes required validations + - payload is of allowed types + - payload value is an allowed enum value + """ + + @staticmethod + def __get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, frozendict): + return frozendict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, bytes): + return bytes + elif isinstance(input_value, (io.FileIO, io.BufferedReader)): + return FileIO + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + return int + elif isinstance(input_value, float): + return float + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif isinstance(input_value, str): + return str + return type(input_value) + + @staticmethod + def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + @classmethod + def __type_error_message( + cls, var_value=None, var_name=None, valid_classes=None, key_type=None + ): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + @classmethod + def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): + error_msg = cls.__type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + @classmethod + def _class_by_base_class(cls, base_cls: type) -> type: + cls_name = "Dynamic"+cls.__name__ + if base_cls is bool: + new_cls = get_new_class(cls_name, (cls, BoolBase, BoolClass)) + elif base_cls is str: + new_cls = get_new_class(cls_name, (cls, StrBase, str)) + elif base_cls is Decimal: + new_cls = get_new_class(cls_name, (cls, NumberBase, Decimal)) + elif base_cls is tuple: + new_cls = get_new_class(cls_name, (cls, ListBase, tuple)) + elif base_cls is frozendict: + new_cls = get_new_class(cls_name, (cls, DictBase, frozendict)) + elif base_cls is none_type: + new_cls = get_new_class(cls_name, (cls, NoneBase, NoneClass)) + log_cache_usage(get_new_class) + return new_cls + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + Schema _validate + Runs all schema validation logic and + returns a dynamic class of different bases depending upon the input + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Use cases: + 1. inheritable type: string/Decimal/frozendict/tuple + 2. enum value cases: 'hi', 1 -> no base_class set because the enum includes the base class + 3. uninheritable type: True/False/None -> no base_class because the base class is not inheritable + _enum_by_value will handle this use case + + Required Steps: + 1. verify type of input is valid vs the allowed _types + 2. check validations that are applicable for this type of input + 3. if enums exist, check that the value exists in the enum + + Returns: + path_to_schemas: a map of path to schemas + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + arg = args[0] + + base_class = cls.__get_simple_class(arg) + failed_type_check_classes = cls._validate_type(base_class) + if failed_type_check_classes: + raise cls.__get_type_error( + arg, + _instantiation_metadata.path_to_item, + failed_type_check_classes, + key_type=False, + ) + if hasattr(cls, '_validate_validations_pass'): + cls._validate_validations_pass(arg, _instantiation_metadata) + path_to_schemas = defaultdict(set) + path_to_schemas[_instantiation_metadata.path_to_item].add(cls) + + if hasattr(cls, "_enum_by_value"): + cls._validate_enum_value(arg) + return path_to_schemas + + if base_class is none_type or base_class is bool: + return path_to_schemas + + path_to_schemas[_instantiation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @classmethod + def _validate_enum_value(cls, arg): + try: + cls._enum_by_value[arg] + except KeyError: + raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name)) + + @classmethod + def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): + """ + PATH 1 - make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + """ + if ( + _instantiation_metadata.path_to_schemas and + _instantiation_metadata.path_to_item in _instantiation_metadata.path_to_schemas): + chosen_new_cls = _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] + # print('leaving __get_new_cls early for cls {} because path_to_schemas exists'.format(cls)) + # print(_instantiation_metadata.path_to_item) + # print(chosen_new_cls) + return chosen_new_cls + """ + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = cls._validate(arg, _instantiation_metadata=_instantiation_metadata) + from pprint import pprint + pprint(dict(_path_to_schemas)) + # loop through it make a new class for each entry + for path, schema_classes in _path_to_schemas.items(): + enum_schema = any( + hasattr(this_cls, '_enum_by_value') for this_cls in schema_classes) + inheritable_primitive_type = schema_classes.intersection(inheritable_primitive_types_set) + chosen_schema_classes = schema_classes + suffix = tuple() + if inheritable_primitive_type: + chosen_schema_classes = schema_classes - inheritable_primitive_types_set + if not enum_schema: + # include the inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + + if len(chosen_schema_classes) == 1 and not suffix: + mfg_cls = tuple(chosen_schema_classes)[0] + else: + x_schema = schema_descendents & chosen_schema_classes + if x_schema: + x_schema = x_schema.pop() + if any(c is not x_schema and issubclass(c, x_schema) for c in chosen_schema_classes): + # needed to not have a mro error in get_new_class + chosen_schema_classes.remove(x_schema) + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + + if inheritable_primitive_type and not enum_schema: + _instantiation_metadata.path_to_schemas[path] = mfg_cls + continue + + # Use case: value is None, True, False, or an enum value + # print('choosing enum class for path {} in arg {}'.format(path, arg)) + value = arg + for key in path[1:]: + value = value[key] + if hasattr(mfg_cls, '_enum_by_value'): + mfg_cls = mfg_cls._enum_by_value[value] + elif value in {True, False}: + mfg_cls = mfg_cls._class_by_base_class(bool) + elif value is None: + mfg_cls = mfg_cls._class_by_base_class(none_type) + else: + raise ApiValueError('Unhandled case value={} bases={}'.format(value, mfg_cls.__bases__)) + _instantiation_metadata.path_to_schemas[path] = mfg_cls + + return _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] + + @classmethod + def __get_new_instance_without_conversion(cls, arg, _instantiation_metadata): + # PATH 2 - we have a Dynamic class and we are making an instance of it + if issubclass(cls, tuple): + items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) + return super(Schema, cls).__new__(cls, items) + elif issubclass(cls, frozendict): + properties = cls._get_properties(arg, _instantiation_metadata=_instantiation_metadata) + return super(Schema, cls).__new__(cls, properties) + """ + str = openapi str, date, and datetime + Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def _from_openapi_data( + cls, + arg: typing.Union[ + str, + date, + datetime, + int, + float, + Decimal, + bool, + None, + 'Schema', + dict, + frozendict, + tuple, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] + ): + arg = cast_to_allowed_types(arg, from_server=True) + _instantiation_metadata = InstantiationMetadata(from_server=True) if _instantiation_metadata is None else _instantiation_metadata + if not _instantiation_metadata.from_server: + raise ApiValueError( + 'from_server must be True in this code path, if you need it to be False, use cls()' + ) + new_cls = cls.__get_new_cls(arg, _instantiation_metadata) + new_inst = new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + """ + Schema __new__ + + Args: + args (int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): the value + kwargs (str, int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + _instantiation_metadata: contains the needed from_server, configuration, path_to_item + """ + kwargs = cls.__remove_unsets(kwargs) + if not args and not kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not kwargs and args and not isinstance(args[0], dict): + arg = args[0] + else: + arg = cls.__get_input_dict(*args, **kwargs) + _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata + if _instantiation_metadata.from_server: + raise ApiValueError( + 'from_server must be False in this code path, if you need it to be True, use cls._from_openapi_data()' + ) + arg = cast_to_allowed_types(arg, from_server=_instantiation_metadata.from_server) + new_cls = cls.__get_new_cls(arg, _instantiation_metadata) + return new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + + def __init__( + self, + *args: typing.Union[ + dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Union[ + dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + ] + ): + """ + this is needed to fix 'Unexpected argument' warning in pycharm + this code does nothing because all Schema instances are immutable + this means that all input data is passed into and used in new, and after the new instance is made + no new attributes are assigned and init is not used + """ + pass + + +def cast_to_allowed_types(arg: typing.Union[str, date, datetime, int, float, None, dict, frozendict, list, tuple, bytes, Schema], from_server=False) -> typing.Union[str, bytes, int, float, None, frozendict, tuple, Schema]: + """ + from_server=False date, datetime -> str + int, float -> Decimal + StrSchema will convert that to bytes and remember the encoding when we pass in str input + """ + if isinstance(arg, (date, datetime)): + if not from_server: + return arg.isoformat() + # ApiTypeError will be thrown later by _validate_type + return arg + elif isinstance(arg, bool): + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + return arg + elif isinstance(arg, Decimal): + return arg + elif isinstance(arg, int): + return Decimal(arg) + elif isinstance(arg, float): + decimal_from_float = Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, str): + return arg + elif isinstance(arg, bytes): + return arg + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: + raise ApiValueError('Invalid file state; file is closed and must be open') + return arg + elif type(arg) is list or type(arg) is tuple: + return tuple([cast_to_allowed_types(item) for item in arg]) + elif type(arg) is dict or type(arg) is frozendict: + return frozendict({key: cast_to_allowed_types(val) for key, val in arg.items() if val is not unset}) + elif arg is None: + return arg + elif isinstance(arg, Schema): + return arg + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ComposedBase(Discriminable): + + @classmethod + def __get_allof_classes(cls, *args, _instantiation_metadata: InstantiationMetadata): + path_to_schemas = defaultdict(set) + for allof_cls in cls._composed_schemas['allOf']: + if allof_cls in _instantiation_metadata.base_classes: + continue + other_path_to_schemas = allof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def __get_oneof_class( + cls, + *args, + discriminated_cls, + _instantiation_metadata: InstantiationMetadata, + path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] + ): + oneof_classes = [] + chosen_oneof_cls = None + original_base_classes = _instantiation_metadata.base_classes + new_base_classes = _instantiation_metadata.base_classes + path_to_schemas = defaultdict(set) + for oneof_cls in cls._composed_schemas['oneOf']: + if oneof_cls in path_to_schemas[_instantiation_metadata.path_to_item]: + oneof_classes.append(oneof_cls) + continue + if isinstance(args[0], oneof_cls): + # passed in instance is the correct type + chosen_oneof_cls = oneof_cls + oneof_classes.append(oneof_cls) + continue + _instantiation_metadata.base_classes = original_base_classes + try: + path_to_schemas = oneof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + new_base_classes = _instantiation_metadata.base_classes + except (ApiValueError, ApiTypeError) as ex: + if discriminated_cls is not None and oneof_cls is discriminated_cls: + raise ex + continue + chosen_oneof_cls = oneof_cls + oneof_classes.append(oneof_cls) + if not oneof_classes: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + _instantiation_metadata.base_classes = new_base_classes + return path_to_schemas + + @classmethod + def __get_anyof_classes( + cls, + *args, + discriminated_cls, + _instantiation_metadata: InstantiationMetadata + ): + anyof_classes = [] + chosen_anyof_cls = None + original_base_classes = _instantiation_metadata.base_classes + path_to_schemas = defaultdict(set) + for anyof_cls in cls._composed_schemas['anyOf']: + if anyof_cls in _instantiation_metadata.base_classes: + continue + if isinstance(args[0], anyof_cls): + # passed in instance is the correct type + chosen_anyof_cls = anyof_cls + anyof_classes.append(anyof_cls) + continue + + _instantiation_metadata.base_classes = original_base_classes + try: + other_path_to_schemas = anyof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + except (ApiValueError, ApiTypeError) as ex: + if discriminated_cls is not None and anyof_cls is discriminated_cls: + raise ex + continue + original_base_classes = _instantiation_metadata.base_classes + chosen_anyof_cls = anyof_cls + anyof_classes.append(anyof_cls) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + ComposedBase _validate + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + if args and isinstance(args[0], Schema) and _instantiation_metadata.from_server is False: + if isinstance(args[0], cls): + # an instance of the correct type was passed in + return {} + raise ApiTypeError( + 'Incorrect type passed in, required type was {} and passed type was {} at {}'.format( + cls, + type(args[0]), + _instantiation_metadata.path_to_item + ) + ) + + # validation checking on types, validations, and enums + path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + _instantiation_metadata.base_classes |= frozenset({cls}) + + # process composed schema + _discriminator = getattr(cls, '_discriminator', None) + discriminated_cls = None + if _discriminator and args and isinstance(args[0], frozendict): + disc_property_name = list(_discriminator.keys())[0] + cls._ensure_discriminator_value_present(disc_property_name, _instantiation_metadata, *args) + # get discriminated_cls by looking at the dict in the current class + discriminated_cls = cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=args[0][disc_property_name]) + if discriminated_cls is None: + raise ApiValueError( + "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( + args[0][disc_property_name], + cls.__name__, + disc_property_name, + list(_discriminator[disc_property_name].keys()), + _instantiation_metadata.path_to_item + (disc_property_name,) + ) + ) + + if cls._composed_schemas['allOf']: + other_path_to_schemas = cls.__get_allof_classes(*args, _instantiation_metadata=_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + if cls._composed_schemas['oneOf']: + other_path_to_schemas = cls.__get_oneof_class( + *args, + discriminated_cls=discriminated_cls, + _instantiation_metadata=_instantiation_metadata, + path_to_schemas=path_to_schemas + ) + update(path_to_schemas, other_path_to_schemas) + if cls._composed_schemas['anyOf']: + other_path_to_schemas = cls.__get_anyof_classes( + *args, + discriminated_cls=discriminated_cls, + _instantiation_metadata=_instantiation_metadata + ) + update(path_to_schemas, other_path_to_schemas) + + if discriminated_cls is not None: + # TODO use an exception from this package here + assert discriminated_cls in path_to_schemas[_instantiation_metadata.path_to_item] + return path_to_schemas + + +# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase +class ComposedSchema( + _SchemaTypeChecker(typing.Union[none_type, str, Decimal, bool, tuple, frozendict]), + ComposedBase, + DictBase, + ListBase, + NumberBase, + StrBase, + BoolBase, + NoneBase, + Schema +): + + # subclass properties + _composed_schemas = {} + + @classmethod + def _from_openapi_data(cls, *args: typing.Any, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs): + if not args: + if not kwargs: + raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) + args = (kwargs, ) + return super()._from_openapi_data(args[0], _instantiation_metadata=_instantiation_metadata) + + +class ListSchema( + _SchemaTypeChecker(typing.Union[tuple]), + ListBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.List[typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[list, tuple], **kwargs: InstantiationMetadata): + return super().__new__(cls, arg, **kwargs) + + +class NoneSchema( + _SchemaTypeChecker(typing.Union[none_type]), + NoneBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: None, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: None, **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class NumberSchema( + _SchemaTypeChecker(typing.Union[Decimal]), + NumberBase, + Schema +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[int, float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class IntBase(NumberBase): + @property + def as_int(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + @classmethod + def _validate_format(cls, arg: typing.Optional[Decimal], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, Decimal): + exponent = arg.as_tuple().exponent + if exponent != 0: + raise ApiValueError( + "Invalid value '{}' for type integer at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + IntBase _validate + TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + +class IntSchema(IntBase, NumberSchema): + + @classmethod + def _from_openapi_data(cls, arg: int, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class Int32Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-2147483648), + inclusive_maximum=Decimal(2147483647) + ), + IntSchema +): + pass + +class Int64Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-9223372036854775808), + inclusive_maximum=Decimal(9223372036854775807) + ), + IntSchema +): + pass + + +class Float32Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-3.4028234663852886e+38), + inclusive_maximum=Decimal(3.4028234663852886e+38) + ), + NumberSchema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + # todo check format + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + +class Float64Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-1.7976931348623157E+308), + inclusive_maximum=Decimal(1.7976931348623157E+308) + ), + NumberSchema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + # todo check format + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + +class StrSchema( + _SchemaTypeChecker(typing.Union[str]), + StrBase, + Schema +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[str], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None) -> 'StrSchema': + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[str, date, datetime], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class DateSchema(DateBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class BytesSchema( + _SchemaTypeChecker(typing.Union[bytes]), + Schema, +): + """ + this class will subclass bytes and is immutable + """ + def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[InstantiationMetadata]): + return super(Schema, cls).__new__(cls, arg) + + +class FileSchema( + _SchemaTypeChecker(typing.Union[FileIO]), + Schema, +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[InstantiationMetadata]): + return super(Schema, cls).__new__(cls, arg) + + +class BinaryBase: + pass + + +class BinarySchema( + _SchemaTypeChecker(typing.Union[bytes, FileIO]), + ComposedBase, + BinaryBase, + Schema, +): + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [], + 'oneOf': [ + BytesSchema, + FileSchema, + ], + 'anyOf': [ + ], + } + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg) + + +class BoolSchema( + _SchemaTypeChecker(typing.Union[bool]), + BoolBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: bool, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: bool, **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class AnyTypeSchema( + _SchemaTypeChecker( + typing.Union[frozendict, tuple, Decimal, str, bool, none_type, bytes, FileIO] + ), + DictBase, + ListBase, + NumberBase, + StrBase, + BoolBase, + NoneBase, + Schema +): + pass + + +class DictSchema( + _SchemaTypeChecker(typing.Union[frozendict]), + DictBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): + return super().__new__(cls, *args, **kwargs) + + +schema_descendents = set([NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema]) + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +@functools.cache +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + return type(class_name, bases, {}) + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars new file mode 100644 index 00000000000..476157a0c5d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars @@ -0,0 +1,51 @@ +# coding: utf-8 + +{{>partial_header}} + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "{{{projectName}}}" +VERSION = "{{packageVersion}}" +{{#with apiInfo}} +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "urllib3 >= 1.15", + "certifi", + "python-dateutil", + "frozendict >= 2.0.3", +{{#if asyncio}} + "aiohttp >= 3.0.0", +{{/if}} +{{#if tornado}} + "tornado>=4.2,<5", +{{/if}} +{{#if hasHttpSignatureMethods}} + "pem>=19.3.0", + "pycryptodome>=3.9.0", +{{/if}} +] + +setup( + name=NAME, + version=VERSION, + description="{{appName}}", + author="{{#if infoName}}{{infoName}}{{/if}}{{#unless infoName}}OpenAPI Generator community{{/unless}}", + author_email="{{#if infoEmail}}{{infoEmail}}{{/if}}{{#unless infoEmail}}team@openapitools.org{{/unless}}", + url="{{packageUrl}}", + keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], + python_requires=">=3.9", + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + {{#if licenseInfo}}license="{{licenseInfo}}", + {{/if}}long_description="""\ + {{appDescription}} # noqa: E501 + """ +) +{{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/setup_cfg.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/setup_cfg.handlebars new file mode 100644 index 00000000000..8cb28d8c285 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/setup_cfg.handlebars @@ -0,0 +1,13 @@ +{{#if useNose}} +[nosetests] +logging-clear-handlers=true +verbosity=2 +randomize=true +exe=true +with-coverage=true +cover-package={{{packageName}}} +cover-erase=true + +{{/if}} +[flake8] +max-line-length=99 diff --git a/modules/openapi-generator/src/main/resources/python-experimental/signing.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/signing.handlebars new file mode 100644 index 00000000000..26d2b8cb37c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/signing.handlebars @@ -0,0 +1,409 @@ +# coding: utf-8 +{{>partial_header}} + +from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from email.utils import formatdate +import json +import os +import re +from time import time +from urllib.parse import urlencode, urlparse + +# The constants below define a subset of HTTP headers that can be included in the +# HTTP signature scheme. Additional headers may be included in the signature. + +# The '(request-target)' header is a calculated field that includes the HTTP verb, +# the URL path and the URL query. +HEADER_REQUEST_TARGET = '(request-target)' +# The time when the HTTP signature was generated. +HEADER_CREATED = '(created)' +# The time when the HTTP signature expires. The API server should reject HTTP requests +# that have expired. +HEADER_EXPIRES = '(expires)' +# The 'Host' header. +HEADER_HOST = 'Host' +# The 'Date' header. +HEADER_DATE = 'Date' +# When the 'Digest' header is included in the HTTP signature, the client automatically +# computes the digest of the HTTP request body, per RFC 3230. +HEADER_DIGEST = 'Digest' +# The 'Authorization' header is automatically generated by the client. It includes +# the list of signed headers and a base64-encoded signature. +HEADER_AUTHORIZATION = 'Authorization' + +# The constants below define the cryptographic schemes for the HTTP signature scheme. +SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' + +# The constants below define the signature algorithms that can be used for the HTTP +# signature scheme. +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 +} + +# The cryptographic hash algorithm for the message signature. +HASH_SHA256 = 'sha256' +HASH_SHA512 = 'sha512' + + +class HttpSigningConfiguration(object): + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: A string value specifying the identifier of the cryptographic key, + when signing HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + If None, the signing algorithm is inferred from the private key. + The default signing algorithm for RSA keys is RSASSA-PSS. + The default signing algorithm for ECDSA keys is fips-186-3. + :param hash_algorithm: The hash algorithm for the signature. Supported values are + sha256 and sha512. + If the signing_scheme is rsa-sha256, the hash algorithm must be set + to None or sha256. + If the signing_scheme is rsa-sha512, the hash algorithm must be set + to None or sha512. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. + """ + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, + signed_headers=None, + signing_algorithm=None, + hash_algorithm=None, + signature_max_validity=None): + self.key_id = key_id + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) + self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase + self.signing_algorithm = signing_algorithm + self.hash_algorithm = hash_algorithm + if signing_scheme == SCHEME_RSA_SHA256: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA256 + elif self.hash_algorithm != HASH_SHA256: + raise Exception("Hash algorithm must be sha256 when security scheme is %s" % + SCHEME_RSA_SHA256) + elif signing_scheme == SCHEME_RSA_SHA512: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA512 + elif self.hash_algorithm != HASH_SHA512: + raise Exception("Hash algorithm must be sha512 when security scheme is %s" % + SCHEME_RSA_SHA512) + elif signing_scheme == SCHEME_HS2019: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA256 + elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}: + raise Exception("Invalid hash algorithm") + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: + raise Exception( + "Signature max validity must be set when " + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if HEADER_AUTHORIZATION in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + """ + self._load_private_key() + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_list, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) + + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) + + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( + signed_headers_list, b64_signed_msg) + + return request_headers_dict + + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + + def _load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) + else: + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) + + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object (e.g. a dict) representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + request_target += "?" + urlencode(query_params) + + # Get UNIX time, e.g. seconds since epoch, not including leap seconds. + now = time() + # Format date per RFC 7231 section-7.1.1.2. An example is: + # Date: Wed, 21 Oct 2015 07:28:00 GMT + cdate = formatdate(timeval=now, localtime=False, usegmt=True) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = int(now) + if self.signature_max_validity is not None: + expires = now + self.signature_max_validity.total_seconds() + + signed_headers_list = [] + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = '{0}'.format(created) + elif hdr_key == HEADER_EXPIRES: + value = '{0}'.format(expires) + elif hdr_key == HEADER_DATE.lower(): + value = cdate + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST.lower(): + request_body = body.encode() + body_digest, digest_prefix = self._get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST.lower(): + value = target_host + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + else: + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception( + "Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) + signed_headers_list.append((hdr_key, value)) + + return signed_headers_list, request_headers_dict + + def _get_message_digest(self, data): + """Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. + """ + if self.hash_algorithm == HASH_SHA512: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.hash_algorithm == HASH_SHA256: + digest = SHA256.new() + prefix = 'SHA-256=' + else: + raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm)) + digest.update(data) + return digest, prefix + + def _sign_digest(self, digest): + """Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: + # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding. + # Issue: https://github.com/w3c-ccg/http-signatures/issues/107 + signature = DSS.new(key=self.private_key, mode=sig_alg, + encoding='der').sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + else: + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) + + def _get_authorization_header(self, signed_headers, signed_msg): + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) + + return auth_str diff --git a/modules/openapi-generator/src/main/resources/python-experimental/test-requirements.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/test-requirements.handlebars new file mode 100644 index 00000000000..3529726b16d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/test-requirements.handlebars @@ -0,0 +1,15 @@ +{{#if useNose}} +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 +{{/if}} +{{#unless useNose}} +pytest~=4.6.7 # needed for python 3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 3.4 +{{/unless}} +{{#if hasHttpSignatureMethods}} +pycryptodome>=3.9.0 +{{/if}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars new file mode 100644 index 00000000000..5af8eb6f831 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + {{#unless useNose}}pytest --cov={{{packageName}}}{{/unless}}{{#if useNose}}nosetests{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/travis.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/travis.handlebars new file mode 100644 index 00000000000..5e4e1f0cc09 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python-experimental/travis.handlebars @@ -0,0 +1,18 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +{{#if useNose}} +script: nosetests +{{/if}} +{{#unless useNose}} +script: pytest --cov={{{packageName}}} +{{/unless}} diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml new file mode 100644 index 00000000000..f149e72a898 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -0,0 +1,2655 @@ +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: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: Add a new pet to the store + operationId: addPet + responses: + '200': + description: Ok + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + 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' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadImage + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: Classname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: ClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: EnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: EndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: GroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/refs/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: NumberWithValidations + requestBody: + description: Input number as post body + content: + application/json: + schema: + $ref: '#/components/schemas/NumberWithValidations' + required: false + responses: + '200': + description: Output number + content: + application/json: + schema: + $ref: '#/components/schemas/NumberWithValidations' + /fake/refs/mammal: + post: + tags: + - fake + description: Test serialization of mammals + operationId: Mammal + requestBody: + description: Input mammal + content: + application/json: + schema: + $ref: '#/components/schemas/mammal' + required: true + responses: + '200': + description: Output mammal + content: + application/json: + schema: + $ref: '#/components/schemas/mammal' + /fake/refs/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: String + requestBody: + description: Input string as post body + content: + application/json: + schema: + $ref: '#/components/schemas/String' + required: false + responses: + '200': + description: Output string + content: + application/json: + schema: + $ref: '#/components/schemas/String' + x-codegen-request-body-name: body + /fake/refs/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: Boolean + requestBody: + description: Input boolean as post body + content: + application/json: + schema: + $ref: '#/components/schemas/Boolean' + required: false + responses: + '200': + description: Output boolean + content: + application/json: + schema: + $ref: '#/components/schemas/Boolean' + x-codegen-request-body-name: body + /fake/refs/arraymodel: + post: + tags: + - fake + description: Test serialization of ArrayModel + operationId: ArrayModel + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/AnimalFarm' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/AnimalFarm' + x-codegen-request-body-name: body + /fake/refs/composed_one_of_number_with_validations: + post: + tags: + - fake + description: Test serialization of object with $refed properties + operationId: ComposedOneOfDifferentTypes + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/ComposedOneOfDifferentTypes' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/ComposedOneOfDifferentTypes' + /fake/refs/object_model_with_ref_props: + post: + tags: + - fake + description: Test serialization of object with $refed properties + operationId: ObjectModelWithRefProps + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectModelWithRefProps' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectModelWithRefProps' + x-codegen-request-body-name: body + /fake/refs/enum: + post: + tags: + - fake + description: Test serialization of outer enum + operationId: StringEnum + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/StringEnum' + required: false + responses: + '200': + description: Output enum + content: + application/json: + schema: + $ref: '#/components/schemas/StringEnum' + x-codegen-request-body-name: body + /fake/refs/array-of-enums: + post: + tags: + - fake + summary: Array of Enums + operationId: ArrayOfEnums + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + required: false + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + /fake/additional-properties-with-array-of-enums: + get: + tags: + - fake + summary: Additional Properties with Array of Enums + operationId: AdditionalPropertiesWithArrayOfEnums + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' + required: false + responses: + 200: + description: Got object with additional properties with array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: JsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: InlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: BodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: BodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/case-sensitive-params: + put: + tags: + - fake + description: Ensures that original naming is used in endpoint params, that way we on't have collisions + operationId: CaseSensitiveParams + parameters: + - name: someVar + in: query + required: true + schema: + type: string + - name: SomeVar + in: query + required: true + schema: + type: string + - name: some_var + in: query + required: true + schema: + type: string + responses: + "200": + description: Success + /fake/test-query-paramters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: QueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: refParam + in: query + required: true + schema: + $ref: '#/components/schemas/StringWithValidation' + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/: + post: + tags: + - fake + summary: parameter collision case + operationId: parameterCollisions + parameters: + - name: 1 + in: query + schema: + type: string + - name: aB + in: query + schema: + type: string + - name: Ab + in: query + schema: + type: string + - name: self + in: query + schema: + type: string + - name: A-B + in: query + schema: + type: string + - name: 1 + in: header + schema: + type: string + - name: aB + in: header + schema: + type: string + - name: self + in: header + schema: + type: string + - name: A-B + in: header + schema: + type: string + - name: 1 + in: path + required: true + schema: + type: string + - name: aB + in: path + required: true + schema: + type: string + - name: Ab + in: path + required: true + schema: + type: string + - name: self + in: path + required: true + schema: + type: string + - name: A-B + in: path + required: true + schema: + type: string + - name: 1 + in: cookie + schema: + type: string + - name: aB + in: cookie + schema: + type: string + - name: Ab + in: cookie + schema: + type: string + - name: self + in: cookie + schema: + type: string + - name: A-B + in: cookie + schema: + type: string + requestBody: + content: + application/json: + schema: {} + responses: + 200: + description: success + content: + application/json: + schema: {} + /fake/uploadFile: + post: + tags: + - fake + summary: uploads a file using multipart/form-data + description: '' + operationId: uploadFile + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + required: + - file + /fake/uploadFiles: + post: + tags: + - fake + summary: uploads files using multipart/form-data + description: '' + operationId: uploadFiles + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + /fake/uploadDownloadFile: + post: + tags: + - fake + summary: uploads a file and downloads a file using application/octet-stream + description: '' + operationId: uploadDownloadFile + responses: + '200': + description: successful operation + content: + application/octet-stream: + schema: + type: string + format: binary + description: file to download + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + description: file to upload + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + 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 + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + 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 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + 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 + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + description: Pet object that needs to be added to the store + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + description: this is a reserved python keyword + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + description: this is a reserved python keyword + type: string + xml: + name: Name + 200_response: + description: model with an invalid class name for python, starts with a number + properties: + name: + type: integer + format: int32 + class: + description: this is a reserved python keyword + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + FormatTest: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + int32withValidations: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + description: this is a reserved python keyword + type: number + format: float + maximum: 987.6 + minimum: 54.3 + float32: + type: number + format: float + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + float64: + type: number + format: double + arrayWithUniqueItems: + type: array + items: + type: number + uniqueItems: true + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + uuidNoExample: + type: string + format: uuid + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + noneProp: + type: 'null' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + stringEnum: + $ref: '#/components/schemas/StringEnum' + IntegerEnum: + $ref: '#/components/schemas/IntegerEnum' + StringEnumWithDefaultValue: + $ref: '#/components/schemas/StringEnumWithDefaultValue' + IntegerEnumWithDefaultValue: + $ref: '#/components/schemas/IntegerEnumWithDefaultValue' + IntegerEnumOneValue: + $ref: '#/components/schemas/IntegerEnumOneValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + 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 + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + StringEnum: + nullable: true + type: string + enum: + - "placed" + - "approved" + - "delivered" + - 'single quoted' + - |- + multiple + lines + - "double quote \n with newline" + IntegerEnum: + type: integer + enum: + - 0 + - 1 + - 2 + IntegerEnumBig: + type: integer + enum: + - 10 + - 11 + - 12 + StringEnumWithDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + IntegerEnumWithDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + IntegerEnumOneValue: + type: integer + enum: + - 0 + NullableString: + nullable: true + type: string + ObjectModelWithRefProps: + description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + type: object + properties: + myNumber: + $ref: '#/definitions/NumberWithValidations' + myString: + $ref: '#/definitions/String' + myBoolean: + $ref: '#/definitions/Boolean' + NumberWithValidations: + type: number + minimum: 10 + maximum: 20 + ComposedAnyOfDifferentTypesNoValidations: + anyOf: + - type: object + - type: string + format: date + - type: string + format: date-time + - type: string + format: binary + - type: string + format: byte + - type: string + - type: object + - type: boolean + - type: 'null' + - type: array + items: {} + - type: number + - type: number + format: float + - type: number + format: double + - type: integer + - type: integer + format: int32 + - type: integer + format: int64 + ComposedOneOfDifferentTypes: + description: this is a model that allows payloads of type object or number + oneOf: + - $ref: '#/components/schemas/NumberWithValidations' + - $ref: '#/components/schemas/Animal' + - type: 'null' + - type: string + format: date + - type: object + minProperties: 4 + maxProperties: 4 + - type: array + maxItems: 4 + minItems: 4 + items: {} + - type: string + format: date-time + pattern: '^2020.*' + Number: + type: number + String: + type: string + Boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + ObjectWithDifficultlyNamedProps: + type: object + description: model with properties that have invalid names for python + properties: + '$special[property.name]': + type: integer + format: int64 + 123-list: + type: string + 123Number: + type: integer + readOnly: true + required: + - 123-list + _special_model.name_: + type: object + description: model with an invalid class name for python + properties: + a: + type: string + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + required: + - cultivar + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + required: + - lengthCm + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + enum: + - whale + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + enum: + - zebra + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + enum: + - BasquePig + required: + - className + DanishPig: + type: object + properties: + className: + type: string + enum: + - DanishPig + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + 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. + For a nullable composed schema to work, one of its chosen oneOf schemas must be type null + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + - type: null + discriminator: + propertyName: shapeType + nullable: true + TriangleInterface: + properties: + shapeType: + type: string + enum: + - 'Triangle' + triangleType: + type: string + required: + - shapeType + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'EquilateralTriangle' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'IsoscelesTriangle' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/TriangleInterface' + - type: object + properties: + triangleType: + type: string + enum: + - 'ScaleneTriangle' + QuadrilateralInterface: + properties: + shapeType: + type: string + enum: + - 'Quadrilateral' + quadrilateralType: + type: string + required: + - shapeType + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/QuadrilateralInterface' + - type: object + properties: + quadrilateralType: + type: string + enum: + - 'SimpleQuadrilateral' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/QuadrilateralInterface' + - type: object + properties: + quadrilateralType: + type: string + enum: + - 'ComplexQuadrilateral' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - type: object + properties: + name: + type: string + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/StringEnum' + AdditionalPropertiesWithArrayOfEnums: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/EnumClass' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + ObjectInterface: + type: object + ObjectWithValidations: + type: object + minProperties: 2 + SomeObject: + allOf: + - $ref: '#/components/schemas/ObjectInterface' +# TODO turn this back on later +# AnyType: +# description: this should allow any type because type was not specified + ArrayWithValidationsInItems: + type: array + maxItems: 2 + items: + type: integer + format: int64 + maximum: 7 + ArrayHoldingAnyType: + type: array + items: + description: any type can be stored here + DateWithValidations: + type: string + format: date + pattern: '^2020.*' + DateTimeWithValidations: + type: string + format: date-time + pattern: '^2020.*' + NoAdditionalProperties: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + required: + - id + additionalProperties: false + IntegerMax10: + type: integer + format: int64 + maximum: 10 + IntegerMin15: + type: integer + format: int64 + minimum: 15 + StringWithValidation: + type: string + minLength: 7 + Player: + type: object + description: a model that includes a self reference this forces properties and additionalProperties + to be lazy loaded in python models because the Player class has not fully loaded when defining + properties + properties: + name: + type: string + enemyPlayer: + $ref: '#/components/schemas/Player' + BooleanEnum: + type: boolean + enum: + - true + ComposedObject: + type: object + allOf: + - {} + ComposedNumber: + type: number + allOf: + - {} + ComposedString: + type: string + allOf: + - {} + ComposedBool: + type: boolean + allOf: + - {} + ComposedArray: + type: array + items: {} + allOf: + - {} + ComposedNone: + type: 'null' + allOf: + - {} diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-experimental/.gitignore new file mode 100644 index 00000000000..a62e8aba43f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.gitignore @@ -0,0 +1,67 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt +dev-requirements.txt.log + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml new file mode 100644 index 00000000000..611e425676e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml @@ -0,0 +1,24 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.tests: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=petstore_api + +test-3.5: + extends: .tests + image: python:3.5-alpine +test-3.6: + extends: .tests + image: python:3.6-alpine +test-3.7: + extends: .tests + image: python:3.7-alpine +test-3.8: + extends: .tests + image: python:3.8-alpine diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.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/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES new file mode 100644 index 00000000000..ad8d63e86a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -0,0 +1,262 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesWithArrayOfEnums.md +docs/Address.md +docs/Animal.md +docs/AnimalFarm.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayHoldingAnyType.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfEnums.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/ArrayWithValidationsInItems.md +docs/Banana.md +docs/BananaReq.md +docs/Bar.md +docs/BasquePig.md +docs/Boolean.md +docs/BooleanEnum.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/ComplexQuadrilateralAllOf.md +docs/ComposedAnyOfDifferentTypesNoValidations.md +docs/ComposedArray.md +docs/ComposedBool.md +docs/ComposedNone.md +docs/ComposedNumber.md +docs/ComposedObject.md +docs/ComposedOneOfDifferentTypes.md +docs/ComposedString.md +docs/DanishPig.md +docs/DateTimeTest.md +docs/DateTimeWithValidations.md +docs/DateWithValidations.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/EquilateralTriangleAllOf.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.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/InlineResponseDefault.md +docs/IntegerEnum.md +docs/IntegerEnumBig.md +docs/IntegerEnumOneValue.md +docs/IntegerEnumWithDefaultValue.md +docs/IntegerMax10.md +docs/IntegerMin15.md +docs/IsoscelesTriangle.md +docs/IsoscelesTriangleAllOf.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NoAdditionalProperties.md +docs/NullableClass.md +docs/NullableShape.md +docs/NullableString.md +docs/Number.md +docs/NumberOnly.md +docs/NumberWithValidations.md +docs/ObjectInterface.md +docs/ObjectModelWithRefProps.md +docs/ObjectWithDifficultlyNamedProps.md +docs/ObjectWithValidations.md +docs/Order.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/Player.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/ScaleneTriangleAllOf.md +docs/Shape.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SimpleQuadrilateralAllOf.md +docs/SomeObject.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/String.md +docs/StringBooleanMap.md +docs/StringEnum.md +docs/StringEnumWithDefaultValue.md +docs/StringWithValidation.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 +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/default_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +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/additional_properties_with_array_of_enums.py +petstore_api/model/address.py +petstore_api/model/animal.py +petstore_api/model/animal_farm.py +petstore_api/model/api_response.py +petstore_api/model/apple.py +petstore_api/model/apple_req.py +petstore_api/model/array_holding_any_type.py +petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_enums.py +petstore_api/model/array_of_number_only.py +petstore_api/model/array_test.py +petstore_api/model/array_with_validations_in_items.py +petstore_api/model/banana.py +petstore_api/model/banana_req.py +petstore_api/model/bar.py +petstore_api/model/basque_pig.py +petstore_api/model/boolean.py +petstore_api/model/boolean_enum.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/complex_quadrilateral_all_of.py +petstore_api/model/composed_any_of_different_types_no_validations.py +petstore_api/model/composed_array.py +petstore_api/model/composed_bool.py +petstore_api/model/composed_none.py +petstore_api/model/composed_number.py +petstore_api/model/composed_object.py +petstore_api/model/composed_one_of_different_types.py +petstore_api/model/composed_string.py +petstore_api/model/danish_pig.py +petstore_api/model/date_time_test.py +petstore_api/model/date_time_with_validations.py +petstore_api/model/date_with_validations.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/equilateral_triangle_all_of.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_response_default.py +petstore_api/model/integer_enum.py +petstore_api/model/integer_enum_big.py +petstore_api/model/integer_enum_one_value.py +petstore_api/model/integer_enum_with_default_value.py +petstore_api/model/integer_max10.py +petstore_api/model/integer_min15.py +petstore_api/model/isosceles_triangle.py +petstore_api/model/isosceles_triangle_all_of.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/no_additional_properties.py +petstore_api/model/nullable_class.py +petstore_api/model/nullable_shape.py +petstore_api/model/nullable_string.py +petstore_api/model/number.py +petstore_api/model/number_only.py +petstore_api/model/number_with_validations.py +petstore_api/model/object_interface.py +petstore_api/model/object_model_with_ref_props.py +petstore_api/model/object_with_difficultly_named_props.py +petstore_api/model/object_with_validations.py +petstore_api/model/order.py +petstore_api/model/parent_pet.py +petstore_api/model/pet.py +petstore_api/model/pig.py +petstore_api/model/player.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/scalene_triangle_all_of.py +petstore_api/model/shape.py +petstore_api/model/shape_or_null.py +petstore_api/model/simple_quadrilateral.py +petstore_api/model/simple_quadrilateral_all_of.py +petstore_api/model/some_object.py +petstore_api/model/special_model_name.py +petstore_api/model/string.py +petstore_api/model/string_boolean_map.py +petstore_api/model/string_enum.py +petstore_api/model/string_enum_with_default_value.py +petstore_api/model/string_with_validation.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/models/__init__.py +petstore_api/rest.py +petstore_api/schemas.py +petstore_api/signing.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml new file mode 100644 index 00000000000..f931f0f74b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-experimental/Makefile new file mode 100644 index 00000000000..863c380ebef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/Makefile @@ -0,0 +1,16 @@ +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python.sh \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md new file mode 100644 index 00000000000..5798de014b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -0,0 +1,320 @@ +# petstore-api +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonExperimentalClientCodegen + +## Requirements. + +Python >= 3.9 +v3.9 is needed so one can combine classmethod and property decorators to define +object schema properties as classes + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +import datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetimeimport datetime +import time +import petstore_api +from pprint import pprint +from petstore_api.api import another_fake_api +from petstore_api.model.client 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( + host = "http://petstore.swagger.io:80/v2" +) + + +# 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 = another_fake_api.AnotherFakeApi(api_client) + client = Client( + client="client_example", + ) # Client | client model + + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(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 + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums +*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums +*FakeApi* | [**body_with_file_schema**](docs/FakeApi.md#body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**body_with_query_params**](docs/FakeApi.md#body_with_query_params) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | +*FakeApi* | [**case_sensitive_params**](docs/FakeApi.md#case_sensitive_params) | **PUT** /fake/case-sensitive-params | +*FakeApi* | [**client_model**](docs/FakeApi.md#client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**composed_one_of_different_types**](docs/FakeApi.md#composed_one_of_different_types) | **POST** /fake/refs/composed_one_of_number_with_validations | +*FakeApi* | [**endpoint_parameters**](docs/FakeApi.md#endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**enum_parameters**](docs/FakeApi.md#enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**group_parameters**](docs/FakeApi.md#group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**inline_additional_properties**](docs/FakeApi.md#inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**json_form_data**](docs/FakeApi.md#json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal | +*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +*FakeApi* | [**parameter_collisions**](docs/FakeApi.md#parameter_collisions) | **POST** /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | parameter collision case +*FakeApi* | [**query_parameter_collection_format**](docs/FakeApi.md#query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | +*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | +*FakeApi* | [**upload_download_file**](docs/FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream +*FakeApi* | [**upload_file**](docs/FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data +*FakeApi* | [**upload_files**](docs/FakeApi.md#upload_files) | **POST** /fake/uploadFiles | uploads files using multipart/form-data +*FakeClassnameTags123Api* | [**classname**](docs/FakeClassnameTags123Api.md#classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*PetApi* | [**upload_image**](docs/PetApi.md#upload_image) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) + - [Address](docs/Address.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayHoldingAnyType](docs/ArrayHoldingAnyType.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfEnums](docs/ArrayOfEnums.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [ArrayWithValidationsInItems](docs/ArrayWithValidationsInItems.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [Bar](docs/Bar.md) + - [BasquePig](docs/BasquePig.md) + - [Boolean](docs/Boolean.md) + - [BooleanEnum](docs/BooleanEnum.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) + - [ComplexQuadrilateralAllOf](docs/ComplexQuadrilateralAllOf.md) + - [ComposedAnyOfDifferentTypesNoValidations](docs/ComposedAnyOfDifferentTypesNoValidations.md) + - [ComposedArray](docs/ComposedArray.md) + - [ComposedBool](docs/ComposedBool.md) + - [ComposedNone](docs/ComposedNone.md) + - [ComposedNumber](docs/ComposedNumber.md) + - [ComposedObject](docs/ComposedObject.md) + - [ComposedOneOfDifferentTypes](docs/ComposedOneOfDifferentTypes.md) + - [ComposedString](docs/ComposedString.md) + - [DanishPig](docs/DanishPig.md) + - [DateTimeTest](docs/DateTimeTest.md) + - [DateTimeWithValidations](docs/DateTimeWithValidations.md) + - [DateWithValidations](docs/DateWithValidations.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) + - [EquilateralTriangleAllOf](docs/EquilateralTriangleAllOf.md) + - [File](docs/File.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) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [IntegerEnum](docs/IntegerEnum.md) + - [IntegerEnumBig](docs/IntegerEnumBig.md) + - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) + - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) + - [IntegerMax10](docs/IntegerMax10.md) + - [IntegerMin15](docs/IntegerMin15.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [IsoscelesTriangleAllOf](docs/IsoscelesTriangleAllOf.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NoAdditionalProperties](docs/NoAdditionalProperties.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NullableString](docs/NullableString.md) + - [Number](docs/Number.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectInterface](docs/ObjectInterface.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [ObjectWithDifficultlyNamedProps](docs/ObjectWithDifficultlyNamedProps.md) + - [ObjectWithValidations](docs/ObjectWithValidations.md) + - [Order](docs/Order.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Player](docs/Player.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [ScaleneTriangleAllOf](docs/ScaleneTriangleAllOf.md) + - [Shape](docs/Shape.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SimpleQuadrilateralAllOf](docs/SimpleQuadrilateralAllOf.md) + - [SomeObject](docs/SomeObject.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [String](docs/String.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) + - [StringWithValidation](docs/StringWithValidation.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 + + +## 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**: Bearer authentication (JWT) + + +## http_basic_test + +- **Type**: HTTP basic authentication + + +## http_signature_test + +- **Type**: HTTP signature authentication + + Authentication schemes defined for the API: +## 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 + + +## Author + + + + + + + + + +## 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/dev-requirements.txt b/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt new file mode 100644 index 00000000000..ccdfca62949 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..cf88f5b25d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -0,0 +1,17 @@ +# AdditionalPropertiesClass + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **{str: (str,)}** | | [optional] +**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] +**anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] +**map_with_undeclared_properties_anytype_1** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**map_with_undeclared_properties_anytype_2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**map_with_undeclared_properties_anytype_3** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**empty_map** | **bool, date, datetime, dict, float, int, list, str** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**map_with_undeclared_properties_string** | **{str: (str,)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md new file mode 100644 index 00000000000..81d4ee55401 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md @@ -0,0 +1,9 @@ +# AdditionalPropertiesWithArrayOfEnums + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **[EnumClass]** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Address.md b/samples/openapi3/client/petstore/python-experimental/docs/Address.md new file mode 100644 index 00000000000..a6060817c8c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Address.md @@ -0,0 +1,9 @@ +# Address + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **int** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md new file mode 100644 index 00000000000..8d43981dc82 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **str** | | +**color** | **str** | | [optional] if omitted the server will use the default value of "red" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md new file mode 100644 index 00000000000..04db36a075c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md @@ -0,0 +1,8 @@ +# AnimalFarm + +Type | Description | Notes +------------- | ------------- | ------------- +**[Animal]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..6ec2e771f86 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -0,0 +1,94 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + +# **call_123_test_special_tags** +> Client call_123_test_special_tags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```python +import petstore_api +from petstore_api.api import another_fake_api +from petstore_api.model.client 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = another_fake_api.AnotherFakeApi(api_client) + + # example passing only required values which don't have defaults set + body = Client( + client="client_example", + ) + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Client**](Client.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Client**](Client.md) | | + + + +[**Client**](Client.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md new file mode 100644 index 00000000000..6206bcbe611 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Apple.md b/samples/openapi3/client/petstore/python-experimental/docs/Apple.md new file mode 100644 index 00000000000..93f59b3a2e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Apple.md @@ -0,0 +1,11 @@ +# Apple + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **str** | | +**origin** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md b/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md new file mode 100644 index 00000000000..1dde25261bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md @@ -0,0 +1,10 @@ +# AppleReq + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **str** | | +**mealy** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayHoldingAnyType.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayHoldingAnyType.md new file mode 100644 index 00000000000..db0bfa793a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayHoldingAnyType.md @@ -0,0 +1,8 @@ +# ArrayHoldingAnyType + +Type | Description | Notes +------------- | ------------- | ------------- +**[bool, date, datetime, dict, float, int, list, str, none_type]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..5b5c89bfd66 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | **[[int, float]]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md new file mode 100644 index 00000000000..ce8778c78f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md @@ -0,0 +1,8 @@ +# ArrayOfEnums + +Type | Description | Notes +------------- | ------------- | ------------- +**[StringEnum]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..2fa514a7865 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | **[int, float]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md new file mode 100644 index 00000000000..b84215f20ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **[str]** | | [optional] +**array_array_of_integer** | **[[int]]** | | [optional] +**array_array_of_model** | **[[ReadOnlyFirst]]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayWithValidationsInItems.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayWithValidationsInItems.md new file mode 100644 index 00000000000..d19d241bfed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayWithValidationsInItems.md @@ -0,0 +1,8 @@ +# ArrayWithValidationsInItems + +Type | Description | Notes +------------- | ------------- | ------------- +**[int]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Banana.md b/samples/openapi3/client/petstore/python-experimental/docs/Banana.md new file mode 100644 index 00000000000..11b9e97a5c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Banana.md @@ -0,0 +1,10 @@ +# Banana + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lengthCm** | **int, float** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md b/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md new file mode 100644 index 00000000000..68959cfbd6f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md @@ -0,0 +1,10 @@ +# BananaReq + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lengthCm** | **int, float** | | +**sweet** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Bar.md b/samples/openapi3/client/petstore/python-experimental/docs/Bar.md new file mode 100644 index 00000000000..f6e0141c5fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Bar.md @@ -0,0 +1,8 @@ +# Bar + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | defaults to "bar" + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md b/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md new file mode 100644 index 00000000000..76fa224a377 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md @@ -0,0 +1,10 @@ +# BasquePig + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Boolean.md b/samples/openapi3/client/petstore/python-experimental/docs/Boolean.md new file mode 100644 index 00000000000..9e64a63c8ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Boolean.md @@ -0,0 +1,8 @@ +# Boolean + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BooleanEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/BooleanEnum.md new file mode 100644 index 00000000000..1235414f1e3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/BooleanEnum.md @@ -0,0 +1,8 @@ +# BooleanEnum + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | must be one of [True, ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md new file mode 100644 index 00000000000..a9f4f6ecdae --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **str** | | [optional] +**CapitalCamel** | **str** | | [optional] +**small_Snake** | **str** | | [optional] +**Capital_Snake** | **str** | | [optional] +**SCA_ETH_Flow_Points** | **str** | | [optional] +**ATT_NAME** | **str** | Name of the pet | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md new file mode 100644 index 00000000000..a6d67ac8019 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -0,0 +1,9 @@ +# Cat + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md new file mode 100644 index 00000000000..f2a9f7d35b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# CatAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md new file mode 100644 index 00000000000..a847da44a13 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | if omitted the server will use the default value of "default-name" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md b/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md new file mode 100644 index 00000000000..08b6b3c1cbd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md @@ -0,0 +1,9 @@ +# ChildCat + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md new file mode 100644 index 00000000000..1e0f07a3628 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md @@ -0,0 +1,10 @@ +# ChildCatAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md new file mode 100644 index 00000000000..97d387878b3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -0,0 +1,12 @@ +# ClassModel + +Model for testing model with \"_class\" property + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md new file mode 100644 index 00000000000..7c0ad6e9734 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md new file mode 100644 index 00000000000..0c647b16895 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md @@ -0,0 +1,9 @@ +# ComplexQuadrilateral + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateralAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateralAllOf.md new file mode 100644 index 00000000000..d2cb47a3c42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateralAllOf.md @@ -0,0 +1,10 @@ +# ComplexQuadrilateralAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quadrilateralType** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedAnyOfDifferentTypesNoValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedAnyOfDifferentTypesNoValidations.md new file mode 100644 index 00000000000..3dad57b962a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedAnyOfDifferentTypesNoValidations.md @@ -0,0 +1,9 @@ +# ComposedAnyOfDifferentTypesNoValidations + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedArray.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedArray.md new file mode 100644 index 00000000000..6f0ebdc39e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedArray.md @@ -0,0 +1,8 @@ +# ComposedArray + +Type | Description | Notes +------------- | ------------- | ------------- +**[bool, date, datetime, dict, float, int, list, str, none_type]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedBool.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedBool.md new file mode 100644 index 00000000000..64ba095ebe4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedBool.md @@ -0,0 +1,8 @@ +# ComposedBool + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedNone.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedNone.md new file mode 100644 index 00000000000..f295563e704 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedNone.md @@ -0,0 +1,8 @@ +# ComposedNone + +Type | Description | Notes +------------- | ------------- | ------------- +**none_type** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedNumber.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedNumber.md new file mode 100644 index 00000000000..4c52af546f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedNumber.md @@ -0,0 +1,8 @@ +# ComposedNumber + +Type | Description | Notes +------------- | ------------- | ------------- +**float** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedObject.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedObject.md new file mode 100644 index 00000000000..3939050270d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedObject.md @@ -0,0 +1,9 @@ +# ComposedObject + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfDifferentTypes.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfDifferentTypes.md new file mode 100644 index 00000000000..59ed1efabc6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfDifferentTypes.md @@ -0,0 +1,11 @@ +# ComposedOneOfDifferentTypes + +this is a model that allows payloads of type object or number + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedString.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedString.md new file mode 100644 index 00000000000..37b16f50b4f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedString.md @@ -0,0 +1,8 @@ +# ComposedString + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md b/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md new file mode 100644 index 00000000000..f239dc97318 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md @@ -0,0 +1,10 @@ +# DanishPig + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DateTimeTest.md b/samples/openapi3/client/petstore/python-experimental/docs/DateTimeTest.md new file mode 100644 index 00000000000..408c95d0f9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DateTimeTest.md @@ -0,0 +1,8 @@ +# DateTimeTest + +Type | Description | Notes +------------- | ------------- | ------------- +**datetime** | | defaults to isoparse('2010-01-01T10:10:10.000111+01:00') + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DateTimeWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/DateTimeWithValidations.md new file mode 100644 index 00000000000..bb2e7e17e71 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DateTimeWithValidations.md @@ -0,0 +1,8 @@ +# DateTimeWithValidations + +Type | Description | Notes +------------- | ------------- | ------------- +**datetime** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DateWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/DateWithValidations.md new file mode 100644 index 00000000000..bce951bc5b5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DateWithValidations.md @@ -0,0 +1,8 @@ +# DateWithValidations + +Type | Description | Notes +------------- | ------------- | ------------- +**date** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md new file mode 100644 index 00000000000..768fca5bd47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -0,0 +1,70 @@ +# petstore_api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | + +# **foo_get** +> InlineResponseDefault foo_get() + + + +### Example + +```python +import petstore_api +from petstore_api.api import default_api +from petstore_api.model.inline_response_default import InlineResponseDefault +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = default_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.foo_get() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | ApiResponseForDefault | response + +#### ApiResponseForDefault +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor0ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor0ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**InlineResponseDefault**](InlineResponseDefault.md) | | + + + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md new file mode 100644 index 00000000000..851567bc58a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -0,0 +1,9 @@ +# Dog + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md new file mode 100644 index 00000000000..8dfd16400b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# DogAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md b/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md new file mode 100644 index 00000000000..e535601a731 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md @@ -0,0 +1,13 @@ +# Drawing + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mainShape** | [**Shape**](Shape.md) | | [optional] +**shapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**nullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**shapes** | **[Shape]** | | [optional] +**any string name** | **Fruit** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md new file mode 100644 index 00000000000..78ecdb677e4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **[str]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md new file mode 100644 index 00000000000..1399e59181d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -0,0 +1,8 @@ +# EnumClass + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md new file mode 100644 index 00000000000..e720f3bf92d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -0,0 +1,18 @@ +# EnumTest + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **str** | | [optional] +**enum_string_required** | **str** | | +**enum_integer** | **int** | | [optional] +**enum_number** | **int, float** | | [optional] +**stringEnum** | [**StringEnum**](StringEnum.md) | | [optional] +**IntegerEnum** | [**IntegerEnum**](IntegerEnum.md) | | [optional] +**StringEnumWithDefaultValue** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] +**IntegerEnumWithDefaultValue** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] +**IntegerEnumOneValue** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md new file mode 100644 index 00000000000..834bcb30fd6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md @@ -0,0 +1,9 @@ +# EquilateralTriangle + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangleAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangleAllOf.md new file mode 100644 index 00000000000..8e151789e01 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangleAllOf.md @@ -0,0 +1,10 @@ +# EquilateralTriangleAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triangleType** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md new file mode 100644 index 00000000000..45fdc4a5c1c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -0,0 +1,2604 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**additional_properties_with_array_of_enums**](FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums +[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +[**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums +[**body_with_file_schema**](FakeApi.md#body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**body_with_query_params**](FakeApi.md#body_with_query_params) | **PUT** /fake/body-with-query-params | +[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | +[**case_sensitive_params**](FakeApi.md#case_sensitive_params) | **PUT** /fake/case-sensitive-params | +[**client_model**](FakeApi.md#client_model) | **PATCH** /fake | To test \"client\" model +[**composed_one_of_different_types**](FakeApi.md#composed_one_of_different_types) | **POST** /fake/refs/composed_one_of_number_with_validations | +[**endpoint_parameters**](FakeApi.md#endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**enum_parameters**](FakeApi.md#enum_parameters) | **GET** /fake | To test enum parameters +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**group_parameters**](FakeApi.md#group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**inline_additional_properties**](FakeApi.md#inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**json_form_data**](FakeApi.md#json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**mammal**](FakeApi.md#mammal) | **POST** /fake/refs/mammal | +[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +[**parameter_collisions**](FakeApi.md#parameter_collisions) | **POST** /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ | parameter collision case +[**query_parameter_collection_format**](FakeApi.md#query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +[**string**](FakeApi.md#string) | **POST** /fake/refs/string | +[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | +[**upload_download_file**](FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream +[**upload_file**](FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data +[**upload_files**](FakeApi.md#upload_files) | **POST** /fake/uploadFiles | uploads files using multipart/form-data + +# **additional_properties_with_array_of_enums** +> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() + +Additional Properties with Array of Enums + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = AdditionalPropertiesWithArrayOfEnums( + key=[ + EnumClass("-efg"), + ], + ) + try: + # Additional Properties with Array of Enums + api_response = api_instance.additional_properties_with_array_of_enums( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Got object with additional properties with array of enums + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) | | + + + +[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **array_model** +> AnimalFarm array_model() + + + +Test serialization of ArrayModel + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.animal_farm import AnimalFarm +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = AnimalFarm([ + Animal(), + ]) + try: + api_response = api_instance.array_model( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->array_model: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnimalFarm**](AnimalFarm.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output model + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**AnimalFarm**](AnimalFarm.md) | | + + + +[**AnimalFarm**](AnimalFarm.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **array_of_enums** +> ArrayOfEnums array_of_enums() + +Array of Enums + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.array_of_enums import ArrayOfEnums +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = ArrayOfEnums([ + StringEnum("placed"), + ]) + try: + # Array of Enums + api_response = api_instance.array_of_enums( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->array_of_enums: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ArrayOfEnums**](ArrayOfEnums.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Got named array of enums + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ArrayOfEnums**](ArrayOfEnums.md) | | + + + +[**ArrayOfEnums**](ArrayOfEnums.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **body_with_file_schema** +> body_with_file_schema(file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = FileSchemaTestClass( + file=File( + source_uri="source_uri_example", + ), + files=[ + File( + source_uri="source_uri_example", + ), + ], + ) + try: + api_response = api_instance.body_with_file_schema( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->body_with_file_schema: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**FileSchemaTestClass**](FileSchemaTestClass.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **body_with_query_params** +> body_with_query_params(queryuser) + + + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.user 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'query': "query_example", + } + body = User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_prop_nullable=None, + ) + try: + api_response = api_instance.body_with_query_params( + query_params=query_params, + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->body_with_query_params: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +query_params | RequestQueryParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**User**](User.md) | | + + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query | QuerySchema | | + + +#### QuerySchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **boolean** +> bool boolean() + + + +Test serialization of outer boolean types + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = True + try: + api_response = api_instance.boolean( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->boolean: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output boolean + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + + +**bool** + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **case_sensitive_params** +> case_sensitive_params(some_varsome_var2some_var3) + + + +Ensures that original naming is used in endpoint params, that way we on't have collisions + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'someVar': "someVar_example", + 'SomeVar': "SomeVar_example", + 'some_var': "some_var_example", + } + try: + api_response = api_instance.case_sensitive_params( + query_params=query_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->case_sensitive_params: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +someVar | SomeVarSchema | | +SomeVar | SomeVarSchema | | +some_var | SomeVarSchema | | + + +#### SomeVarSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### SomeVarSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### SomeVarSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **client_model** +> Client client_model(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.client 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = Client( + client="client_example", + ) + try: + # To test \"client\" model + api_response = api_instance.client_model( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->client_model: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Client**](Client.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Client**](Client.md) | | + + + +[**Client**](Client.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **composed_one_of_different_types** +> ComposedOneOfDifferentTypes composed_one_of_different_types() + + + +Test serialization of object with $refed properties + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = ComposedOneOfDifferentTypes() + try: + api_response = api_instance.composed_one_of_different_types( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->composed_one_of_different_types: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ComposedOneOfDifferentTypes**](ComposedOneOfDifferentTypes.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output model + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ComposedOneOfDifferentTypes**](ComposedOneOfDifferentTypes.md) | | + + + +[**ComposedOneOfDifferentTypes**](ComposedOneOfDifferentTypes.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **endpoint_parameters** +> endpoint_parameters() + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +* Basic Authentication (http_basic_test): +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + integer=10, + int32=20, + int64=1, + number=32.1, + _float=3.14, + double=67.8, + string="a", + pattern_without_delimiter="AUR,rZ#UM/?R,Fp^l6$ARjbhJk C", + byte='YQ==', + binary=open('/path/to/file', 'rb'), + date=isoparse('1970-01-01').date(), + date_time=isoparse('2020-02-02T20:20:20.22222Z'), + password="password_example", + callback="callback_example", + ) + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_response = api_instance.endpoint_parameters( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->endpoint_parameters: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationXWwwFormUrlencoded + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**number** | **int, float** | None | +**float** | **int, float** | None | [optional] +**double** | **int, float** | None | +**string** | **str** | None | [optional] +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**binary** | **file_type** | None | [optional] +**date** | **date** | None | [optional] +**dateTime** | **datetime** | None | [optional] if omitted the server will use the default value of isoparse('2010-02-01T10:20:10.11111+01:00') +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid username supplied +404 | ApiResponseFor404 | User not found + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **enum_parameters** +> enum_parameters() + +To test enum parameters + +To test enum parameters + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + query_params = { + 'enum_query_string_array': [ + "$", + ], + 'enum_query_string': "-efg", + 'enum_query_integer': 1, + 'enum_query_double': 1.1, + } + header_params = { + 'enum_header_string_array': [ + "$", + ], + 'enum_header_string': "-efg", + } + body = dict( + enum_form_string_array=[ + "$", + ], + enum_form_string="-efg", + ) + try: + # To test enum parameters + api_response = api_instance.enum_parameters( + query_params=query_params, + header_params=header_params, + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->enum_parameters: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | +query_params | RequestQueryParams | | +header_params | RequestHeaderParams | | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationXWwwFormUrlencoded + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of "-efg" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +enum_query_string_array | EnumQueryStringArraySchema | | optional +enum_query_string | EnumQueryStringSchema | | optional +enum_query_integer | EnumQueryIntegerSchema | | optional +enum_query_double | EnumQueryDoubleSchema | | optional + + +#### EnumQueryStringArraySchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### EnumQueryStringSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] + +#### EnumQueryIntegerSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | must be one of [1, -2, ] + +#### EnumQueryDoubleSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int, float** | | must be one of [1.1, -1.2, ] + +### header_params +#### RequestHeaderParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +enum_header_string_array | EnumHeaderStringArraySchema | | optional +enum_header_string | EnumHeaderStringSchema | | optional + +#### EnumHeaderStringArraySchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### EnumHeaderStringSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid request +404 | ApiResponseFor404 | Not found + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_health_get** +> HealthCheckResult fake_health_get() + +Health check endpoint + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.health_check_result import HealthCheckResult +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | The instance started successfully + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**HealthCheckResult**](HealthCheckResult.md) | | + + + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **group_parameters** +> group_parameters(required_string_grouprequired_boolean_grouprequired_int64_group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +* Bearer (JWT) Authentication (bearer_test): +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearer_test +configuration = petstore_api.Configuration( + access_token = 'YOUR_BEARER_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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'required_string_group': 1, + 'required_int64_group': 1, + } + header_params = { + 'required_boolean_group': True, + } + try: + # Fake endpoint to test group parameters (optional) + api_response = api_instance.group_parameters( + query_params=query_params, + header_params=header_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->group_parameters: %s\n" % e) + + # example passing only optional values + query_params = { + 'required_string_group': 1, + 'required_int64_group': 1, + 'string_group': 1, + 'int64_group': 1, + } + header_params = { + 'required_boolean_group': True, + 'boolean_group': True, + } + try: + # Fake endpoint to test group parameters (optional) + api_response = api_instance.group_parameters( + query_params=query_params, + header_params=header_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->group_parameters: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +header_params | RequestHeaderParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +required_string_group | RequiredStringGroupSchema | | +required_int64_group | RequiredInt64GroupSchema | | +string_group | StringGroupSchema | | optional +int64_group | Int64GroupSchema | | optional + + +#### RequiredStringGroupSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +#### RequiredInt64GroupSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +#### StringGroupSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +#### Int64GroupSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### header_params +#### RequestHeaderParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +required_boolean_group | RequiredBooleanGroupSchema | | +boolean_group | BooleanGroupSchema | | optional + +#### RequiredBooleanGroupSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +#### BooleanGroupSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**bool** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Someting wrong + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **inline_additional_properties** +> inline_additional_properties(request_body) + +test inline additionalProperties + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = dict( + "key": "key_example", + ) + try: + # test inline additionalProperties + api_response = api_instance.inline_additional_properties( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->inline_additional_properties: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **str** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **json_form_data** +> json_form_data() + +test json serialization of form data + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + param="param_example", + param2="param2_example", + ) + try: + # test json serialization of form data + api_response = api_instance.json_form_data( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->json_form_data: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationXWwwFormUrlencoded + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **str** | field1 | +**param2** | **str** | field2 | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **mammal** +> Mammal mammal(mammal) + + + +Test serialization of mammals + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.mammal import Mammal +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = Mammal( + has_baleen=True, + has_teeth=True, + class_name="whale", + ) + try: + api_response = api_instance.mammal( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->mammal: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Mammal**](Mammal.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output mammal + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Mammal**](Mammal.md) | | + + + +[**Mammal**](Mammal.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **number_with_validations** +> NumberWithValidations number_with_validations() + + + +Test serialization of outer number types + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.number_with_validations import NumberWithValidations +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = NumberWithValidations(10) + try: + api_response = api_instance.number_with_validations( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->number_with_validations: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NumberWithValidations**](NumberWithValidations.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output number + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NumberWithValidations**](NumberWithValidations.md) | | + + + +[**NumberWithValidations**](NumberWithValidations.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **object_model_with_ref_props** +> ObjectModelWithRefProps object_model_with_ref_props() + + + +Test serialization of object with $refed properties + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = ObjectModelWithRefProps( + my_number=NumberWithValidations(10), + my_string="my_string_example", + my_boolean=True, + ) + try: + api_response = api_instance.object_model_with_ref_props( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output model + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) | | + + + +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **parameter_collisions** +> bool, date, datetime, dict, float, int, list, str, none_type parameter_collisions(_3a_b5ab2_self3a_b6) + +parameter collision case + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + query_params = { + } + cookie_params = { + } + header_params = { + } + try: + # parameter collision case + api_response = api_instance.parameter_collisions( + path_params=path_params, + query_params=query_params, + header_params=header_params, + cookie_params=cookie_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->parameter_collisions: %s\n" % e) + + # example passing only optional values + path_params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + query_params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + cookie_params = { + '1': "1_example", + 'aB': "aB_example", + 'Ab': "Ab_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + header_params = { + '1': "1_example", + 'aB': "aB_example", + 'self': "self_example", + 'A-B': "A-B_example", + } + body = None + try: + # parameter collision case + api_response = api_instance.parameter_collisions( + path_params=path_params, + query_params=query_params, + header_params=header_params, + cookie_params=cookie_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->parameter_collisions: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +query_params | RequestQueryParams | | +header_params | RequestHeaderParams | | +path_params | RequestPathParams | | +cookie_params | RequestCookieParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +typing.Union[dict, frozendict, str, date, datetime, int, float, bool, Decimal, None, list, tuple, bytes] | | + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | Model1Schema | | optional +aB | ABSchema | | optional +Ab | AbSchema | | optional +self | ModelSelfSchema | | optional +A-B | ABSchema | | optional + + +#### Model1Schema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### AbSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ModelSelfSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### header_params +#### RequestHeaderParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | Model1Schema | | optional +aB | ABSchema | | optional +self | ModelSelfSchema | | optional +A-B | ABSchema | | optional + +#### Model1Schema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ModelSelfSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | Model1Schema | | +aB | ABSchema | | +Ab | AbSchema | | +self | ModelSelfSchema | | +A-B | ABSchema | | + +#### Model1Schema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### AbSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ModelSelfSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### cookie_params +#### RequestCookieParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +1 | Model1Schema | | optional +aB | ABSchema | | optional +Ab | AbSchema | | optional +self | ModelSelfSchema | | optional +A-B | ABSchema | | optional + +#### Model1Schema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### AbSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ModelSelfSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### ABSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +typing.Union[dict, frozendict, str, date, datetime, int, float, bool, Decimal, None, list, tuple, bytes] | | + + +**bool, date, datetime, dict, float, int, list, str, none_type** + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_parameter_collection_format** +> query_parameter_collection_format(pipeioutilhttpurlcontextref_param) + + + +To test the collection format in query parameters + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.string_with_validation import StringWithValidation +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'pipe': [ + "pipe_example", + ], + 'ioutil': [ + "ioutil_example", + ], + 'http': [ + "http_example", + ], + 'url': [ + "url_example", + ], + 'context': [ + "context_example", + ], + 'refParam': StringWithValidation("refParam_example"), + } + try: + api_response = api_instance.query_parameter_collection_format( + query_params=query_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->query_parameter_collection_format: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +pipe | PipeSchema | | +ioutil | IoutilSchema | | +http | HttpSchema | | +url | UrlSchema | | +context | ContextSchema | | +refParam | RefParamSchema | | + + +#### PipeSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### IoutilSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### HttpSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### UrlSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### ContextSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +#### RefParamSchema +Type | Description | Notes +------------- | ------------- | ------------- +[**StringWithValidation**](StringWithValidation.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Success + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **string** +> str string() + + + +Test serialization of outer string types + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = "body_example" + try: + api_response = api_instance.string( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->string: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output string + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + + +**str** + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **string_enum** +> StringEnum string_enum() + + + +Test serialization of outer enum + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.string_enum import StringEnum +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = StringEnum("placed") + try: + api_response = api_instance.string_enum( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->string_enum: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**StringEnum**](StringEnum.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Output enum + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**StringEnum**](StringEnum.md) | | + + + +[**StringEnum**](StringEnum.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_download_file** +> file_type upload_download_file(body) + +uploads a file and downloads a file using application/octet-stream + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + body = open('/path/to/file', 'rb') + try: + # uploads a file and downloads a file using application/octet-stream + api_response = api_instance.upload_download_file( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->upload_download_file: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationOctetStream] | required | +content_type | str | optional, default is 'application/octet-stream' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/octet-stream', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationOctetStream + +file to upload + +Type | Description | Notes +------------- | ------------- | ------------- +**file_type** | file to upload | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationOctetStream, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationOctetStream + +file to download + +Type | Description | Notes +------------- | ------------- | ------------- +**file_type** | file to download | + + +**file_type** + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file** +> ApiResponse upload_file() + +uploads a file using multipart/form-data + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.api_response import ApiResponse +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + additional_metadata="additional_metadata_example", + file=open('/path/to/file', 'rb'), + ) + try: + # uploads a file using multipart/form-data + api_response = api_instance.upload_file( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->upload_file: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyMultipartFormData + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **str** | Additional data to pass to server | [optional] +**file** | **file_type** | file to upload | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ApiResponse**](ApiResponse.md) | | + + + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_files** +> ApiResponse upload_files() + +uploads files using multipart/form-data + +### Example + +```python +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.api_response import ApiResponse +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = fake_api.FakeApi(api_client) + + # example passing only optional values + body = dict( + files=[ + open('/path/to/file', 'rb'), + ], + ) + try: + # uploads files using multipart/form-data + api_response = api_instance.upload_files( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->upload_files: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyMultipartFormData + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**files** | **[file_type]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ApiResponse**](ApiResponse.md) | | + + + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..6d5c732f70e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -0,0 +1,105 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**classname**](FakeClassnameTags123Api.md#classname) | **PATCH** /fake_classname_test | To test class name in snake case + +# **classname** +> Client classname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +* Api Key Authentication (api_key_query): +```python +import petstore_api +from petstore_api.api import fake_classname_tags_123_api +from petstore_api.model.client 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_query +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' +# 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 = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + + # example passing only required values which don't have defaults set + body = Client( + client="client_example", + ) + try: + # To test class name in snake case + api_response = api_instance.classname( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->classname: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Client**](Client.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Client**](Client.md) | | + + + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md new file mode 100644 index 00000000000..d541f9f0ab4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -0,0 +1,12 @@ +# File + +Must be named `File` for test. + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **str** | Test capitalization | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..e7bdc36bfd5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# FileSchemaTestClass + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] +**files** | **[File]** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md new file mode 100644 index 00000000000..e948b10caef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -0,0 +1,10 @@ +# Foo + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] if omitted the server will use the default value of "bar" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md new file mode 100644 index 00000000000..472216aa457 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -0,0 +1,30 @@ +# FormatTest + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int32withValidations** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **int, float** | | +**float** | **int, float** | this is a reserved python keyword | [optional] +**float32** | **int, float** | | [optional] +**double** | **int, float** | | [optional] +**float64** | **int, float** | | [optional] +**arrayWithUniqueItems** | **[int, float]** | | [optional] +**string** | **str** | | [optional] +**byte** | **str** | | +**binary** | **file_type** | | [optional] +**date** | **date** | | +**dateTime** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**uuidNoExample** | **str** | | [optional] +**password** | **str** | | +**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] +**noneProp** | **none_type** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md b/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md new file mode 100644 index 00000000000..42684ab7a15 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md @@ -0,0 +1,10 @@ +# Fruit + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md b/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md new file mode 100644 index 00000000000..eceb328ee61 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md @@ -0,0 +1,9 @@ +# FruitReq + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md b/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md new file mode 100644 index 00000000000..13879f26321 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md @@ -0,0 +1,10 @@ +# GmFruit + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md new file mode 100644 index 00000000000..ed51b572862 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md @@ -0,0 +1,10 @@ +# GrandparentAnimal + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet_type** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..14ac98c0769 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# HasOnlyReadOnly + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md new file mode 100644 index 00000000000..8ce835f39a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -0,0 +1,12 @@ +# 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** | **str, none_type** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..d28a65a74d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# InlineResponseDefault + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md new file mode 100644 index 00000000000..32d66541446 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md @@ -0,0 +1,8 @@ +# IntegerEnum + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | must be one of [0, 1, 2, ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumBig.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumBig.md new file mode 100644 index 00000000000..58d94b3102b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumBig.md @@ -0,0 +1,8 @@ +# IntegerEnumBig + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | must be one of [10, 11, 12, ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md new file mode 100644 index 00000000000..6fea6c1d441 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md @@ -0,0 +1,8 @@ +# IntegerEnumOneValue + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | must be one of [0, ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md new file mode 100644 index 00000000000..b95a839f9bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md @@ -0,0 +1,8 @@ +# IntegerEnumWithDefaultValue + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | defaults to 0, must be one of [0, 1, 2, ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerMax10.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerMax10.md new file mode 100644 index 00000000000..768902e0aca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerMax10.md @@ -0,0 +1,8 @@ +# IntegerMax10 + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerMin15.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerMin15.md new file mode 100644 index 00000000000..35043be2fad --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerMin15.md @@ -0,0 +1,8 @@ +# IntegerMin15 + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md new file mode 100644 index 00000000000..7891fd5aa74 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md @@ -0,0 +1,9 @@ +# IsoscelesTriangle + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangleAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangleAllOf.md new file mode 100644 index 00000000000..12881c0177a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangleAllOf.md @@ -0,0 +1,10 @@ +# IsoscelesTriangleAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triangleType** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md b/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md new file mode 100644 index 00000000000..6ecc91576e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md @@ -0,0 +1,9 @@ +# Mammal + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md new file mode 100644 index 00000000000..b842ca9985c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -0,0 +1,13 @@ +# MapTest + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_of_enum_string** | **{str: (str,)}** | | [optional] +**direct_map** | **{str: (bool,)}** | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..f8406a0af42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**dateTime** | **datetime** | | [optional] +**map** | **{str: (Animal,)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md new file mode 100644 index 00000000000..71af8e10447 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -0,0 +1,13 @@ +# Model200Response + +model with an invalid class name for python, starts with a number + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**class** | **str** | this is a reserved python keyword | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md new file mode 100644 index 00000000000..35abb51e239 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -0,0 +1,12 @@ +# ModelReturn + +Model for testing reserved words + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**return** | **int** | this is a reserved python keyword | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md new file mode 100644 index 00000000000..446d314fbd1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -0,0 +1,14 @@ +# Name + +Model for testing model name same as property name + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**property** | **str** | this is a reserved python keyword | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NoAdditionalProperties.md b/samples/openapi3/client/petstore/python-experimental/docs/NoAdditionalProperties.md new file mode 100644 index 00000000000..e5bf9b9be8c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NoAdditionalProperties.md @@ -0,0 +1,10 @@ +# NoAdditionalProperties + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**petId** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md new file mode 100644 index 00000000000..5f2a1280eb2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -0,0 +1,21 @@ +# NullableClass + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer_prop** | **int, none_type** | | [optional] +**number_prop** | **int, float, none_type** | | [optional] +**boolean_prop** | **bool, none_type** | | [optional] +**string_prop** | **str, none_type** | | [optional] +**date_prop** | **date, none_type** | | [optional] +**datetime_prop** | **datetime, none_type** | | [optional] +**array_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type** | | [optional] +**array_and_items_nullable_prop** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type], none_type** | | [optional] +**array_items_nullable** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type]** | | [optional] +**object_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}, none_type** | | [optional] +**object_and_items_nullable_prop** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}, none_type** | | [optional] +**object_items_nullable** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type)}** | | [optional] +**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md new file mode 100644 index 00000000000..1419c735f3c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md @@ -0,0 +1,11 @@ +# 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. For a nullable composed schema to work, one of its chosen oneOf schemas must be type null + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableString.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableString.md new file mode 100644 index 00000000000..c01cb806783 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableString.md @@ -0,0 +1,8 @@ +# NullableString + +Type | Description | Notes +------------- | ------------- | ------------- +typing.Union[str, None, ] | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Number.md b/samples/openapi3/client/petstore/python-experimental/docs/Number.md new file mode 100644 index 00000000000..63e3c42fdbd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Number.md @@ -0,0 +1,8 @@ +# Number + +Type | Description | Notes +------------- | ------------- | ------------- +**float** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md new file mode 100644 index 00000000000..699674314e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | **int, float** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md new file mode 100644 index 00000000000..9fe4c99f8d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -0,0 +1,8 @@ +# NumberWithValidations + +Type | Description | Notes +------------- | ------------- | ------------- +**float** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectInterface.md new file mode 100644 index 00000000000..1ce1b34d41d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectInterface.md @@ -0,0 +1,9 @@ +# ObjectInterface + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md new file mode 100644 index 00000000000..637175bc2f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -0,0 +1,14 @@ +# ObjectModelWithRefProps + +a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] +**myString** | **str** | | [optional] +**myBoolean** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDifficultlyNamedProps.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDifficultlyNamedProps.md new file mode 100644 index 00000000000..cb45c6b10ef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDifficultlyNamedProps.md @@ -0,0 +1,14 @@ +# ObjectWithDifficultlyNamedProps + +model with properties that have invalid names for python + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**$special[property.name]** | **int** | | [optional] +**123-list** | **str** | | +**123Number** | **int** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithValidations.md new file mode 100644 index 00000000000..3950d2ab95e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithValidations.md @@ -0,0 +1,9 @@ +# ObjectWithValidations + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md new file mode 100644 index 00000000000..374172ad32c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md b/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md new file mode 100644 index 00000000000..28a57b84fea --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md @@ -0,0 +1,9 @@ +# ParentPet + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md new file mode 100644 index 00000000000..8eec44141d5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -0,0 +1,17 @@ +# Pet + +Pet object that needs to be added to the store + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **str** | | +**photoUrls** | **[str]** | | +**tags** | **[Tag]** | | [optional] +**status** | **str** | pet status in the store | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md new file mode 100644 index 00000000000..9bcb8308070 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -0,0 +1,1362 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[**upload_image**](PetApi.md#upload_image) | **POST** /pet/{petId}/uploadImage | uploads an image + +# **add_pet** +> add_pet(pet) + +Add a new pet to the store + +Add a new pet to the store + +### Example + +* OAuth Authentication (petstore_auth): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP message signature: http_signature_test +# The HTTP Signature Header mechanism that can be used by a client to +# authenticate the sender of a message and ensure that particular headers +# have not been modified in transit. +# +# You can specify the signing key-id, private key path, signing scheme, +# signing algorithm, list of signed headers and signature max validity. +# The 'key_id' parameter is an opaque string that the API server can use +# to lookup the client and validate the signature. +# The 'private_key_path' parameter should be the path to a file that +# contains a DER or base-64 encoded private key. +# The 'private_key_passphrase' parameter is optional. Set the passphrase +# if the private key is encrypted. +# The 'signed_headers' parameter is used to specify the list of +# HTTP headers included when generating the signature for the message. +# You can specify HTTP headers that you want to protect with a cryptographic +# signature. Note that proxies may add, modify or remove HTTP headers +# for legitimate reasons, so you should only add headers that you know +# will not be modified. For example, if you want to protect the HTTP request +# body, you can specify the Digest header. In that case, the client calculates +# the digest of the HTTP request body and includes the digest in the message +# signature. +# The 'signature_max_validity' parameter is optional. It is configured as a +# duration to express when the signature ceases to be valid. The client calculates +# the expiration date every time it generates the cryptographic signature +# of an HTTP request. The API server may have its own security policy +# that controls the maximum validity of the signature. The client max validity +# must be lower than the server max validity. +# The time on the client and server must be synchronized, otherwise the +# server may reject the client signature. +# +# The client must use a combination of private key, signing scheme, +# signing algorithm and hash algorithm that matches the security policy of +# the API server. +# +# See petstore_api.signing for a list of all supported parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'private_key.pem', + private_key_passphrase = 'YOUR_PASSPHRASE', + signing_scheme = petstore_api.signing.SCHEME_HS2019, + signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, + hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, + signed_headers = [ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + body = Pet( + id=1, + category=Category( + id=1, + name="default-name", + ), + name="doggie", + photo_urls=[ + "photo_urls_example", + ], + tags=[ + Tag( + id=1, + name="name_example", + ), + ], + status="available", + ) + try: + # Add a new pet to the store + api_response = api_instance.add_pet( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyApplicationXml] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +host_index | typing.Optional[int] | default is None | Allows one to select a different host +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Pet**](Pet.md) | | + + +#### SchemaForRequestBodyApplicationXml +Type | Description | Notes +------------- | ------------- | ------------- +[**Pet**](Pet.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | Ok +405 | ApiResponseFor405 | Invalid input + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor405 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pet** +> delete_pet(pet_id) + +Deletes a pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'petId': 1, + } + header_params = { + } + try: + # Deletes a pet + api_response = api_instance.delete_pet( + path_params=path_params, + header_params=header_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + header_params = { + 'api_key': "api_key_example", + } + try: + # Deletes a pet + api_response = api_instance.delete_pet( + path_params=path_params, + header_params=header_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +header_params | RequestHeaderParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### header_params +#### RequestHeaderParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +api_key | ApiKeySchema | | optional + +#### ApiKeySchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | PetIdSchema | | + +#### PetIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid pet value + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_status** +> [Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +* OAuth Authentication (petstore_auth): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP message signature: http_signature_test +# The HTTP Signature Header mechanism that can be used by a client to +# authenticate the sender of a message and ensure that particular headers +# have not been modified in transit. +# +# You can specify the signing key-id, private key path, signing scheme, +# signing algorithm, list of signed headers and signature max validity. +# The 'key_id' parameter is an opaque string that the API server can use +# to lookup the client and validate the signature. +# The 'private_key_path' parameter should be the path to a file that +# contains a DER or base-64 encoded private key. +# The 'private_key_passphrase' parameter is optional. Set the passphrase +# if the private key is encrypted. +# The 'signed_headers' parameter is used to specify the list of +# HTTP headers included when generating the signature for the message. +# You can specify HTTP headers that you want to protect with a cryptographic +# signature. Note that proxies may add, modify or remove HTTP headers +# for legitimate reasons, so you should only add headers that you know +# will not be modified. For example, if you want to protect the HTTP request +# body, you can specify the Digest header. In that case, the client calculates +# the digest of the HTTP request body and includes the digest in the message +# signature. +# The 'signature_max_validity' parameter is optional. It is configured as a +# duration to express when the signature ceases to be valid. The client calculates +# the expiration date every time it generates the cryptographic signature +# of an HTTP request. The API server may have its own security policy +# that controls the maximum validity of the signature. The client max validity +# must be lower than the server max validity. +# The time on the client and server must be synchronized, otherwise the +# server may reject the client signature. +# +# The client must use a combination of private key, signing scheme, +# signing algorithm and hash algorithm that matches the security policy of +# the API server. +# +# See petstore_api.signing for a list of all supported parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'private_key.pem', + private_key_passphrase = 'YOUR_PASSPHRASE', + signing_scheme = petstore_api.signing.SCHEME_HS2019, + signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, + hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, + signed_headers = [ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'status': [ + "available", + ], + } + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +status | StatusSchema | | + + +#### StatusSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid status value + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationXml + +Type | Description | Notes +------------- | ------------- | ------------- +**[Pet]** | | + +#### SchemaFor200ResponseBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**[Pet]** | | + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +[**[Pet]**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_tags** +> [Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +* OAuth Authentication (petstore_auth): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP message signature: http_signature_test +# The HTTP Signature Header mechanism that can be used by a client to +# authenticate the sender of a message and ensure that particular headers +# have not been modified in transit. +# +# You can specify the signing key-id, private key path, signing scheme, +# signing algorithm, list of signed headers and signature max validity. +# The 'key_id' parameter is an opaque string that the API server can use +# to lookup the client and validate the signature. +# The 'private_key_path' parameter should be the path to a file that +# contains a DER or base-64 encoded private key. +# The 'private_key_passphrase' parameter is optional. Set the passphrase +# if the private key is encrypted. +# The 'signed_headers' parameter is used to specify the list of +# HTTP headers included when generating the signature for the message. +# You can specify HTTP headers that you want to protect with a cryptographic +# signature. Note that proxies may add, modify or remove HTTP headers +# for legitimate reasons, so you should only add headers that you know +# will not be modified. For example, if you want to protect the HTTP request +# body, you can specify the Digest header. In that case, the client calculates +# the digest of the HTTP request body and includes the digest in the message +# signature. +# The 'signature_max_validity' parameter is optional. It is configured as a +# duration to express when the signature ceases to be valid. The client calculates +# the expiration date every time it generates the cryptographic signature +# of an HTTP request. The API server may have its own security policy +# that controls the maximum validity of the signature. The client max validity +# must be lower than the server max validity. +# The time on the client and server must be synchronized, otherwise the +# server may reject the client signature. +# +# The client must use a combination of private key, signing scheme, +# signing algorithm and hash algorithm that matches the security policy of +# the API server. +# +# See petstore_api.signing for a list of all supported parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'private_key.pem', + private_key_passphrase = 'YOUR_PASSPHRASE', + signing_scheme = petstore_api.signing.SCHEME_HS2019, + signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, + hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, + signed_headers = [ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'tags': [ + "tags_example", + ], + } + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +tags | TagsSchema | | + + +#### TagsSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**[str]** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid tag value + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationXml + +Type | Description | Notes +------------- | ------------- | ------------- +**[Pet]** | | + +#### SchemaFor200ResponseBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**[Pet]** | | + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +[**[Pet]**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +* Api Key Authentication (api_key): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' +# 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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'petId': 1, + } + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | PetIdSchema | | + +#### PetIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid ID supplied +404 | ApiResponseFor404 | Pet not found + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationXml +Type | Description | Notes +------------- | ------------- | ------------- +[**Pet**](Pet.md) | | + + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Pet**](Pet.md) | | + + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet** +> update_pet(pet) + +Update an existing pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.pet 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP message signature: http_signature_test +# The HTTP Signature Header mechanism that can be used by a client to +# authenticate the sender of a message and ensure that particular headers +# have not been modified in transit. +# +# You can specify the signing key-id, private key path, signing scheme, +# signing algorithm, list of signed headers and signature max validity. +# The 'key_id' parameter is an opaque string that the API server can use +# to lookup the client and validate the signature. +# The 'private_key_path' parameter should be the path to a file that +# contains a DER or base-64 encoded private key. +# The 'private_key_passphrase' parameter is optional. Set the passphrase +# if the private key is encrypted. +# The 'signed_headers' parameter is used to specify the list of +# HTTP headers included when generating the signature for the message. +# You can specify HTTP headers that you want to protect with a cryptographic +# signature. Note that proxies may add, modify or remove HTTP headers +# for legitimate reasons, so you should only add headers that you know +# will not be modified. For example, if you want to protect the HTTP request +# body, you can specify the Digest header. In that case, the client calculates +# the digest of the HTTP request body and includes the digest in the message +# signature. +# The 'signature_max_validity' parameter is optional. It is configured as a +# duration to express when the signature ceases to be valid. The client calculates +# the expiration date every time it generates the cryptographic signature +# of an HTTP request. The API server may have its own security policy +# that controls the maximum validity of the signature. The client max validity +# must be lower than the server max validity. +# The time on the client and server must be synchronized, otherwise the +# server may reject the client signature. +# +# The client must use a combination of private key, signing scheme, +# signing algorithm and hash algorithm that matches the security policy of +# the API server. +# +# See petstore_api.signing for a list of all supported parameters. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'private_key.pem', + private_key_passphrase = 'YOUR_PASSPHRASE', + signing_scheme = petstore_api.signing.SCHEME_HS2019, + signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, + hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256, + signed_headers = [ + petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + body = Pet( + id=1, + category=Category( + id=1, + name="default-name", + ), + name="doggie", + photo_urls=[ + "photo_urls_example", + ], + tags=[ + Tag( + id=1, + name="name_example", + ), + ], + status="available", + ) + try: + # Update an existing pet + api_response = api_instance.update_pet( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyApplicationXml] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +host_index | typing.Optional[int] | default is None | Allows one to select a different host +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Pet**](Pet.md) | | + + +#### SchemaForRequestBodyApplicationXml +Type | Description | Notes +------------- | ------------- | ------------- +[**Pet**](Pet.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid ID supplied +404 | ApiResponseFor404 | Pet not found +405 | ApiResponseFor405 | Validation exception + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor405 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet_with_form** +> update_pet_with_form(pet_id) + +Updates a pet in the store with form data + +### Example + +* OAuth Authentication (petstore_auth): +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'petId': 1, + } + try: + # Updates a pet in the store with form data + api_response = api_instance.update_pet_with_form( + path_params=path_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + body = dict( + name="name_example", + status="status_example", + ) + try: + # Updates a pet in the store with form data + api_response = api_instance.update_pet_with_form( + path_params=path_params, + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] | optional, default is unset | +path_params | RequestPathParams | | +content_type | str | optional, default is 'application/x-www-form-urlencoded' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationXWwwFormUrlencoded + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the pet | [optional] +**status** | **str** | Updated status of the pet | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | PetIdSchema | | + +#### PetIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +405 | ApiResponseFor405 | Invalid input + +#### ApiResponseFor405 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file_with_required_file** +> ApiResponse upload_file_with_required_file(pet_id) + +uploads an image (required) + +### Example + +* OAuth Authentication (petstore_auth): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.api_response import ApiResponse +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'petId': 1, + } + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + body = dict( + additional_metadata="additional_metadata_example", + required_file=open('/path/to/file', 'rb'), + ) + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file( + path_params=path_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | +path_params | RequestPathParams | | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyMultipartFormData + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **str** | Additional data to pass to server | [optional] +**requiredFile** | **file_type** | file to upload | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | PetIdSchema | | + +#### PetIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ApiResponse**](ApiResponse.md) | | + + + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_image** +> ApiResponse upload_image(pet_id) + +uploads an image + +### Example + +* OAuth Authentication (petstore_auth): +```python +import petstore_api +from petstore_api.api import pet_api +from petstore_api.model.api_response import ApiResponse +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) +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 = pet_api.PetApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'petId': 1, + } + try: + # uploads an image + api_response = api_instance.upload_image( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_image: %s\n" % e) + + # example passing only optional values + path_params = { + 'petId': 1, + } + body = dict( + additional_metadata="additional_metadata_example", + file=open('/path/to/file', 'rb'), + ) + try: + # uploads an image + api_response = api_instance.upload_image( + path_params=path_params, + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_image: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyMultipartFormData, Unset] | optional, default is unset | +path_params | RequestPathParams | | +content_type | str | optional, default is 'multipart/form-data' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyMultipartFormData + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **str** | Additional data to pass to server | [optional] +**file** | **file_type** | file to upload | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +petId | PetIdSchema | | + +#### PetIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ApiResponse**](ApiResponse.md) | | + + + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pig.md b/samples/openapi3/client/petstore/python-experimental/docs/Pig.md new file mode 100644 index 00000000000..97259b026f9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pig.md @@ -0,0 +1,9 @@ +# Pig + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Player.md b/samples/openapi3/client/petstore/python-experimental/docs/Player.md new file mode 100644 index 00000000000..2daf47240c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Player.md @@ -0,0 +1,13 @@ +# Player + +a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**enemyPlayer** | [**Player**](Player.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md new file mode 100644 index 00000000000..e840c9b8fd0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md @@ -0,0 +1,9 @@ +# Quadrilateral + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md new file mode 100644 index 00000000000..ee7c4db4ba4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md @@ -0,0 +1,11 @@ +# QuadrilateralInterface + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **str** | | +**quadrilateralType** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..a6c2e4524b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md new file mode 100644 index 00000000000..941e9e63117 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md @@ -0,0 +1,9 @@ +# ScaleneTriangle + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangleAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangleAllOf.md new file mode 100644 index 00000000000..3ac4ed16125 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangleAllOf.md @@ -0,0 +1,10 @@ +# ScaleneTriangleAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triangleType** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Shape.md b/samples/openapi3/client/petstore/python-experimental/docs/Shape.md new file mode 100644 index 00000000000..798438fbd2b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Shape.md @@ -0,0 +1,9 @@ +# Shape + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md new file mode 100644 index 00000000000..17fa7c50577 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md @@ -0,0 +1,11 @@ +# ShapeOrNull + +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md new file mode 100644 index 00000000000..d9ce2f02b01 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md @@ -0,0 +1,9 @@ +# SimpleQuadrilateral + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateralAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateralAllOf.md new file mode 100644 index 00000000000..e8bf2861915 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateralAllOf.md @@ -0,0 +1,10 @@ +# SimpleQuadrilateralAllOf + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quadrilateralType** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SomeObject.md b/samples/openapi3/client/petstore/python-experimental/docs/SomeObject.md new file mode 100644 index 00000000000..55a308e4f86 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SomeObject.md @@ -0,0 +1,9 @@ +# SomeObject + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md new file mode 100644 index 00000000000..8c02dca9ab3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -0,0 +1,12 @@ +# SpecialModelName + +model with an invalid class name for python + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**a** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md new file mode 100644 index 00000000000..80f9a368f5f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -0,0 +1,391 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = store_api.StoreApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'order_id': "order_id_example", + } + try: + # Delete purchase order by ID + api_response = api_instance.delete_order( + path_params=path_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +order_id | OrderIdSchema | | + +#### OrderIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid ID supplied +404 | ApiResponseFor404 | Order not found + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inventory** +> {str: (int,)} get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +* Api Key Authentication (api_key): +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' +# 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 = store_api.StoreApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationJson + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **int** | any string name can be used but the value must be the correct type | [optional] + + +**{str: (int,)}** + +### Authorization + +[api_key](../README.md#api_key) + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```python +import petstore_api +from petstore_api.api import store_api +from petstore_api.model.order 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = store_api.StoreApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'order_id': 1, + } + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +order_id | OrderIdSchema | | + +#### OrderIdSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid ID supplied +404 | ApiResponseFor404 | Order not found + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationXml +Type | Description | Notes +------------- | ------------- | ------------- +[**Order**](Order.md) | | + + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Order**](Order.md) | | + + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +[**Order**](Order.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **place_order** +> Order place_order(order) + +Place an order for a pet + +### Example + +```python +import petstore_api +from petstore_api.api import store_api +from petstore_api.model.order 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = store_api.StoreApi(api_client) + + # example passing only required values which don't have defaults set + body = Order( + id=1, + pet_id=1, + quantity=1, + ship_date=isoparse('2020-02-02T20:20:20.000222Z'), + status="placed", + complete=False, + ) + try: + # Place an order for a pet + api_response = api_instance.place_order( + body=body, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Order**](Order.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid Order + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationXml +Type | Description | Notes +------------- | ------------- | ------------- +[**Order**](Order.md) | | + + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Order**](Order.md) | | + + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +[**Order**](Order.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/String.md b/samples/openapi3/client/petstore/python-experimental/docs/String.md new file mode 100644 index 00000000000..ca058fd710b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/String.md @@ -0,0 +1,8 @@ +# String + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md new file mode 100644 index 00000000000..89b85004e97 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ +# StringBooleanMap + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md new file mode 100644 index 00000000000..bf610d10285 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md @@ -0,0 +1,10 @@ +# StringEnum + +Type | Description | Notes +------------- | ------------- | ------------- +typing.Union[str, None, ] | | must be one of ["placed", "approved", "delivered", "single quoted", '''multiple +lines''', '''double quote + with newline''', ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md new file mode 100644 index 00000000000..08a337a5264 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md @@ -0,0 +1,8 @@ +# StringEnumWithDefaultValue + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | defaults to "placed", must be one of ["placed", "approved", "delivered", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringWithValidation.md b/samples/openapi3/client/petstore/python-experimental/docs/StringWithValidation.md new file mode 100644 index 00000000000..870752b1df8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringWithValidation.md @@ -0,0 +1,8 @@ +# StringWithValidation + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md new file mode 100644 index 00000000000..42cf6ecbc85 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md b/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md new file mode 100644 index 00000000000..0820ec390f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md @@ -0,0 +1,9 @@ +# Triangle + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md new file mode 100644 index 00000000000..11c7c8e4541 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md @@ -0,0 +1,11 @@ +# TriangleInterface + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **str** | | +**triangleType** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md new file mode 100644 index 00000000000..cfff38a6269 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -0,0 +1,21 @@ +# User + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**firstName** | **str** | | [optional] +**lastName** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**userStatus** | **int** | User Status | [optional] +**objectWithNoDeclaredProps** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**objectWithNoDeclaredPropsNullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**anyTypeProp** | **bool, date, datetime, dict, float, int, list, str, none_type** | 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** | **bool, date, datetime, dict, float, int, list, str, none_type** | 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] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md new file mode 100644 index 00000000000..0e77fad4125 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -0,0 +1,784 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + +# **create_user** +> create_user(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```python +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + body = User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_prop_nullable=None, + ) + try: + # Create user + api_response = api_instance.create_user( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**User**](User.md) | | + + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | ApiResponseForDefault | successful operation + +#### ApiResponseForDefault +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_array_input** +> create_users_with_array_input(user) + +Creates list of users with given input array + +### Example + +```python +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + body = [ + User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_prop_nullable=None, + ), + ] + try: + # Creates list of users with given input array + api_response = api_instance.create_users_with_array_input( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**[User]** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | ApiResponseForDefault | successful operation + +#### ApiResponseForDefault +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_list_input** +> create_users_with_list_input(user) + +Creates list of users with given input array + +### Example + +```python +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + body = [ + User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_prop_nullable=None, + ), + ] + try: + # Creates list of users with given input array + api_response = api_instance.create_users_with_list_input( + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**[User]** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | ApiResponseForDefault | successful operation + +#### ApiResponseForDefault +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'username': "username_example", + } + try: + # Delete user + api_response = api_instance.delete_user( + path_params=path_params, + ) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | UsernameSchema | | + +#### UsernameSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid username supplied +404 | ApiResponseFor404 | User not found + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + +### Example + +```python +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'username': "username_example", + } + try: + # Get user by user name + api_response = api_instance.get_user_by_name( + path_params=path_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | UsernameSchema | | + +#### UsernameSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid username supplied +404 | ApiResponseFor404 | User not found + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +#### SchemaFor200ResponseBodyApplicationXml +Type | Description | Notes +------------- | ------------- | ------------- +[**User**](User.md) | | + + +#### SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**User**](User.md) | | + + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +[**User**](User.md) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **login_user** +> str login_user(usernamepassword) + +Logs user into the system + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'username': "username_example", + 'password': "password_example", + } + try: + # Logs user into the system + api_response = api_instance.login_user( + query_params=query_params, + ) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +accept_content_types | typing.Tuple[str] | default is ('application/xml', 'application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | UsernameSchema | | +password | PasswordSchema | | + + +#### UsernameSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### PasswordSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | ApiResponseFor200 | successful operation +400 | ApiResponseFor400 | Invalid username/password supplied + +#### ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationXml, SchemaFor200ResponseBodyApplicationJson, ] | | +headers | ResponseHeadersFor200 | | + +#### SchemaFor200ResponseBodyApplicationXml + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +#### SchemaFor200ResponseBodyApplicationJson + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | +#### ResponseHeadersFor200 + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +X-Rate-Limit | XRateLimitSchema | | optional +X-Expires-After | XExpiresAfterSchema | | optional + +#### XRateLimitSchema + +calls per hour allowed by the user + +Type | Description | Notes +------------- | ------------- | ------------- +**int** | calls per hour allowed by the user | + +#### XExpiresAfterSchema + +date in UTC when token expires + +Type | Description | Notes +------------- | ------------- | ------------- +**datetime** | date in UTC when token expires | + + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +**str** + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example + +```python +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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Logs out current logged in user session + api_response = api_instance.logout_user() + except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +default | ApiResponseForDefault | successful operation + +#### ApiResponseForDefault +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> update_user(usernameuser) + +Updated user + +This can only be done by the logged in user. + +### Example + +```python +import petstore_api +from petstore_api.api import user_api +from petstore_api.model.user 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. +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) + +# 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 = user_api.UserApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'username': "username_example", + } + body = User( + id=1, + username="username_example", + first_name="first_name_example", + last_name="last_name_example", + email="email_example", + password="password_example", + phone="phone_example", + user_status=1, + object_with_no_declared_props=dict(), + object_with_no_declared_props_nullable=dict(), + any_type_prop=None, + any_type_prop_nullable=None, + ) + try: + # Updated user + api_response = api_instance.update_user( + path_params=path_params, + body=body, + ) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +path_params | RequestPathParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +#### SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**User**](User.md) | | + + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +username | UsernameSchema | | + +#### UsernameSchema + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +400 | ApiResponseFor400 | Invalid user supplied +404 | ApiResponseFor404 | User not found + +#### ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + + +void (empty response body) + +### Authorization + +No authorization required + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Whale.md b/samples/openapi3/client/petstore/python-experimental/docs/Whale.md new file mode 100644 index 00000000000..f0b2dbc51ef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Whale.md @@ -0,0 +1,12 @@ +# Whale + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasBaleen** | **bool** | | [optional] +**hasTeeth** | **bool** | | [optional] +**className** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md b/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md new file mode 100644 index 00000000000..ae12668a3a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md @@ -0,0 +1,11 @@ +# Zebra + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**className** | **str** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-experimental/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/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/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py new file mode 100644 index 00000000000..26b0467759d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -0,0 +1,31 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +__version__ = "1.0.0" + +# import ApiClient +from petstore_api.api_client import ApiClient + +# import Configuration +from petstore_api.configuration import Configuration +from petstore_api.signing import HttpSigningConfiguration + +# 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__('sys').setrecursionlimit(1234) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py new file mode 100644 index 00000000000..840e9f0cd90 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -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 apis from one package, import them with +# from petstore_api.apis import AnotherFakeApi 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 new file mode 100644 index 00000000000..a6e0483cf68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -0,0 +1,25 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.another_fake_api_endpoints.call_123_test_special_tags import Call123TestSpecialTags + + +class AnotherFakeApi( + Call123TestSpecialTags, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py new file mode 100644 index 00000000000..b9733311046 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client + + +request_body_client = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/another-fake/dummy' +_method = 'PATCH' +SchemaFor200ResponseBodyApplicationJson = Client + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class Call123TestSpecialTags(api_client.Api): + + def call_123_test_special_tags( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + To test special tags + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_client.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response 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 new file mode 100644 index 00000000000..28b822701b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -0,0 +1,25 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.default_api_endpoints.foo_get import FooGet + + +class DefaultApi( + FooGet, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py new file mode 100644 index 00000000000..b704f12197a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.inline_response_default import InlineResponseDefault + +_path = '/foo' +_method = 'GET' +SchemaFor0ResponseBodyApplicationJson = InlineResponseDefault + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor0ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor0ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + 'default': _response_for_default, +} +_all_accept_content_types = ( + 'application/json', +) + + +class FooGet(api_client.Api): + + def foo_get( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response 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 new file mode 100644 index 00000000000..7a81465ef0f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -0,0 +1,73 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.fake_api_endpoints.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +from petstore_api.api.fake_api_endpoints.array_model import ArrayModel +from petstore_api.api.fake_api_endpoints.array_of_enums import ArrayOfEnums +from petstore_api.api.fake_api_endpoints.body_with_file_schema import BodyWithFileSchema +from petstore_api.api.fake_api_endpoints.body_with_query_params import BodyWithQueryParams +from petstore_api.api.fake_api_endpoints.boolean import Boolean +from petstore_api.api.fake_api_endpoints.case_sensitive_params import CaseSensitiveParams +from petstore_api.api.fake_api_endpoints.client_model import ClientModel +from petstore_api.api.fake_api_endpoints.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.api.fake_api_endpoints.endpoint_parameters import EndpointParameters +from petstore_api.api.fake_api_endpoints.enum_parameters import EnumParameters +from petstore_api.api.fake_api_endpoints.fake_health_get import FakeHealthGet +from petstore_api.api.fake_api_endpoints.group_parameters import GroupParameters +from petstore_api.api.fake_api_endpoints.inline_additional_properties import InlineAdditionalProperties +from petstore_api.api.fake_api_endpoints.json_form_data import JsonFormData +from petstore_api.api.fake_api_endpoints.mammal import Mammal +from petstore_api.api.fake_api_endpoints.number_with_validations import NumberWithValidations +from petstore_api.api.fake_api_endpoints.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.api.fake_api_endpoints.parameter_collisions import ParameterCollisions +from petstore_api.api.fake_api_endpoints.query_parameter_collection_format import QueryParameterCollectionFormat +from petstore_api.api.fake_api_endpoints.string import String +from petstore_api.api.fake_api_endpoints.string_enum import StringEnum +from petstore_api.api.fake_api_endpoints.upload_download_file import UploadDownloadFile +from petstore_api.api.fake_api_endpoints.upload_file import UploadFile +from petstore_api.api.fake_api_endpoints.upload_files import UploadFiles + + +class FakeApi( + AdditionalPropertiesWithArrayOfEnums, + ArrayModel, + ArrayOfEnums, + BodyWithFileSchema, + BodyWithQueryParams, + Boolean, + CaseSensitiveParams, + ClientModel, + ComposedOneOfDifferentTypes, + EndpointParameters, + EnumParameters, + FakeHealthGet, + GroupParameters, + InlineAdditionalProperties, + JsonFormData, + Mammal, + NumberWithValidations, + ObjectModelWithRefProps, + ParameterCollisions, + QueryParameterCollectionFormat, + String, + StringEnum, + UploadDownloadFile, + UploadFile, + UploadFiles, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py new file mode 100644 index 00000000000..f0d07f51205 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums + +# body param +SchemaForRequestBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums + + +request_body_additional_properties_with_array_of_enums = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/additional-properties-with-array-of-enums' +_method = 'GET' +SchemaFor200ResponseBodyApplicationJson = AdditionalPropertiesWithArrayOfEnums + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class AdditionalPropertiesWithArrayOfEnums(api_client.Api): + + def additional_properties_with_array_of_enums( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Additional Properties with Array of Enums + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_additional_properties_with_array_of_enums.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py new file mode 100644 index 00000000000..9c44cbce507 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.animal_farm import AnimalFarm + +# body param +SchemaForRequestBodyApplicationJson = AnimalFarm + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/arraymodel' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = AnimalFarm + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class ArrayModel(api_client.Api): + + def array_model( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py new file mode 100644 index 00000000000..83af2ce00ca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.array_of_enums import ArrayOfEnums + +# body param +SchemaForRequestBodyApplicationJson = ArrayOfEnums + + +request_body_array_of_enums = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/array-of-enums' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = ArrayOfEnums + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class ArrayOfEnums(api_client.Api): + + def array_of_enums( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Array of Enums + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_array_of_enums.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py new file mode 100644 index 00000000000..c46e584ab42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.file_schema_test_class import FileSchemaTestClass + +# body param +SchemaForRequestBodyApplicationJson = FileSchemaTestClass + + +request_body_file_schema_test_class = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake/body-with-file-schema' +_method = 'PUT' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BodyWithFileSchema(api_client.Api): + + def body_with_file_schema( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_file_schema_test_class.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py new file mode 100644 index 00000000000..a99f338d61b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.user import User + +# query params +QuerySchema = StrSchema +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'query': QuerySchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_query = api_client.QueryParameter( + name="query", + style=api_client.ParameterStyle.FORM, + schema=QuerySchema, + required=True, + explode=True, +) +# body param +SchemaForRequestBodyApplicationJson = User + + +request_body_user = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake/body-with-query-params' +_method = 'PUT' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BodyWithQueryParams(api_client.Api): + + def body_with_query_params( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + query_params: RequestQueryParams = frozendict(), + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_query, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_user.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py new file mode 100644 index 00000000000..49566ef541d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = BoolSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/boolean' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = BoolSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class Boolean(api_client.Api): + + def boolean( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py new file mode 100644 index 00000000000..ac4d37279eb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# query params +SomeVarSchema = StrSchema +SomeVarSchema = StrSchema +SomeVarSchema = StrSchema +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'someVar': SomeVarSchema, + 'SomeVar': SomeVarSchema, + 'some_var': SomeVarSchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_some_var = api_client.QueryParameter( + name="someVar", + style=api_client.ParameterStyle.FORM, + schema=SomeVarSchema, + required=True, + explode=True, +) +request_query_some_var2 = api_client.QueryParameter( + name="SomeVar", + style=api_client.ParameterStyle.FORM, + schema=SomeVarSchema, + required=True, + explode=True, +) +request_query_some_var3 = api_client.QueryParameter( + name="some_var", + style=api_client.ParameterStyle.FORM, + schema=SomeVarSchema, + required=True, + explode=True, +) +_path = '/fake/case-sensitive-params' +_method = 'PUT' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class CaseSensitiveParams(api_client.Api): + + def case_sensitive_params( + self: api_client.Api, + query_params: RequestQueryParams = frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_some_var, + request_query_some_var2, + request_query_some_var3, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py new file mode 100644 index 00000000000..d1812acdfb6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client + + +request_body_client = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake' +_method = 'PATCH' +SchemaFor200ResponseBodyApplicationJson = Client + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class ClientModel(api_client.Api): + + def client_model( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + To test \"client\" model + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_client.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py new file mode 100644 index 00000000000..7f3ecf42045 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes + +# body param +SchemaForRequestBodyApplicationJson = ComposedOneOfDifferentTypes + + +request_body_composed_one_of_different_types = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/composed_one_of_number_with_validations' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = ComposedOneOfDifferentTypes + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class ComposedOneOfDifferentTypes(api_client.Api): + + def composed_one_of_different_types( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_composed_one_of_different_types.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py new file mode 100644 index 00000000000..63faaf2db9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + DictSchema +): + _required_property_names = set(( + )) + + + class integer( + _SchemaValidator( + inclusive_maximum=100, + inclusive_minimum=10, + ), + IntSchema + ): + pass + + + class int32( + _SchemaValidator( + inclusive_maximum=200, + inclusive_minimum=20, + ), + Int32Schema + ): + pass + int64 = Int64Schema + + + class number( + _SchemaValidator( + inclusive_maximum=543.2, + inclusive_minimum=32.1, + ), + NumberSchema + ): + pass + + + class _float( + _SchemaValidator( + inclusive_maximum=987.6, + ), + Float32Schema + ): + pass + locals()['float'] = _float + del locals()['_float'] + + + class double( + _SchemaValidator( + inclusive_maximum=123.4, + inclusive_minimum=67.8, + ), + Float64Schema + ): + pass + + + class string( + _SchemaValidator( + regex=[{ + 'pattern': r'[a-z]', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }], + ), + StrSchema + ): + pass + + + class pattern_without_delimiter( + _SchemaValidator( + regex=[{ + 'pattern': r'^[A-Z].*', # noqa: E501 + }], + ), + StrSchema + ): + pass + byte = StrSchema + binary = BinarySchema + date = DateSchema + dateTime = DateTimeSchema + + + class password( + _SchemaValidator( + max_length=64, + min_length=10, + ), + StrSchema + ): + pass + callback = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + integer: typing.Union[integer, Unset] = unset, + int32: typing.Union[int32, Unset] = unset, + int64: typing.Union[int64, Unset] = unset, + string: typing.Union[string, Unset] = unset, + binary: typing.Union[binary, Unset] = unset, + date: typing.Union[date, Unset] = unset, + dateTime: typing.Union[dateTime, Unset] = unset, + password: typing.Union[password, Unset] = unset, + callback: typing.Union[callback, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + integer=integer, + int32=int32, + int64=int64, + string=string, + binary=binary, + date=date, + dateTime=dateTime, + password=password, + callback=callback, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), + }, +) +_path = '/fake' +_method = 'POST' +_auth = [ + 'http_basic_test', +] + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '400': _response_for_400, + '404': _response_for_404, +} + + +class EndpointParameters(api_client.Api): + + def endpoint_parameters( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] = unset, + content_type: str = 'application/x-www-form-urlencoded', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py new file mode 100644 index 00000000000..7d8e080429d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py @@ -0,0 +1,480 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# query params + + +class EnumQueryStringArraySchema( + ListSchema +): + + + class _items( + _SchemaEnumMaker( + enum_value_to_name={ + ">": "GREATER_THAN", + "$": "DOLLAR", + } + ), + StrSchema + ): + + @classmethod + @property + def GREATER_THAN(cls): + return cls._enum_by_value[">"](">") + + @classmethod + @property + def DOLLAR(cls): + return cls._enum_by_value["$"]("$") + + +class EnumQueryStringSchema( + _SchemaEnumMaker( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + StrSchema +): + + @classmethod + @property + def _ABC(cls): + return cls._enum_by_value["_abc"]("_abc") + + @classmethod + @property + def EFG(cls): + return cls._enum_by_value["-efg"]("-efg") + + @classmethod + @property + def XYZ(cls): + return cls._enum_by_value["(xyz)"]("(xyz)") + + +class EnumQueryIntegerSchema( + _SchemaEnumMaker( + enum_value_to_name={ + 1: "POSITIVE_1", + -2: "NEGATIVE_2", + } + ), + Int32Schema +): + + @classmethod + @property + def POSITIVE_1(cls): + return cls._enum_by_value[1](1) + + @classmethod + @property + def NEGATIVE_2(cls): + return cls._enum_by_value[-2](-2) + + +class EnumQueryDoubleSchema( + _SchemaEnumMaker( + enum_value_to_name={ + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + ), + Float64Schema +): + + @classmethod + @property + def POSITIVE_1_PT_1(cls): + return cls._enum_by_value[1.1](1.1) + + @classmethod + @property + def NEGATIVE_1_PT_2(cls): + return cls._enum_by_value[-1.2](-1.2) +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + 'enum_query_string_array': EnumQueryStringArraySchema, + 'enum_query_string': EnumQueryStringSchema, + 'enum_query_integer': EnumQueryIntegerSchema, + 'enum_query_double': EnumQueryDoubleSchema, + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_enum_query_string_array = api_client.QueryParameter( + name="enum_query_string_array", + style=api_client.ParameterStyle.FORM, + schema=EnumQueryStringArraySchema, + explode=True, +) +request_query_enum_query_string = api_client.QueryParameter( + name="enum_query_string", + style=api_client.ParameterStyle.FORM, + schema=EnumQueryStringSchema, + explode=True, +) +request_query_enum_query_integer = api_client.QueryParameter( + name="enum_query_integer", + style=api_client.ParameterStyle.FORM, + schema=EnumQueryIntegerSchema, + explode=True, +) +request_query_enum_query_double = api_client.QueryParameter( + name="enum_query_double", + style=api_client.ParameterStyle.FORM, + schema=EnumQueryDoubleSchema, + explode=True, +) +# header params + + +class EnumHeaderStringArraySchema( + ListSchema +): + + + class _items( + _SchemaEnumMaker( + enum_value_to_name={ + ">": "GREATER_THAN", + "$": "DOLLAR", + } + ), + StrSchema + ): + + @classmethod + @property + def GREATER_THAN(cls): + return cls._enum_by_value[">"](">") + + @classmethod + @property + def DOLLAR(cls): + return cls._enum_by_value["$"]("$") + + +class EnumHeaderStringSchema( + _SchemaEnumMaker( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + StrSchema +): + + @classmethod + @property + def _ABC(cls): + return cls._enum_by_value["_abc"]("_abc") + + @classmethod + @property + def EFG(cls): + return cls._enum_by_value["-efg"]("-efg") + + @classmethod + @property + def XYZ(cls): + return cls._enum_by_value["(xyz)"]("(xyz)") +RequestRequiredHeaderParams = typing.TypedDict( + 'RequestRequiredHeaderParams', + { + } +) +RequestOptionalHeaderParams = typing.TypedDict( + 'RequestOptionalHeaderParams', + { + 'enum_header_string_array': EnumHeaderStringArraySchema, + 'enum_header_string': EnumHeaderStringSchema, + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +request_header_enum_header_string_array = api_client.HeaderParameter( + name="enum_header_string_array", + style=api_client.ParameterStyle.SIMPLE, + schema=EnumHeaderStringArraySchema, +) +request_header_enum_header_string = api_client.HeaderParameter( + name="enum_header_string", + style=api_client.ParameterStyle.SIMPLE, + schema=EnumHeaderStringSchema, +) +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + DictSchema +): + + + class enum_form_string_array( + ListSchema + ): + + + class _items( + _SchemaEnumMaker( + enum_value_to_name={ + ">": "GREATER_THAN", + "$": "DOLLAR", + } + ), + StrSchema + ): + + @classmethod + @property + def GREATER_THAN(cls): + return cls._enum_by_value[">"](">") + + @classmethod + @property + def DOLLAR(cls): + return cls._enum_by_value["$"]("$") + + + class enum_form_string( + _SchemaEnumMaker( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + StrSchema + ): + + @classmethod + @property + def _ABC(cls): + return cls._enum_by_value["_abc"]("_abc") + + @classmethod + @property + def EFG(cls): + return cls._enum_by_value["-efg"]("-efg") + + @classmethod + @property + def XYZ(cls): + return cls._enum_by_value["(xyz)"]("(xyz)") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + enum_form_string_array: typing.Union[enum_form_string_array, Unset] = unset, + enum_form_string: typing.Union[enum_form_string, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + enum_form_string_array=enum_form_string_array, + enum_form_string=enum_form_string, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), + }, +) +_path = '/fake' +_method = 'GET' + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '400': _response_for_400, + '404': _response_for_404, +} + + +class EnumParameters(api_client.Api): + + def enum_parameters( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] = unset, + query_params: RequestQueryParams = frozendict(), + header_params: RequestHeaderParams = frozendict(), + content_type: str = 'application/x-www-form-urlencoded', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + To test enum parameters + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + self._verify_typed_dict_inputs(RequestHeaderParams, header_params) + + _query_params = [] + for parameter in ( + request_query_enum_query_string_array, + request_query_enum_query_string, + request_query_enum_query_integer, + request_query_enum_query_double, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_enum_header_string_array, + request_header_enum_header_string, + ): + parameter_data = header_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py new file mode 100644 index 00000000000..831241cba68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.health_check_result import HealthCheckResult + +_path = '/fake/health' +_method = 'GET' +SchemaFor200ResponseBodyApplicationJson = HealthCheckResult + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class FakeHealthGet(api_client.Api): + + def fake_health_get( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Health check endpoint + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py new file mode 100644 index 00000000000..dc590cb9137 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# query params +RequiredStringGroupSchema = IntSchema +RequiredInt64GroupSchema = Int64Schema +StringGroupSchema = IntSchema +Int64GroupSchema = Int64Schema +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'required_string_group': RequiredStringGroupSchema, + 'required_int64_group': RequiredInt64GroupSchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + 'string_group': StringGroupSchema, + 'int64_group': Int64GroupSchema, + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_required_string_group = api_client.QueryParameter( + name="required_string_group", + style=api_client.ParameterStyle.FORM, + schema=RequiredStringGroupSchema, + required=True, + explode=True, +) +request_query_required_int64_group = api_client.QueryParameter( + name="required_int64_group", + style=api_client.ParameterStyle.FORM, + schema=RequiredInt64GroupSchema, + required=True, + explode=True, +) +request_query_string_group = api_client.QueryParameter( + name="string_group", + style=api_client.ParameterStyle.FORM, + schema=StringGroupSchema, + explode=True, +) +request_query_int64_group = api_client.QueryParameter( + name="int64_group", + style=api_client.ParameterStyle.FORM, + schema=Int64GroupSchema, + explode=True, +) +# header params +RequiredBooleanGroupSchema = BoolSchema +BooleanGroupSchema = BoolSchema +RequestRequiredHeaderParams = typing.TypedDict( + 'RequestRequiredHeaderParams', + { + 'required_boolean_group': RequiredBooleanGroupSchema, + } +) +RequestOptionalHeaderParams = typing.TypedDict( + 'RequestOptionalHeaderParams', + { + 'boolean_group': BooleanGroupSchema, + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +request_header_required_boolean_group = api_client.HeaderParameter( + name="required_boolean_group", + style=api_client.ParameterStyle.SIMPLE, + schema=RequiredBooleanGroupSchema, + required=True, +) +request_header_boolean_group = api_client.HeaderParameter( + name="boolean_group", + style=api_client.ParameterStyle.SIMPLE, + schema=BooleanGroupSchema, +) +_path = '/fake' +_method = 'DELETE' +_auth = [ + 'bearer_test', +] + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) +_status_code_to_response = { + '400': _response_for_400, +} + + +class GroupParameters(api_client.Api): + + def group_parameters( + self: api_client.Api, + query_params: RequestQueryParams = frozendict(), + header_params: RequestHeaderParams = frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Fake endpoint to test group parameters (optional) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + self._verify_typed_dict_inputs(RequestHeaderParams, header_params) + + _query_params = [] + for parameter in ( + request_query_required_string_group, + request_query_required_int64_group, + request_query_string_group, + request_query_int64_group, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_required_boolean_group, + request_header_boolean_group, + ): + parameter_data = header_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py new file mode 100644 index 00000000000..0acc3f4491e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationJson( + DictSchema +): + _additional_properties = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_request_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake/inline-additionalProperties' +_method = 'POST' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class InlineAdditionalProperties(api_client.Api): + + def inline_additional_properties( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + test inline additionalProperties + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_request_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py new file mode 100644 index 00000000000..591f9417e3b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + DictSchema +): + _required_property_names = set(( + )) + param = StrSchema + param2 = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), + }, +) +_path = '/fake/jsonFormData' +_method = 'GET' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class JsonFormData(api_client.Api): + + def json_form_data( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] = unset, + content_type: str = 'application/x-www-form-urlencoded', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + test json serialization of form data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py new file mode 100644 index 00000000000..4b402d4e961 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.mammal import Mammal + +# body param +SchemaForRequestBodyApplicationJson = Mammal + + +request_body_mammal = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake/refs/mammal' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = Mammal + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class Mammal(api_client.Api): + + def mammal( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_mammal.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py new file mode 100644 index 00000000000..ac82ec1bca5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.number_with_validations import NumberWithValidations + +# body param +SchemaForRequestBodyApplicationJson = NumberWithValidations + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/number' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = NumberWithValidations + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class NumberWithValidations(api_client.Api): + + def number_with_validations( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py new file mode 100644 index 00000000000..aaa919ec758 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + +# body param +SchemaForRequestBodyApplicationJson = ObjectModelWithRefProps + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/object_model_with_ref_props' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = ObjectModelWithRefProps + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class ObjectModelWithRefProps(api_client.Api): + + def object_model_with_ref_props( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py new file mode 100644 index 00000000000..c355d0e1183 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py @@ -0,0 +1,425 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# query params +Model1Schema = StrSchema +ABSchema = StrSchema +AbSchema = StrSchema +ModelSelfSchema = StrSchema +ABSchema = StrSchema +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + '1': Model1Schema, + 'aB': ABSchema, + 'Ab': AbSchema, + 'self': ModelSelfSchema, + 'A-B': ABSchema, + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query__1 = api_client.QueryParameter( + name="1", + style=api_client.ParameterStyle.FORM, + schema=Model1Schema, + explode=True, +) +request_query_a_b = api_client.QueryParameter( + name="aB", + style=api_client.ParameterStyle.FORM, + schema=ABSchema, + explode=True, +) +request_query_ab = api_client.QueryParameter( + name="Ab", + style=api_client.ParameterStyle.FORM, + schema=AbSchema, + explode=True, +) +request_query__self = api_client.QueryParameter( + name="self", + style=api_client.ParameterStyle.FORM, + schema=ModelSelfSchema, + explode=True, +) +request_query_a_b2 = api_client.QueryParameter( + name="A-B", + style=api_client.ParameterStyle.FORM, + schema=ABSchema, + explode=True, +) +# header params +Model1Schema = StrSchema +ABSchema = StrSchema +ModelSelfSchema = StrSchema +ABSchema = StrSchema +RequestRequiredHeaderParams = typing.TypedDict( + 'RequestRequiredHeaderParams', + { + } +) +RequestOptionalHeaderParams = typing.TypedDict( + 'RequestOptionalHeaderParams', + { + '1': Model1Schema, + 'aB': ABSchema, + 'self': ModelSelfSchema, + 'A-B': ABSchema, + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +request_header__2 = api_client.HeaderParameter( + name="1", + style=api_client.ParameterStyle.SIMPLE, + schema=Model1Schema, +) +request_header_a_b3 = api_client.HeaderParameter( + name="aB", + style=api_client.ParameterStyle.SIMPLE, + schema=ABSchema, +) +request_header__self2 = api_client.HeaderParameter( + name="self", + style=api_client.ParameterStyle.SIMPLE, + schema=ModelSelfSchema, +) +request_header_a_b4 = api_client.HeaderParameter( + name="A-B", + style=api_client.ParameterStyle.SIMPLE, + schema=ABSchema, +) +# path params +Model1Schema = StrSchema +ABSchema = StrSchema +AbSchema = StrSchema +ModelSelfSchema = StrSchema +ABSchema = StrSchema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + '1': Model1Schema, + 'aB': ABSchema, + 'Ab': AbSchema, + 'self': ModelSelfSchema, + 'A-B': ABSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path__3 = api_client.PathParameter( + name="1", + style=api_client.ParameterStyle.SIMPLE, + schema=Model1Schema, + required=True, +) +request_path_a_b5 = api_client.PathParameter( + name="aB", + style=api_client.ParameterStyle.SIMPLE, + schema=ABSchema, + required=True, +) +request_path_ab2 = api_client.PathParameter( + name="Ab", + style=api_client.ParameterStyle.SIMPLE, + schema=AbSchema, + required=True, +) +request_path__self3 = api_client.PathParameter( + name="self", + style=api_client.ParameterStyle.SIMPLE, + schema=ModelSelfSchema, + required=True, +) +request_path_a_b6 = api_client.PathParameter( + name="A-B", + style=api_client.ParameterStyle.SIMPLE, + schema=ABSchema, + required=True, +) +# cookie params +Model1Schema = StrSchema +ABSchema = StrSchema +AbSchema = StrSchema +ModelSelfSchema = StrSchema +ABSchema = StrSchema +RequestRequiredCookieParams = typing.TypedDict( + 'RequestRequiredCookieParams', + { + } +) +RequestOptionalCookieParams = typing.TypedDict( + 'RequestOptionalCookieParams', + { + '1': Model1Schema, + 'aB': ABSchema, + 'Ab': AbSchema, + 'self': ModelSelfSchema, + 'A-B': ABSchema, + }, + total=False +) + + +class RequestCookieParams(RequestRequiredCookieParams, RequestOptionalCookieParams): + pass + + +request_cookie__4 = api_client.CookieParameter( + name="1", + style=api_client.ParameterStyle.FORM, + schema=Model1Schema, + explode=True, +) +request_cookie_a_b7 = api_client.CookieParameter( + name="aB", + style=api_client.ParameterStyle.FORM, + schema=ABSchema, + explode=True, +) +request_cookie_ab3 = api_client.CookieParameter( + name="Ab", + style=api_client.ParameterStyle.FORM, + schema=AbSchema, + explode=True, +) +request_cookie__self4 = api_client.CookieParameter( + name="self", + style=api_client.ParameterStyle.FORM, + schema=ModelSelfSchema, + explode=True, +) +request_cookie_a_b8 = api_client.CookieParameter( + name="A-B", + style=api_client.ParameterStyle.FORM, + schema=ABSchema, + explode=True, +) +# body param +SchemaForRequestBodyApplicationJson = AnyTypeSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = AnyTypeSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class ParameterCollisions(api_client.Api): + + def parameter_collisions( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + query_params: RequestQueryParams = frozendict(), + header_params: RequestHeaderParams = frozendict(), + path_params: RequestPathParams = frozendict(), + cookie_params: RequestCookieParams = frozendict(), + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + parameter collision case + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + self._verify_typed_dict_inputs(RequestHeaderParams, header_params) + self._verify_typed_dict_inputs(RequestPathParams, path_params) + self._verify_typed_dict_inputs(RequestCookieParams, cookie_params) + + _path_params = {} + for parameter in ( + request_path__3, + request_path_a_b5, + request_path_ab2, + request_path__self3, + request_path_a_b6, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _query_params = [] + for parameter in ( + request_query__1, + request_query_a_b, + request_query_ab, + request_query__self, + request_query_a_b2, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header__2, + request_header_a_b3, + request_header__self2, + request_header_a_b4, + ): + parameter_data = header_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + query_params=tuple(_query_params), + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py new file mode 100644 index 00000000000..14076fea22b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.string_with_validation import StringWithValidation + +# query params + + +class PipeSchema( + ListSchema +): + _items = StrSchema + + +class IoutilSchema( + ListSchema +): + _items = StrSchema + + +class HttpSchema( + ListSchema +): + _items = StrSchema + + +class UrlSchema( + ListSchema +): + _items = StrSchema + + +class ContextSchema( + ListSchema +): + _items = StrSchema +RefParamSchema = StringWithValidation +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'pipe': PipeSchema, + 'ioutil': IoutilSchema, + 'http': HttpSchema, + 'url': UrlSchema, + 'context': ContextSchema, + 'refParam': RefParamSchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_pipe = api_client.QueryParameter( + name="pipe", + style=api_client.ParameterStyle.FORM, + schema=PipeSchema, + required=True, + explode=True, +) +request_query_ioutil = api_client.QueryParameter( + name="ioutil", + style=api_client.ParameterStyle.FORM, + schema=IoutilSchema, + required=True, +) +request_query_http = api_client.QueryParameter( + name="http", + style=api_client.ParameterStyle.SPACE_DELIMITED, + schema=HttpSchema, + required=True, +) +request_query_url = api_client.QueryParameter( + name="url", + style=api_client.ParameterStyle.FORM, + schema=UrlSchema, + required=True, +) +request_query_context = api_client.QueryParameter( + name="context", + style=api_client.ParameterStyle.FORM, + schema=ContextSchema, + required=True, + explode=True, +) +request_query_ref_param = api_client.QueryParameter( + name="refParam", + style=api_client.ParameterStyle.FORM, + schema=RefParamSchema, + required=True, + explode=True, +) +_path = '/fake/test-query-paramters' +_method = 'PUT' + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class QueryParameterCollectionFormat(api_client.Api): + + def query_parameter_collection_format( + self: api_client.Api, + query_params: RequestQueryParams = frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_pipe, + request_query_ioutil, + request_query_http, + request_query_url, + request_query_context, + request_query_ref_param, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py new file mode 100644 index 00000000000..000d30c64ef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationJson = StrSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/string' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = StrSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class String(api_client.Api): + + def string( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py new file mode 100644 index 00000000000..51c9bd862e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.string_enum import StringEnum + +# body param +SchemaForRequestBodyApplicationJson = StringEnum + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_path = '/fake/refs/enum' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = StringEnum + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class StringEnum(api_client.Api): + + def string_enum( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, Unset] = unset, + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py new file mode 100644 index 00000000000..87fa4f8dbcc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# body param +SchemaForRequestBodyApplicationOctetStream = BinarySchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/octet-stream': api_client.MediaType( + schema=SchemaForRequestBodyApplicationOctetStream), + }, + required=True, +) +_path = '/fake/uploadDownloadFile' +_method = 'POST' +SchemaFor200ResponseBodyApplicationOctetStream = BinarySchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationOctetStream, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/octet-stream': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationOctetStream), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/octet-stream', +) + + +class UploadDownloadFile(api_client.Api): + + def upload_download_file( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationOctetStream], + content_type: str = 'application/octet-stream', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + uploads a file and downloads a file using application/octet-stream + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py new file mode 100644 index 00000000000..8fbdf9bbdb8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.api_response import ApiResponse + +# body param + + +class SchemaForRequestBodyMultipartFormData( + DictSchema +): + _required_property_names = set(( + )) + additionalMetadata = StrSchema + file = BinarySchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + additionalMetadata=additionalMetadata, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=SchemaForRequestBodyMultipartFormData), + }, +) +_path = '/fake/uploadFile' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = ApiResponse + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class UploadFile(api_client.Api): + + def upload_file( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyMultipartFormData, Unset] = unset, + content_type: str = 'multipart/form-data', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + uploads a file using multipart/form-data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py new file mode 100644 index 00000000000..19c7745793a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.api_response import ApiResponse + +# body param + + +class SchemaForRequestBodyMultipartFormData( + DictSchema +): + + + class files( + ListSchema + ): + _items = BinarySchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + files: typing.Union[files, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + files=files, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=SchemaForRequestBodyMultipartFormData), + }, +) +_path = '/fake/uploadFiles' +_method = 'POST' +SchemaFor200ResponseBodyApplicationJson = ApiResponse + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class UploadFiles(api_client.Api): + + def upload_files( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyMultipartFormData, Unset] = unset, + content_type: str = 'multipart/form-data', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + uploads files using multipart/form-data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response 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 new file mode 100644 index 00000000000..cda926e1d0a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -0,0 +1,25 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.fake_classname_tags_123_api_endpoints.classname import Classname + + +class FakeClassnameTags123Api( + Classname, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py new file mode 100644 index 00000000000..d8157f7f4cf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.client import Client + +# body param +SchemaForRequestBodyApplicationJson = Client + + +request_body_client = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/fake_classname_test' +_method = 'PATCH' +_auth = [ + 'api_key_query', +] +SchemaFor200ResponseBodyApplicationJson = Client + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class Classname(api_client.Api): + + def classname( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + To test class name in snake case + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_client.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response 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 new file mode 100644 index 00000000000..83efafb3ec3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -0,0 +1,41 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.pet_api_endpoints.add_pet import AddPet +from petstore_api.api.pet_api_endpoints.delete_pet import DeletePet +from petstore_api.api.pet_api_endpoints.find_pets_by_status import FindPetsByStatus +from petstore_api.api.pet_api_endpoints.find_pets_by_tags import FindPetsByTags +from petstore_api.api.pet_api_endpoints.get_pet_by_id import GetPetById +from petstore_api.api.pet_api_endpoints.update_pet import UpdatePet +from petstore_api.api.pet_api_endpoints.update_pet_with_form import UpdatePetWithForm +from petstore_api.api.pet_api_endpoints.upload_file_with_required_file import UploadFileWithRequiredFile +from petstore_api.api.pet_api_endpoints.upload_image import UploadImage + + +class PetApi( + AddPet, + DeletePet, + FindPetsByStatus, + FindPetsByTags, + GetPetById, + UpdatePet, + UpdatePetWithForm, + UploadFileWithRequiredFile, + UploadImage, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py new file mode 100644 index 00000000000..7f04e4cc3c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.pet import Pet + +# body param +SchemaForRequestBodyApplicationJson = Pet +SchemaForRequestBodyApplicationXml = Pet + + +request_body_pet = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + 'application/xml': api_client.MediaType( + schema=SchemaForRequestBodyApplicationXml), + }, + required=True, +) +_path = '/pet' +_method = 'POST' +_auth = [ + 'http_signature_test', + 'petstore_auth', +] +_servers = ( + { + 'url': "http://petstore.swagger.io/v2", + 'description': "No description provided", + }, + { + 'url': "http://path-server-test.petstore.local/v2", + 'description': "No description provided", + }, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +@dataclass +class ApiResponseFor405(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_405 = api_client.OpenApiResponse( + response_cls=ApiResponseFor405, +) +_status_code_to_response = { + '200': _response_for_200, + '405': _response_for_405, +} + + +class AddPet(api_client.Api): + + def add_pet( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyApplicationXml], + content_type: str = 'application/json', + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Add a new pet to the store + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_pet.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.get_host('add_pet', _servers, host_index) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py new file mode 100644 index 00000000000..de6d86ed212 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# header params +ApiKeySchema = StrSchema +RequestRequiredHeaderParams = typing.TypedDict( + 'RequestRequiredHeaderParams', + { + } +) +RequestOptionalHeaderParams = typing.TypedDict( + 'RequestOptionalHeaderParams', + { + 'api_key': ApiKeySchema, + }, + total=False +) + + +class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderParams): + pass + + +request_header_api_key = api_client.HeaderParameter( + name="api_key", + style=api_client.ParameterStyle.SIMPLE, + schema=ApiKeySchema, +) +# path params +PetIdSchema = Int64Schema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'petId': PetIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_pet_id = api_client.PathParameter( + name="petId", + style=api_client.ParameterStyle.SIMPLE, + schema=PetIdSchema, + required=True, +) +_path = '/pet/{petId}' +_method = 'DELETE' +_auth = [ + 'petstore_auth', +] + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) +_status_code_to_response = { + '400': _response_for_400, +} + + +class DeletePet(api_client.Api): + + def delete_pet( + self: api_client.Api, + header_params: RequestHeaderParams = frozendict(), + path_params: RequestPathParams = frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Deletes a pet + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestHeaderParams, header_params) + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_pet_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + for parameter in ( + request_header_api_key, + ): + parameter_data = header_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _headers.extend(serialized_data) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py new file mode 100644 index 00000000000..d6b31e361f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py @@ -0,0 +1,246 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.pet import Pet + +# query params + + +class StatusSchema( + ListSchema +): + + + class _items( + _SchemaEnumMaker( + enum_value_to_name={ + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + ), + StrSchema + ): + + @classmethod + @property + def AVAILABLE(cls): + return cls._enum_by_value["available"]("available") + + @classmethod + @property + def PENDING(cls): + return cls._enum_by_value["pending"]("pending") + + @classmethod + @property + def SOLD(cls): + return cls._enum_by_value["sold"]("sold") +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'status': StatusSchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_status = api_client.QueryParameter( + name="status", + style=api_client.ParameterStyle.FORM, + schema=StatusSchema, + required=True, +) +_path = '/pet/findByStatus' +_method = 'GET' +_auth = [ + 'http_signature_test', + 'petstore_auth', +] + + +class SchemaFor200ResponseBodyApplicationXml( + ListSchema +): + + @classmethod + @property + def _items(cls) -> typing.Type['Pet']: + return Pet + + +class SchemaFor200ResponseBodyApplicationJson( + ListSchema +): + + @classmethod + @property + def _items(cls) -> typing.Type['Pet']: + return Pet + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class FindPetsByStatus(api_client.Api): + + def find_pets_by_status( + self: api_client.Api, + query_params: RequestQueryParams = frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Finds Pets by status + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_status, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py new file mode 100644 index 00000000000..a4c39c6ae34 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.pet import Pet + +# query params + + +class TagsSchema( + ListSchema +): + _items = StrSchema +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'tags': TagsSchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_tags = api_client.QueryParameter( + name="tags", + style=api_client.ParameterStyle.FORM, + schema=TagsSchema, + required=True, +) +_path = '/pet/findByTags' +_method = 'GET' +_auth = [ + 'http_signature_test', + 'petstore_auth', +] + + +class SchemaFor200ResponseBodyApplicationXml( + ListSchema +): + + @classmethod + @property + def _items(cls) -> typing.Type['Pet']: + return Pet + + +class SchemaFor200ResponseBodyApplicationJson( + ListSchema +): + + @classmethod + @property + def _items(cls) -> typing.Type['Pet']: + return Pet + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class FindPetsByTags(api_client.Api): + + def find_pets_by_tags( + self: api_client.Api, + query_params: RequestQueryParams = frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Finds Pets by tags + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_tags, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py new file mode 100644 index 00000000000..533b2ae23cf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.pet import Pet + +# path params +PetIdSchema = Int64Schema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'petId': PetIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_pet_id = api_client.PathParameter( + name="petId", + style=api_client.ParameterStyle.SIMPLE, + schema=PetIdSchema, + required=True, +) +_path = '/pet/{petId}' +_method = 'GET' +_auth = [ + 'api_key', +] +SchemaFor200ResponseBodyApplicationXml = Pet +SchemaFor200ResponseBodyApplicationJson = Pet + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, + '404': _response_for_404, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class GetPetById(api_client.Api): + + def get_pet_by_id( + self: api_client.Api, + path_params: RequestPathParams = frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Find pet by ID + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_pet_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py new file mode 100644 index 00000000000..71bdf386bc9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py @@ -0,0 +1,194 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.pet import Pet + +# body param +SchemaForRequestBodyApplicationJson = Pet +SchemaForRequestBodyApplicationXml = Pet + + +request_body_pet = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + 'application/xml': api_client.MediaType( + schema=SchemaForRequestBodyApplicationXml), + }, + required=True, +) +_path = '/pet' +_method = 'PUT' +_auth = [ + 'http_signature_test', + 'petstore_auth', +] +_servers = ( + { + 'url': "http://petstore.swagger.io/v2", + 'description': "No description provided", + }, + { + 'url': "http://path-server-test.petstore.local/v2", + 'description': "No description provided", + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) + + +@dataclass +class ApiResponseFor405(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_405 = api_client.OpenApiResponse( + response_cls=ApiResponseFor405, +) +_status_code_to_response = { + '400': _response_for_400, + '404': _response_for_404, + '405': _response_for_405, +} + + +class UpdatePet(api_client.Api): + + def update_pet( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson, SchemaForRequestBodyApplicationXml], + content_type: str = 'application/json', + host_index: typing.Optional[int] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Update an existing pet + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_pet.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + host = self.get_host('update_pet', _servers, host_index) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + host=host, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py new file mode 100644 index 00000000000..6535b584ac8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# path params +PetIdSchema = Int64Schema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'petId': PetIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_pet_id = api_client.PathParameter( + name="petId", + style=api_client.ParameterStyle.SIMPLE, + schema=PetIdSchema, + required=True, +) +# body param + + +class SchemaForRequestBodyApplicationXWwwFormUrlencoded( + DictSchema +): + name = StrSchema + status = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + name: typing.Union[name, Unset] = unset, + status: typing.Union[status, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + status=status, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'application/x-www-form-urlencoded': api_client.MediaType( + schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded), + }, +) +_path = '/pet/{petId}' +_method = 'POST' +_auth = [ + 'petstore_auth', +] + + +@dataclass +class ApiResponseFor405(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_405 = api_client.OpenApiResponse( + response_cls=ApiResponseFor405, +) +_status_code_to_response = { + '405': _response_for_405, +} + + +class UpdatePetWithForm(api_client.Api): + + def update_pet_with_form( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationXWwwFormUrlencoded, Unset] = unset, + path_params: RequestPathParams = frozendict(), + content_type: str = 'application/x-www-form-urlencoded', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Updates a pet in the store with form data + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_pet_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py new file mode 100644 index 00000000000..faa353d8d30 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + FileSchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + FileBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.api_response import ApiResponse + +# path params +PetIdSchema = Int64Schema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'petId': PetIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_pet_id = api_client.PathParameter( + name="petId", + style=api_client.ParameterStyle.SIMPLE, + schema=PetIdSchema, + required=True, +) +# body param + + +class SchemaForRequestBodyMultipartFormData( + DictSchema +): + additionalMetadata = StrSchema + file = FileSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, + file: typing.Union[file, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + additionalMetadata=additionalMetadata, + file=file, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=SchemaForRequestBodyMultipartFormData), + }, +) +_path = '/pet/{petId}/uploadImage' +_method = 'POST' +_auth = [ + 'petstore_auth', +] +SchemaFor200ResponseBodyApplicationJson = ApiResponse + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class UploadFile(api_client.Api): + + def upload_file( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyMultipartFormData, Unset] = unset, + path_params: RequestPathParams = frozendict(), + content_type: str = 'multipart/form-data', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + uploads an image + Parameters use leading underscores to prevent collisions with user defined + parameters from the source openapi spec + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_pet_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + ) + + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py new file mode 100644 index 00000000000..214bf7a41b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py @@ -0,0 +1,225 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.api_response import ApiResponse + +# path params +PetIdSchema = Int64Schema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'petId': PetIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_pet_id = api_client.PathParameter( + name="petId", + style=api_client.ParameterStyle.SIMPLE, + schema=PetIdSchema, + required=True, +) +# body param + + +class SchemaForRequestBodyMultipartFormData( + DictSchema +): + _required_property_names = set(( + )) + additionalMetadata = StrSchema + requiredFile = BinarySchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + additionalMetadata=additionalMetadata, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=SchemaForRequestBodyMultipartFormData), + }, +) +_path = '/fake/{petId}/uploadImageWithRequiredFile' +_method = 'POST' +_auth = [ + 'petstore_auth', +] +SchemaFor200ResponseBodyApplicationJson = ApiResponse + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class UploadFileWithRequiredFile(api_client.Api): + + def upload_file_with_required_file( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyMultipartFormData, Unset] = unset, + path_params: RequestPathParams = frozendict(), + content_type: str = 'multipart/form-data', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + uploads an image (required) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_pet_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py new file mode 100644 index 00000000000..d4f494e25be --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.api_response import ApiResponse + +# path params +PetIdSchema = Int64Schema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'petId': PetIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_pet_id = api_client.PathParameter( + name="petId", + style=api_client.ParameterStyle.SIMPLE, + schema=PetIdSchema, + required=True, +) +# body param + + +class SchemaForRequestBodyMultipartFormData( + DictSchema +): + additionalMetadata = StrSchema + file = BinarySchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + additionalMetadata=additionalMetadata, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +request_body_body = api_client.RequestBody( + content={ + 'multipart/form-data': api_client.MediaType( + schema=SchemaForRequestBodyMultipartFormData), + }, +) +_path = '/pet/{petId}/uploadImage' +_method = 'POST' +_auth = [ + 'petstore_auth', +] +SchemaFor200ResponseBodyApplicationJson = ApiResponse + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class UploadImage(api_client.Api): + + def upload_image( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyMultipartFormData, Unset] = unset, + path_params: RequestPathParams = frozendict(), + content_type: str = 'multipart/form-data', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + uploads an image + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_pet_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + _fields = None + _body = None + if body is not unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response 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 new file mode 100644 index 00000000000..3685a172804 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -0,0 +1,31 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.store_api_endpoints.delete_order import DeleteOrder +from petstore_api.api.store_api_endpoints.get_inventory import GetInventory +from petstore_api.api.store_api_endpoints.get_order_by_id import GetOrderById +from petstore_api.api.store_api_endpoints.place_order import PlaceOrder + + +class StoreApi( + DeleteOrder, + GetInventory, + GetOrderById, + PlaceOrder, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py new file mode 100644 index 00000000000..9dbbf03607f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# path params +OrderIdSchema = StrSchema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'order_id': OrderIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_order_id = api_client.PathParameter( + name="order_id", + style=api_client.ParameterStyle.SIMPLE, + schema=OrderIdSchema, + required=True, +) +_path = '/store/order/{order_id}' +_method = 'DELETE' + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '400': _response_for_400, + '404': _response_for_404, +} + + +class DeleteOrder(api_client.Api): + + def delete_order( + self: api_client.Api, + path_params: RequestPathParams = frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Delete purchase order by ID + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_order_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py new file mode 100644 index 00000000000..e5e5aca7eb0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +_path = '/store/inventory' +_method = 'GET' +_auth = [ + 'api_key', +] + + +class SchemaFor200ResponseBodyApplicationJson( + DictSchema +): + _additional_properties = Int32Schema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class GetInventory(api_client.Api): + + def get_inventory( + self: api_client.Api, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Returns pet inventories by status + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py new file mode 100644 index 00000000000..11f819f27b3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.order import Order + +# path params + + +class OrderIdSchema( + _SchemaValidator( + inclusive_maximum=5, + inclusive_minimum=1, + ), + Int64Schema +): + pass +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'order_id': OrderIdSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_order_id = api_client.PathParameter( + name="order_id", + style=api_client.ParameterStyle.SIMPLE, + schema=OrderIdSchema, + required=True, +) +_path = '/store/order/{order_id}' +_method = 'GET' +SchemaFor200ResponseBodyApplicationXml = Order +SchemaFor200ResponseBodyApplicationJson = Order + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, + '404': _response_for_404, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class GetOrderById(api_client.Api): + + def get_order_by_id( + self: api_client.Api, + path_params: RequestPathParams = frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Find purchase order by ID + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_order_id, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py new file mode 100644 index 00000000000..ef9f9c3ba63 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.order import Order + +# body param +SchemaForRequestBodyApplicationJson = Order + + +request_body_order = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/store/order' +_method = 'POST' +SchemaFor200ResponseBodyApplicationXml = Order +SchemaFor200ResponseBodyApplicationJson = Order + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class PlaceOrder(api_client.Api): + + def place_order( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Place an order for a pet + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_order.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response 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 new file mode 100644 index 00000000000..1975100b9e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -0,0 +1,39 @@ +# 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 petstore_api.api_client import ApiClient +from petstore_api.api.user_api_endpoints.create_user import CreateUser +from petstore_api.api.user_api_endpoints.create_users_with_array_input import CreateUsersWithArrayInput +from petstore_api.api.user_api_endpoints.create_users_with_list_input import CreateUsersWithListInput +from petstore_api.api.user_api_endpoints.delete_user import DeleteUser +from petstore_api.api.user_api_endpoints.get_user_by_name import GetUserByName +from petstore_api.api.user_api_endpoints.login_user import LoginUser +from petstore_api.api.user_api_endpoints.logout_user import LogoutUser +from petstore_api.api.user_api_endpoints.update_user import UpdateUser + + +class UserApi( + CreateUser, + CreateUsersWithArrayInput, + CreateUsersWithListInput, + DeleteUser, + GetUserByName, + LoginUser, + LogoutUser, + UpdateUser, + ApiClient, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py new file mode 100644 index 00000000000..8627997a2fb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.user import User + +# body param +SchemaForRequestBodyApplicationJson = User + + +request_body_user = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/user' +_method = 'POST' + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, +) +_status_code_to_response = { + 'default': _response_for_default, +} + + +class CreateUser(api_client.Api): + + def create_user( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Create user + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_user.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py new file mode 100644 index 00000000000..8694e9582ff --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.user import User + +# body param + + +class SchemaForRequestBodyApplicationJson( + ListSchema +): + + @classmethod + @property + def _items(cls) -> typing.Type['User']: + return User + + +request_body_user = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/user/createWithArray' +_method = 'POST' + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, +) +_status_code_to_response = { + 'default': _response_for_default, +} + + +class CreateUsersWithArrayInput(api_client.Api): + + def create_users_with_array_input( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Creates list of users with given input array + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_user.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py new file mode 100644 index 00000000000..d1c0a1e0e87 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.user import User + +# body param + + +class SchemaForRequestBodyApplicationJson( + ListSchema +): + + @classmethod + @property + def _items(cls) -> typing.Type['User']: + return User + + +request_body_user = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/user/createWithList' +_method = 'POST' + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, +) +_status_code_to_response = { + 'default': _response_for_default, +} + + +class CreateUsersWithListInput(api_client.Api): + + def create_users_with_list_input( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Creates list of users with given input array + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_user.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py new file mode 100644 index 00000000000..1d3b6530820 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# path params +UsernameSchema = StrSchema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'username': UsernameSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_username = api_client.PathParameter( + name="username", + style=api_client.ParameterStyle.SIMPLE, + schema=UsernameSchema, + required=True, +) +_path = '/user/{username}' +_method = 'DELETE' + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '400': _response_for_400, + '404': _response_for_404, +} + + +class DeleteUser(api_client.Api): + + def delete_user( + self: api_client.Api, + path_params: RequestPathParams = frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Delete user + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_username, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py new file mode 100644 index 00000000000..2a2af60d64b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.user import User + +# path params +UsernameSchema = StrSchema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'username': UsernameSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_username = api_client.PathParameter( + name="username", + style=api_client.ParameterStyle.SIMPLE, + schema=UsernameSchema, + required=True, +) +_path = '/user/{username}' +_method = 'GET' +SchemaFor200ResponseBodyApplicationXml = User +SchemaFor200ResponseBodyApplicationJson = User + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: Unset = unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, + '404': _response_for_404, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class GetUserByName(api_client.Api): + + def get_user_by_name( + self: api_client.Api, + path_params: RequestPathParams = frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Get user by user name + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_username, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py new file mode 100644 index 00000000000..c63a4e482d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +# query params +UsernameSchema = StrSchema +PasswordSchema = StrSchema +RequestRequiredQueryParams = typing.TypedDict( + 'RequestRequiredQueryParams', + { + 'username': UsernameSchema, + 'password': PasswordSchema, + } +) +RequestOptionalQueryParams = typing.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_username = api_client.QueryParameter( + name="username", + style=api_client.ParameterStyle.FORM, + schema=UsernameSchema, + required=True, + explode=True, +) +request_query_password = api_client.QueryParameter( + name="password", + style=api_client.ParameterStyle.FORM, + schema=PasswordSchema, + required=True, + explode=True, +) +_path = '/user/login' +_method = 'GET' +XRateLimitSchema = Int32Schema +x_rate_limit_parameter = api_client.HeaderParameter( + name="X-Rate-Limit", + style=api_client.ParameterStyle.SIMPLE, + schema=XRateLimitSchema, +) +XExpiresAfterSchema = DateTimeSchema +x_expires_after_parameter = api_client.HeaderParameter( + name="X-Expires-After", + style=api_client.ParameterStyle.SIMPLE, + schema=XExpiresAfterSchema, +) +SchemaFor200ResponseBodyApplicationXml = StrSchema +SchemaFor200ResponseBodyApplicationJson = StrSchema +ResponseHeadersFor200 = typing.TypedDict( + 'ResponseHeadersFor200', + { + 'X-Rate-Limit': XRateLimitSchema, + 'X-Expires-After': XExpiresAfterSchema, + } +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationXml, + SchemaFor200ResponseBodyApplicationJson, + ] + headers: ResponseHeadersFor200 + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/xml': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationXml), + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, + headers=[ + x_rate_limit_parameter, + x_expires_after_parameter, + ] +) + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) +_status_code_to_response = { + '200': _response_for_200, + '400': _response_for_400, +} +_all_accept_content_types = ( + 'application/xml', + 'application/json', +) + + +class LoginUser(api_client.Api): + + def login_user( + self: api_client.Api, + query_params: RequestQueryParams = frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Logs user into the system + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestQueryParams, query_params) + + _query_params = [] + for parameter in ( + request_query_username, + request_query_password, + ): + parameter_data = query_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _query_params.extend(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + query_params=tuple(_query_params), + headers=_headers, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py new file mode 100644 index 00000000000..1e6f9443fce --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +_path = '/user/logout' +_method = 'GET' + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, +) +_status_code_to_response = { + 'default': _response_for_default, +} + + +class LogoutUser(api_client.Api): + + def logout_user( + self: api_client.Api, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization + ]: + """ + Logs out current logged in user session + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=_path, + method=_method, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py new file mode 100644 index 00000000000..fcd3f6dcde4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import re # noqa: F401 +import sys # noqa: F401 +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api import api_client, exceptions +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + +from petstore_api.model.user import User + +# path params +UsernameSchema = StrSchema +RequestRequiredPathParams = typing.TypedDict( + 'RequestRequiredPathParams', + { + 'username': UsernameSchema, + } +) +RequestOptionalPathParams = typing.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_username = api_client.PathParameter( + name="username", + style=api_client.ParameterStyle.SIMPLE, + schema=UsernameSchema, + required=True, +) +# body param +SchemaForRequestBodyApplicationJson = User + + +request_body_user = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_path = '/user/{username}' +_method = 'PUT' + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, +) + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: Unset = unset + headers: Unset = unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, +) +_status_code_to_response = { + '400': _response_for_400, + '404': _response_for_404, +} + + +class UpdateUser(api_client.Api): + + def update_user( + self: api_client.Api, + body: typing.Union[SchemaForRequestBodyApplicationJson], + path_params: RequestPathParams = frozendict(), + content_type: str = 'application/json', + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ) -> typing.Union[ + api_client.ApiResponseWithoutDeserialization + ]: + """ + Updated user + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs(RequestPathParams, path_params) + + _path_params = {} + for parameter in ( + request_path_username, + ): + parameter_data = path_params.get(parameter.name, unset) + if parameter_data is unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + if body is unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_user.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=_path, + method=_method, + path_params=_path_params, + headers=_headers, + fields=_fields, + body=_body, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py new file mode 100644 index 00000000000..38220b88f5d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -0,0 +1,1379 @@ +# 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 dataclasses import dataclass +from decimal import Decimal +import enum +import json +import os +import io +import atexit +from multiprocessing.pool import ThreadPool +import re +import tempfile +import typing +import urllib3 +from urllib3._collections import HTTPHeaderDict +from urllib.parse import quote +from urllib3.fields import RequestField as RequestFieldBase + + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiTypeError, ApiValueError +from petstore_api.schemas import ( + Decimal, + NoneClass, + BoolClass, + Schema, + FileIO, + BinarySchema, + InstantiationMetadata, + date, + datetime, + none_type, + frozendict, + Unset, + unset, +) + + +class RequestField(RequestFieldBase): + def __eq__(self, other): + if not isinstance(other, RequestField): + return False + return self.__dict__ == other.__dict__ + + +class JSONEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, (str, int, float)): + # instances based on primitive classes + return obj + elif isinstance(obj, Decimal): + if obj.as_tuple().exponent >= 0: + return int(obj) + return float(obj) + elif isinstance(obj, NoneClass): + return None + elif isinstance(obj, BoolClass): + return bool(obj) + elif isinstance(obj, (dict, frozendict)): + return {key: self.default(val) for key, val in obj.items()} + elif isinstance(obj, (list, tuple)): + return [self.default(item) for item in obj] + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + + +class ParameterInType(enum.Enum): + QUERY = 'query' + HEADER = 'header' + PATH = 'path' + COOKIE = 'cookie' + + +class ParameterStyle(enum.Enum): + MATRIX = 'matrix' + LABEL = 'label' + FORM = 'form' + SIMPLE = 'simple' + SPACE_DELIMITED = 'spaceDelimited' + PIPE_DELIMITED = 'pipeDelimited' + DEEP_OBJECT = 'deepObject' + + +class ParameterSerializerBase: + @staticmethod + def __serialize_number( + in_data: typing.Union[int, float], name: str, prefix='' + ) -> typing.Tuple[typing.Tuple[str, str]]: + return tuple([(name, prefix + str(in_data))]) + + @staticmethod + def __serialize_str( + in_data: str, name: str, prefix='' + ) -> typing.Tuple[typing.Tuple[str, str]]: + return tuple([(name, prefix + quote(in_data))]) + + @staticmethod + def __serialize_bool(in_data: bool, name: str, prefix='') -> typing.Tuple[typing.Tuple[str, str]]: + if in_data: + return tuple([(name, prefix + 'true')]) + return tuple([(name, prefix + 'false')]) + + @staticmethod + def __urlencode(in_data: typing.Any) -> str: + return quote(str(in_data)) + + def __serialize_list( + self, + in_data: typing.List[typing.Any], + style: ParameterStyle, + name: str, + explode: bool, + empty_val: typing.Union[typing.Tuple[str, str], typing.Tuple] = tuple(), + prefix: str = '', + separator: str = ',', + ) -> typing.Tuple[typing.Union[typing.Tuple[str, str], typing.Tuple], ...]: + if not in_data: + return empty_val + if explode and style in { + ParameterStyle.FORM, + ParameterStyle.MATRIX, + ParameterStyle.SPACE_DELIMITED, + ParameterStyle.PIPE_DELIMITED + }: + if style is ParameterStyle.FORM: + return tuple((name, prefix + self.__urlencode(val)) for val in in_data) + else: + joined_vals = prefix + separator.join(name + '=' + self.__urlencode(val) for val in in_data) + else: + joined_vals = prefix + separator.join(map(self.__urlencode, in_data)) + return tuple([(name, joined_vals)]) + + def __form_item_representation(self, in_data: typing.Any) -> typing.Optional[str]: + if isinstance(in_data, none_type): + return None + elif isinstance(in_data, list): + if not in_data: + return None + raise ApiValueError('Unable to generate a form representation of {}'.format(in_data)) + elif isinstance(in_data, dict): + if not in_data: + return None + raise ApiValueError('Unable to generate a form representation of {}'.format(in_data)) + elif isinstance(in_data, (bool, bytes)): + raise ApiValueError('Unable to generate a form representation of {}'.format(in_data)) + # str, float, int + return self.__urlencode(in_data) + + def __serialize_dict( + self, + in_data: typing.Dict[str, typing.Any], + style: ParameterStyle, + name: str, + explode: bool, + empty_val: typing.Union[typing.Tuple[str, str], typing.Tuple] = tuple(), + prefix: str = '', + separator: str = ',', + ) -> typing.Tuple[typing.Tuple[str, str]]: + if not in_data: + return empty_val + if all(val is None for val in in_data.values()): + return empty_val + + form_items = {} + if style is ParameterStyle.FORM: + for key, val in in_data.items(): + new_val = self.__form_item_representation(val) + if new_val is None: + continue + form_items[key] = new_val + + if explode: + if style is ParameterStyle.FORM: + return tuple((key, prefix + val) for key, val in form_items.items()) + elif style in { + ParameterStyle.SIMPLE, + ParameterStyle.LABEL, + ParameterStyle.MATRIX, + ParameterStyle.SPACE_DELIMITED, + ParameterStyle.PIPE_DELIMITED + }: + joined_vals = prefix + separator.join(key + '=' + self.__urlencode(val) for key, val in in_data.items()) + else: + raise ApiValueError(f'Invalid style {style} for dict serialization with explode=True') + elif style is ParameterStyle.FORM: + joined_vals = prefix + separator.join(key + separator + val for key, val in form_items.items()) + else: + joined_vals = prefix + separator.join( + key + separator + self.__urlencode(val) for key, val in in_data.items()) + return tuple([(name, joined_vals)]) + + def _serialize_x( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + style: ParameterStyle, + name: str, + explode: bool, + empty_val: typing.Union[typing.Tuple[str, str], typing.Tuple] = (), + prefix: str = '', + separator: str = ',', + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + if isinstance(in_data, none_type): + return empty_val + elif isinstance(in_data, bool): + # must be before int check + return self.__serialize_bool(in_data, name=name, prefix=prefix) + elif isinstance(in_data, (int, float)): + return self.__serialize_number(in_data, name=name, prefix=prefix) + elif isinstance(in_data, str): + return self.__serialize_str(in_data, name=name, prefix=prefix) + elif isinstance(in_data, list): + return self.__serialize_list( + in_data, + style=style, + name=name, + explode=explode, + empty_val=empty_val, + prefix=prefix, + separator=separator + ) + elif isinstance(in_data, dict): + return self.__serialize_dict( + in_data, + style=style, + name=name, + explode=explode, + empty_val=empty_val, + prefix=prefix, + separator=separator + ) + + +class StyleFormSerializer(ParameterSerializerBase): + + def _serialize_form( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + return self._serialize_x(in_data, style=ParameterStyle.FORM, name=name, explode=explode) + + +class StyleSimpleSerializer(ParameterSerializerBase): + + def _serialize_simple_tuple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + name: str, + explode: bool, + in_type: ParameterInType, + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + if in_type is ParameterInType.HEADER: + empty_val = () + else: + empty_val = ((name, ''),) + return self._serialize_x(in_data, style=ParameterStyle.SIMPLE, name=name, explode=explode, empty_val=empty_val) + + +@dataclass +class ParameterBase: + name: str + in_type: ParameterInType + required: bool + style: typing.Optional[ParameterStyle] + explode: typing.Optional[bool] + allow_reserved: typing.Optional[bool] + schema: typing.Optional[typing.Type[Schema]] + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] + + __style_to_in_type = { + ParameterStyle.MATRIX: {ParameterInType.PATH}, + ParameterStyle.LABEL: {ParameterInType.PATH}, + ParameterStyle.FORM: {ParameterInType.QUERY, ParameterInType.COOKIE}, + ParameterStyle.SIMPLE: {ParameterInType.PATH, ParameterInType.HEADER}, + ParameterStyle.SPACE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.PIPE_DELIMITED: {ParameterInType.QUERY}, + ParameterStyle.DEEP_OBJECT: {ParameterInType.QUERY}, + } + __in_type_to_default_style = { + ParameterInType.QUERY: ParameterStyle.FORM, + ParameterInType.PATH: ParameterStyle.SIMPLE, + ParameterInType.HEADER: ParameterStyle.SIMPLE, + ParameterInType.COOKIE: ParameterStyle.FORM, + } + __disallowed_header_names = {'Accept', 'Content-Type', 'Authorization'} + _json_encoder = JSONEncoder() + _json_content_type = 'application/json' + + @classmethod + def __verify_style_to_in_type(cls, style: typing.Optional[ParameterStyle], in_type: ParameterInType): + if style is None: + return + in_type_set = cls.__style_to_in_type[style] + if in_type not in in_type_set: + raise ValueError( + 'Invalid style and in_type combination. For style={} only in_type={} are allowed'.format( + style, in_type_set + ) + ) + + def __init__( + self, + name: str, + in_type: ParameterInType, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + if schema is None and content is None: + raise ValueError('Value missing; Pass in either schema or content') + if schema and content: + raise ValueError('Too many values provided. Both schema and content were provided. Only one may be input') + if name in self.__disallowed_header_names and in_type is ParameterInType.HEADER: + raise ValueError('Invalid name, name may not be one of {}'.format(self.__disallowed_header_names)) + self.__verify_style_to_in_type(style, in_type) + if content is None and style is None: + style = self.__in_type_to_default_style[in_type] + if content is not None and in_type in self.__in_type_to_default_style and len(content) != 1: + raise ValueError('Invalid content length, content length must equal 1') + self.in_type = in_type + self.name = name + self.required = required + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + self.schema = schema + self.content = content + + @staticmethod + def _remove_empty_and_cast( + in_data: typing.Tuple[typing.Tuple[str, str]], + ) -> typing.Dict[str, str]: + data = tuple(t for t in in_data if t) + if not data: + return dict() + return dict(data) + + def _serialize_json( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Tuple[typing.Tuple[str, str]]: + return tuple([(self.name, json.dumps(in_data))]) + + +class PathParameter(ParameterBase, StyleSimpleSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.PATH, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_label( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + empty_val = ((self.name, ''),) + prefix = '.' + separator = '.' + return self._remove_empty_and_cast( + self._serialize_x( + in_data, + style=ParameterStyle.LABEL, + name=self.name, + explode=self.explode, + empty_val=empty_val, + prefix=prefix, + separator=separator + ) + ) + + def __serialize_matrix( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Dict[str, str]: + separator = ',' + if in_data == '': + prefix = ';' + self.name + elif isinstance(in_data, (dict, list)) and self.explode: + prefix = ';' + separator = ';' + else: + prefix = ';' + self.name + '=' + empty_val = ((self.name, ''),) + return self._remove_empty_and_cast( + self._serialize_x( + in_data, + style=ParameterStyle.MATRIX, + name=self.name, + explode=self.explode, + prefix=prefix, + empty_val=empty_val, + separator=separator + ) + ) + + def _serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> typing.Dict[str, str]: + tuple_data = self._serialize_simple_tuple(in_data, self.name, self.explode, self.in_type) + return self._remove_empty_and_cast(tuple_data) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> typing.Dict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> path + path: + returns path_params: dict + label -> path + returns path_params + matrix -> path + returns path_params + """ + if self.style: + if self.style is ParameterStyle.SIMPLE: + return self._serialize_simple(cast_in_data) + elif self.style is ParameterStyle.LABEL: + return self.__serialize_label(cast_in_data) + elif self.style is ParameterStyle.MATRIX: + return self.__serialize_matrix(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + tuple_data = self._serialize_json(cast_in_data) + return self._remove_empty_and_cast(tuple_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class QueryParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.QUERY, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def __serialize_space_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + separator = '%20' + empty_val = () + return self._serialize_x( + in_data, + style=ParameterStyle.SPACE_DELIMITED, + name=self.name, + explode=self.explode, + separator=separator, + empty_val=empty_val + ) + + def __serialize_pipe_delimited( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list] + ) -> typing.Tuple[typing.Tuple[str, str], ...]: + separator = '|' + empty_val = () + return self._serialize_x( + in_data, + style=ParameterStyle.PIPE_DELIMITED, + name=self.name, + explode=self.explode, + separator=separator, + empty_val=empty_val + ) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> typing.Tuple[typing.Tuple[str, str]]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> query + query: + - GET/HEAD/DELETE: could use fields + - PUT/POST: must use urlencode to send parameters + returns fields: tuple + spaceDelimited -> query + returns fields + pipeDelimited -> query + returns fields + deepObject -> query, https://github.com/OAI/OpenAPI-Specification/issues/1706 + returns fields + """ + if self.style: + # TODO update query ones to omit setting values when [] {} or None is input + if self.style is ParameterStyle.FORM: + return self._serialize_form(cast_in_data, explode=self.explode, name=self.name) + elif self.style is ParameterStyle.SPACE_DELIMITED: + return self.__serialize_space_delimited(cast_in_data) + elif self.style is ParameterStyle.PIPE_DELIMITED: + return self.__serialize_pipe_delimited(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + return self._serialize_json(cast_in_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class CookieParameter(ParameterBase, StyleFormSerializer): + + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.COOKIE, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> typing.Tuple[typing.Tuple[str, str]]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + form -> cookie + returns fields: tuple + """ + if self.style: + return self._serialize_form(cast_in_data, explode=self.explode, name=self.name) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + return self._serialize_json(cast_in_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class HeaderParameter(ParameterBase, StyleSimpleSerializer): + def __init__( + self, + name: str, + required: bool = False, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: typing.Optional[bool] = None, + schema: typing.Optional[typing.Type[Schema]] = None, + content: typing.Optional[typing.Dict[str, typing.Type[Schema]]] = None + ): + super().__init__( + name, + in_type=ParameterInType.HEADER, + required=required, + style=style, + explode=explode, + allow_reserved=allow_reserved, + schema=schema, + content=content + ) + + @staticmethod + def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict[str, str]: + data = tuple(t for t in in_data if t) + headers = HTTPHeaderDict() + if not data: + return headers + headers.extend(data) + return headers + + def _serialize_simple( + self, + in_data: typing.Union[None, int, float, str, bool, dict, list], + ) -> HTTPHeaderDict[str, str]: + tuple_data = self._serialize_simple_tuple(in_data, self.name, self.explode, self.in_type) + return self.__to_headers(tuple_data) + + def serialize( + self, + in_data: typing.Union[ + Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict] + ) -> HTTPHeaderDict[str, str]: + if self.schema: + cast_in_data = self.schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + """ + simple -> header + headers: PoolManager needs a mapping, tuple is close + returns headers: dict + """ + if self.style: + return self._serialize_simple(cast_in_data) + # self.content will be length one + for content_type, schema in self.content.items(): + cast_in_data = schema(in_data) + cast_in_data = self._json_encoder.default(cast_in_data) + if content_type == self._json_content_type: + tuple_data = self._serialize_json(cast_in_data) + return self.__to_headers(tuple_data) + raise NotImplementedError('Serialization of {} has not yet been implemented'.format(content_type)) + + +class Encoding: + def __init__( + self, + content_type: str, + headers: typing.Optional[typing.Dict[str, HeaderParameter]] = None, + style: typing.Optional[ParameterStyle] = None, + explode: bool = False, + allow_reserved: bool = False, + ): + self.content_type = content_type + self.headers = headers + self.style = style + self.explode = explode + self.allow_reserved = allow_reserved + + +class MediaType: + """ + Used to store request and response body schema information + encoding: + A map between a property name and its encoding information. + The key, being the property name, MUST exist in the schema as a property. + The encoding object SHALL only apply to requestBody objects when the media type is + multipart or application/x-www-form-urlencoded. + """ + + def __init__( + self, + schema: typing.Type[Schema], + encoding: typing.Optional[typing.Dict[str, Encoding]] = None, + ): + self.schema = schema + self.encoding = encoding + + +@dataclass +class ApiResponse: + response: urllib3.HTTPResponse + body: typing.Union[Unset, typing.Type[Schema]] + headers: typing.Union[Unset, typing.List[HeaderParameter]] + + def __init__( + self, + response: urllib3.HTTPResponse, + body: typing.Union[Unset, typing.Type[Schema]], + headers: typing.Union[Unset, typing.List[HeaderParameter]] + ): + """ + pycharm needs this to prevent 'Unexpected argument' warnings + """ + self.response = response + self.body = body + self.headers = headers + + +@dataclass +class ApiResponseWithoutDeserialization(ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[Unset, typing.Type[Schema]] = unset + headers: typing.Union[Unset, typing.List[HeaderParameter]] = unset + + +class OpenApiResponse: + def __init__( + self, + response_cls: typing.Type[ApiResponse] = ApiResponse, + content: typing.Optional[typing.Dict[str, MediaType]] = None, + headers: typing.Optional[typing.List[HeaderParameter]] = None, + ): + self.headers = headers + if content is not None and len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + self.response_cls = response_cls + + @staticmethod + def __deserialize_json(response: urllib3.HTTPResponse) -> typing.Any: + decoded_data = response.data.decode("utf-8") + return json.loads(decoded_data) + + @staticmethod + def __file_name_from_content_disposition(content_disposition: typing.Optional[str]) -> typing.Optional[str]: + if content_disposition is None: + return None + match = re.search('filename="(.+?)"', content_disposition) + if not match: + return None + return match.group(1) + + def __deserialize_application_octet_stream( + self, response: urllib3.HTTPResponse + ) -> typing.Union[bytes, io.BufferedReader]: + """ + urllib3 use cases: + 1. when preload_content=True (stream=False) then supports_chunked_reads is False and bytes are returned + 2. when preload_content=False (stream=True) then supports_chunked_reads is True and + a file will be written and returned + """ + if response.supports_chunked_reads(): + file_name = self.__file_name_from_content_disposition(response.headers.get('content-disposition')) + + if file_name is None: + _fd, path = tempfile.mkstemp() + else: + path = os.path.join(tempfile.gettempdir(), file_name) + # TODO get file_name from the filename at the end of the url if it exists + with open(path, 'wb') as new_file: + chunk_size = 1024 + while True: + data = response.read(chunk_size) + if not data: + break + new_file.write(data) + # release_conn is needed for streaming connections only + response.release_conn() + new_file = open(path, 'rb') + return new_file + else: + return response.data + + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + content_type = response.getheader('content-type') + deserialized_body = unset + streamed = response.supports_chunked_reads() + if self.content is not None: + if content_type == 'application/json': + body_data = self.__deserialize_json(response) + elif content_type == 'application/octet-stream': + body_data = self.__deserialize_application_octet_stream(response) + else: + raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) + body_schema = self.content[content_type].schema + _instantiation_metadata = InstantiationMetadata(from_server=True, configuration=configuration) + deserialized_body = body_schema._from_openapi_data( + body_data, _instantiation_metadata=_instantiation_metadata) + elif streamed: + response.release_conn() + + deserialized_headers = unset + if self.headers is not None: + deserialized_headers = unset + + return self.response_cls( + response=response, + headers=deserialized_headers, + body=deserialized_body + ) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + __json_encoder = JSONEncoder() + + def __init__( + self, + configuration: typing.Optional[Configuration] = None, + header_name: typing.Optional[str] = None, + header_value: typing.Optional[str] = None, + cookie: typing.Optional[str] = None, + pool_threads: int = 1 + ): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: + + # header parameters + headers = headers or {} + headers.update(self.default_headers) + if self.cookie: + headers['Cookie'] = self.cookie + + # path parameters + if path_params: + for k, v in path_params.items(): + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=self.configuration.safe_chars_for_path_param) + ) + + # auth setting + self.update_params_for_auth(headers, query_params, + auth_settings, resource_path, method, body) + + # request url + if host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = host + resource_path + + # perform request and return response + response = self.request( + method, + url, + query_params=query_params, + headers=headers, + fields=fields, + body=body, + stream=stream, + timeout=timeout, + ) + return response + + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + host: typing.Optional[str] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param headers: Header parameters to be + placed in the request header. + :param body: Request body. + :param fields: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings: Auth Settings names for the request. + :param async_req: execute request asynchronously + :type async_req: bool, optional TODO remove, unused + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Also when True, if the openapi spec describes a file download, + the data will be written to a local filesystme file and the BinarySchema + instance will also inherit from FileSchema and FileIO + Default is False. + :type stream: bool, optional + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param host: api endpoint host + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + + if not async_req: + return self.__call_api( + resource_path, + method, + path_params, + query_params, + headers, + body, + fields, + auth_settings, + stream, + timeout, + host, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + path_params, + query_params, + headers, + body, + json, + fields, + auth_settings, + stream, + timeout, + host, + ) + ) + + def request( + self, + method: str, + url: str, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + stream=stream, + timeout=timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + fields=fields, + stream=stream, + timeout=timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + stream=stream, + timeout=timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['in'] == 'cookie': + headers.add('Cookie', auth_setting['value']) + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers.add(auth_setting['key'], auth_setting['value']) + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers.add(key, value) + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + +class Api: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client: typing.Optional[ApiClient] = None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + @staticmethod + def _verify_typed_dict_inputs(cls: typing.Type[typing.TypedDict], data: typing.Dict[str, typing.Any]): + """ + Ensures that: + - required keys are present + - additional properties are not input + - value stored under required keys do not have the value unset + Note: detailed value checking is done in schema classes + """ + missing_required_keys = [] + required_keys_with_unset_values = [] + for required_key in cls.__required_keys__: + if required_key not in data: + missing_required_keys.append(required_key) + continue + value = data[required_key] + if value is unset: + required_keys_with_unset_values.append(required_key) + if missing_required_keys: + raise ApiTypeError( + '{} missing {} required arguments: {}'.format( + cls.__name__, len(missing_required_keys), missing_required_keys + ) + ) + if required_keys_with_unset_values: + raise ApiValueError( + '{} contains invalid unset values for {} required keys: {}'.format( + cls.__name__, len(required_keys_with_unset_values), required_keys_with_unset_values + ) + ) + + disallowed_additional_keys = [] + for key in data: + if key in cls.__required_keys__ or key in cls.__optional_keys__: + continue + disallowed_additional_keys.append(key) + if disallowed_additional_keys: + raise ApiTypeError( + '{} got {} unexpected keyword arguments: {}'.format( + cls.__name__, len(disallowed_additional_keys), disallowed_additional_keys + ) + ) + + def get_host( + self, + operation_id: str, + servers: typing.Tuple[typing.Dict[str, str], ...] = tuple(), + host_index: typing.Optional[int] = None + ) -> typing.Optional[str]: + configuration = self.api_client.configuration + try: + if host_index is None: + index = configuration.server_operation_index.get( + operation_id, configuration.server_index + ) + else: + index = host_index + server_variables = configuration.server_operation_variables.get( + operation_id, configuration.server_variables + ) + host = configuration.get_host_from_settings( + index, variables=server_variables, servers=servers + ) + except IndexError: + if servers: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(servers) + ) + host = None + return host + + +class SerializedRequestBody(typing.TypedDict, total=False): + body: typing.Union[str, bytes] + fields: typing.Tuple[typing.Union[RequestField, tuple[str, str]], ...] + + +class RequestBody(StyleFormSerializer): + """ + A request body parameter + content: content_type to MediaType Schema info + """ + __json_encoder = JSONEncoder() + + def __init__( + self, + content: typing.Dict[str, MediaType], + required: bool = False, + ): + self.required = required + if len(content) == 0: + raise ValueError('Invalid value for content, the content dict must have >= 1 entry') + self.content = content + + def __serialize_json( + self, + in_data: typing.Any + ) -> typing.Dict[str, bytes]: + in_data = self.__json_encoder.default(in_data) + json_str = json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode( + "utf-8" + ) + return dict(body=json_str) + + @staticmethod + def __serialize_text_plain(in_data: typing.Any) -> typing.Dict[str, str]: + if isinstance(in_data, frozendict): + raise ValueError('Unable to serialize type frozendict to text/plain') + elif isinstance(in_data, tuple): + raise ValueError('Unable to serialize type tuple to text/plain') + elif isinstance(in_data, NoneClass): + raise ValueError('Unable to serialize type NoneClass to text/plain') + elif isinstance(in_data, BoolClass): + raise ValueError('Unable to serialize type BoolClass to text/plain') + return dict(body=str(in_data)) + + def __multipart_json_item(self, key: str, value: Schema) -> RequestField: + json_value = self.__json_encoder.default(value) + return RequestField(name=key, data=json.dumps(json_value), headers={'Content-Type': 'application/json'}) + + def __multipart_form_item(self, key: str, value: Schema) -> RequestField: + if isinstance(value, str): + return RequestField(name=key, data=str(value), headers={'Content-Type': 'text/plain'}) + elif isinstance(value, bytes): + return RequestField(name=key, data=value, headers={'Content-Type': 'application/octet-stream'}) + elif isinstance(value, FileIO): + request_field = RequestField( + name=key, + data=value.read(), + filename=os.path.basename(value.name), + headers={'Content-Type': 'application/octet-stream'} + ) + value.close() + return request_field + else: + return self.__multipart_json_item(key=key, value=value) + + def __serialize_multipart_form_data( + self, in_data: Schema + ) -> typing.Dict[str, typing.Tuple[RequestField, ...]]: + if not isinstance(in_data, frozendict): + raise ValueError(f'Unable to serialize {in_data} to multipart/form-data because it is not a dict of data') + """ + In a multipart/form-data request body, each schema property, or each element of a schema array property, + takes a section in the payload with an internal header as defined by RFC7578. The serialization strategy + for each property of a multipart/form-data request body can be specified in an associated Encoding Object. + + When passing in multipart types, boundaries MAY be used to separate sections of the content being + transferred – thus, the following default Content-Types are defined for multipart: + + If the (object) property is a primitive, or an array of primitive values, the default Content-Type is text/plain + If the property is complex, or an array of complex values, the default Content-Type is application/json + Question: how is the array of primitives encoded? + If the property is a type: string with a contentEncoding, the default Content-Type is application/octet-stream + """ + fields = [] + for key, value in in_data.items(): + if isinstance(value, tuple): + if value: + # values use explode = True, so the code makes a RequestField for each item with name=key + for item in value: + request_field = self.__multipart_form_item(key=key, value=item) + fields.append(request_field) + else: + # send an empty array as json because exploding will not send it + request_field = self.__multipart_json_item(key=key, value=value) + fields.append(request_field) + else: + request_field = self.__multipart_form_item(key=key, value=value) + fields.append(request_field) + + return dict(fields=tuple(fields)) + + def __serialize_application_octet_stream(self, in_data: BinarySchema) -> typing.Dict[str, bytes]: + if isinstance(in_data, bytes): + return dict(body=in_data) + # FileIO type + result = dict(body=in_data.read()) + in_data.close() + return result + + def __serialize_application_x_www_form_data( + self, in_data: typing.Any + ) -> typing.Dict[str, tuple[tuple[str, str], ...]]: + if not isinstance(in_data, frozendict): + raise ValueError( + f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') + cast_in_data = self.__json_encoder.default(in_data) + fields = self._serialize_form(cast_in_data, explode=True, name='') + if not fields: + return {} + return {'fields': fields} + + def serialize( + self, in_data: typing.Any, content_type: str + ) -> SerializedRequestBody: + """ + If a str is returned then the result will be assigned to data when making the request + If a tuple is returned then the result will be used as fields input in encode_multipart_formdata + Return a tuple of + + The key of the return dict is + - body for application/json + - encode_multipart and fields for multipart/form-data + """ + media_type = self.content[content_type] + if isinstance(in_data, media_type.schema): + cast_in_data = in_data + elif isinstance(in_data, (dict, frozendict)) and in_data: + cast_in_data = media_type.schema(**in_data) + else: + cast_in_data = media_type.schema(in_data) + # TODO check for and use encoding if it exists + # and content_type is multipart or application/x-www-form-urlencoded + if content_type == 'application/json': + return self.__serialize_json(cast_in_data) + elif content_type == 'text/plain': + return self.__serialize_text_plain(cast_in_data) + elif content_type == 'multipart/form-data': + return self.__serialize_multipart_form_data(cast_in_data) + elif content_type == 'application/x-www-form-urlencoded': + return self.__serialize_application_x_www_form_data(cast_in_data) + elif content_type == 'application/octet-stream': + return self.__serialize_application_octet_stream(cast_in_data) + raise NotImplementedError('Serialization has not yet been implemented for {}'.format(content_type)) 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 00000000000..5a98862bba0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +# flake8: noqa + +# Import all APIs into this package. +# If you have many APIs here with many many models used in each API this may +# raise a `RecursionError`. +# In order to avoid this, import only the API that you directly need like: +# +# from .api.another_fake_api import AnotherFakeApi +# +# 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/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py new file mode 100644 index 00000000000..f7c2a3ff91e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -0,0 +1,610 @@ +# 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 +""" + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +from http import client as http_client +from petstore_api.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems', + 'uniqueItems', 'maxProperties', 'minProperties', +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param signing_info: Configuration parameters for the HTTP signature security scheme. + Must be an instance of petstore_api.signing.HttpSigningConfiguration + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + + + HTTP Signature Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: signature + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + +conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = petstore_api.signing.SCHEME_HS2019, + signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS, + signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET, + petstore_api.signing.HEADER_CREATED, + petstore_api.signing.HEADER_EXPIRES, + petstore_api.signing.HEADER_HOST, + petstore_api.signing.HEADER_DATE, + petstore_api.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + signing_info=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ): + """Constructor + """ + self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ + self.access_token = None + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + if name == "signing_info" and value is not None: + # Ensure the host paramater from signing info is the same as + # Configuration.host. + value.host = self.host + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'api_key' in self.api_key: + auth['api_key'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix( + 'api_key', + ), + } + if 'api_key_query' in self.api_key: + auth['api_key_query'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix( + 'api_key_query', + ), + } + if self.access_token is not None: + auth['bearer_test'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if self.username is not None and self.password is not None: + auth['http_basic_test'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + if self.signing_info is not None: + auth['http_signature_test'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } + if self.access_token is not None: + auth['petstore_auth'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://{server}.swagger.io:{port}/v2", + 'description': "petstore server", + 'variables': { + 'server': { + 'description': "No description provided", + 'default_value': "petstore", + 'enum_values': [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + 'port': { + 'description': "No description provided", + 'default_value': "80", + 'enum_values': [ + "80", + "8080" + ] + } + } + }, + { + 'url': "https://localhost:8080/{version}", + 'description': "The local server", + 'variables': { + 'version': { + 'description': "No description provided", + 'default_value': "v2", + 'enum_values': [ + "v1", + "v2" + ] + } + } + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py new file mode 100644 index 00000000000..ed422fd2d0e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -0,0 +1,136 @@ +# 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 +""" + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, api_response: 'petstore_api.api_client.ApiResponse' = None): + if api_response: + self.status = api_response.response.status + self.reason = api_response.response.reason + self.body = api_response.response.data + self.headers = api_response.response.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result 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 00000000000..027452f37a8 --- /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 petstore_api.models import ModelA, ModelB diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py new file mode 100644 index 00000000000..a5e4f0a45d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -0,0 +1,211 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class AdditionalPropertiesClass( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + map_property (dict,): + map_of_map_property (dict,): + anytype_1 (): + map_with_undeclared_properties_anytype_1 (dict,): + map_with_undeclared_properties_anytype_2 (dict,): + map_with_undeclared_properties_anytype_3 (dict,): + empty_map (dict,): an object with no declared properties and no undeclared properties, hence it's an empty map. + map_with_undeclared_properties_string (dict,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class map_property( + DictSchema + ): + _additional_properties = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class map_of_map_property( + DictSchema + ): + + + class _additional_properties( + DictSchema + ): + _additional_properties = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + anytype_1 = AnyTypeSchema + map_with_undeclared_properties_anytype_1 = DictSchema + map_with_undeclared_properties_anytype_2 = DictSchema + map_with_undeclared_properties_anytype_3 = DictSchema + + + class empty_map( + DictSchema + ): + _additional_properties = None + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class map_with_undeclared_properties_string( + DictSchema + ): + _additional_properties = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + map_property: typing.Union[map_property, Unset] = unset, + map_of_map_property: typing.Union[map_of_map_property, Unset] = unset, + anytype_1: typing.Union[anytype_1, Unset] = unset, + map_with_undeclared_properties_anytype_1: typing.Union[map_with_undeclared_properties_anytype_1, Unset] = unset, + map_with_undeclared_properties_anytype_2: typing.Union[map_with_undeclared_properties_anytype_2, Unset] = unset, + map_with_undeclared_properties_anytype_3: typing.Union[map_with_undeclared_properties_anytype_3, Unset] = unset, + empty_map: typing.Union[empty_map, Unset] = unset, + map_with_undeclared_properties_string: typing.Union[map_with_undeclared_properties_string, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + map_property=map_property, + map_of_map_property=map_of_map_property, + anytype_1=anytype_1, + map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, + map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, + map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, + empty_map=empty_map, + map_with_undeclared_properties_string=map_with_undeclared_properties_string, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py new file mode 100644 index 00000000000..db4d01003d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -0,0 +1,98 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class AdditionalPropertiesWithArrayOfEnums( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class _additional_properties( + ListSchema + ): + + @classmethod + @property + def _items(cls) -> typing.Type['EnumClass']: + return EnumClass + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.enum_class import EnumClass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py new file mode 100644 index 00000000000..d088fe45158 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -0,0 +1,87 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Address( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _additional_properties = IntSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py new file mode 100644 index 00000000000..783f9026bd5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -0,0 +1,112 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Animal( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + className (str,): + color (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + _required_property_names = set(( + 'className', + )) + className = StrSchema + color = StrSchema + + @classmethod + @property + def _discriminator(cls): + return { + 'className': { + 'Cat': Cat, + 'Dog': Dog, + } + } + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + className: className, + color: typing.Union[color, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + className=className, + color=color, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.cat import Cat +from petstore_api.model.dog import Dog diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py new file mode 100644 index 00000000000..1868ee5ee69 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -0,0 +1,78 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class AnimalFarm( + ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _items (Schema): the schema definition of the array items + """ + + @classmethod + @property + def _items(cls) -> typing.Type['Animal']: + return Animal + +from petstore_api.model.animal import Animal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py new file mode 100644 index 00000000000..505d16f177a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -0,0 +1,98 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ApiResponse( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + code (int,): + type (str,): + message (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + code = Int32Schema + type = StrSchema + message = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + code: typing.Union[code, Unset] = unset, + type: typing.Union[type, Unset] = unset, + message: typing.Union[message, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + code=code, + type=type, + message=message, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py new file mode 100644 index 00000000000..07991225ef5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -0,0 +1,120 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Apple( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + cultivar (str,): + origin (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'cultivar', + )) + + + class cultivar( + _SchemaValidator( + regex=[{ + 'pattern': r'^[a-zA-Z\s]*$', # noqa: E501 + }], + ), + StrSchema + ): + pass + + + class origin( + _SchemaValidator( + regex=[{ + 'pattern': r'^[A-Z\s]*$', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }], + ), + StrSchema + ): + pass + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + origin: typing.Union[origin, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + origin=origin, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py new file mode 100644 index 00000000000..c94a177b0ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -0,0 +1,94 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class AppleReq( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + cultivar (str,): + mealy (bool,): + """ + _required_property_names = set(( + 'cultivar', + )) + cultivar = StrSchema + mealy = BoolSchema + _additional_properties = None + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + cultivar: cultivar, + mealy: typing.Union[mealy, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + cultivar=cultivar, + mealy=mealy, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py new file mode 100644 index 00000000000..90f05d5eb12 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py @@ -0,0 +1,72 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ArrayHoldingAnyType( + ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _items (Schema): the schema definition of the array items + """ + _items = AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py new file mode 100644 index 00000000000..6f9cd63088b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -0,0 +1,100 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ArrayOfArrayOfNumberOnly( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + ArrayArrayNumber (tuple,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class ArrayArrayNumber( + ListSchema + ): + + + class _items( + ListSchema + ): + _items = NumberSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + ArrayArrayNumber: typing.Union[ArrayArrayNumber, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + ArrayArrayNumber=ArrayArrayNumber, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py new file mode 100644 index 00000000000..ddb90807d27 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -0,0 +1,78 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ArrayOfEnums( + ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _items (Schema): the schema definition of the array items + """ + + @classmethod + @property + def _items(cls) -> typing.Type['StringEnum']: + return StringEnum + +from petstore_api.model.string_enum import StringEnum diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py new file mode 100644 index 00000000000..1ee632533c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -0,0 +1,95 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ArrayOfNumberOnly( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + ArrayNumber (tuple,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class ArrayNumber( + ListSchema + ): + _items = NumberSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + ArrayNumber: typing.Union[ArrayNumber, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + ArrayNumber=ArrayNumber, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py new file mode 100644 index 00000000000..f69faad445e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -0,0 +1,129 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ArrayTest( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + array_of_string (tuple,): + array_array_of_integer (tuple,): + array_array_of_model (tuple,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class array_of_string( + ListSchema + ): + _items = StrSchema + + + class array_array_of_integer( + ListSchema + ): + + + class _items( + ListSchema + ): + _items = Int64Schema + + + class array_array_of_model( + ListSchema + ): + + + class _items( + ListSchema + ): + + @classmethod + @property + def _items(cls) -> typing.Type['ReadOnlyFirst']: + return ReadOnlyFirst + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + array_of_string: typing.Union[array_of_string, Unset] = unset, + array_array_of_integer: typing.Union[array_array_of_integer, Unset] = unset, + array_array_of_model: typing.Union[array_array_of_model, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + array_of_string=array_of_string, + array_array_of_integer=array_array_of_integer, + array_array_of_model=array_array_of_model, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py new file mode 100644 index 00000000000..b34bcf6c27f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py @@ -0,0 +1,87 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ArrayWithValidationsInItems( + _SchemaValidator( + max_items=2, + ), + ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _items (Schema): the schema definition of the array items + _validations (dict): the validations which apply to the current Schema + 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. + """ + + + class _items( + _SchemaValidator( + inclusive_maximum=7, + ), + Int64Schema + ): + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py new file mode 100644 index 00000000000..9cdf3cd55c6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -0,0 +1,93 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Banana( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + lengthCm (int, float,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'lengthCm', + )) + lengthCm = NumberSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + lengthCm: lengthCm, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + lengthCm=lengthCm, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py new file mode 100644 index 00000000000..1cf74f05e3e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -0,0 +1,94 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class BananaReq( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + lengthCm (int, float,): + sweet (bool,): + """ + _required_property_names = set(( + 'lengthCm', + )) + lengthCm = NumberSchema + sweet = BoolSchema + _additional_properties = None + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + lengthCm: lengthCm, + sweet: typing.Union[sweet, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + lengthCm=lengthCm, + sweet=sweet, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py new file mode 100644 index 00000000000..afbf24b8a22 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py @@ -0,0 +1,59 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +Bar = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py new file mode 100644 index 00000000000..c11f9ab4bf9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -0,0 +1,107 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class BasquePig( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + className (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'className', + )) + + + class className( + _SchemaEnumMaker( + enum_value_to_name={ + "BasquePig": "BASQUEPIG", + } + ), + StrSchema + ): + + @classmethod + @property + def BASQUEPIG(cls): + return cls._enum_by_value["BasquePig"]("BasquePig") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + className: className, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + className=className, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py new file mode 100644 index 00000000000..e9f974616fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py @@ -0,0 +1,59 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +Boolean = BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py new file mode 100644 index 00000000000..50b7181cc7e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py @@ -0,0 +1,80 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class BooleanEnum( + _SchemaEnumMaker( + enum_value_to_name={ + True: "TRUE", + } + ), + BoolSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def TRUE(cls): + return cls._enum_by_value[True](True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py new file mode 100644 index 00000000000..8b508242ff2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -0,0 +1,110 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Capitalization( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + smallCamel (str,): + CapitalCamel (str,): + small_Snake (str,): + Capital_Snake (str,): + SCA_ETH_Flow_Points (str,): + ATT_NAME (str,): Name of the pet + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + smallCamel = StrSchema + CapitalCamel = StrSchema + small_Snake = StrSchema + Capital_Snake = StrSchema + SCA_ETH_Flow_Points = StrSchema + ATT_NAME = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + smallCamel: typing.Union[smallCamel, Unset] = unset, + CapitalCamel: typing.Union[CapitalCamel, Unset] = unset, + small_Snake: typing.Union[small_Snake, Unset] = unset, + Capital_Snake: typing.Union[Capital_Snake, Unset] = unset, + SCA_ETH_Flow_Points: typing.Union[SCA_ETH_Flow_Points, Unset] = unset, + ATT_NAME: typing.Union[ATT_NAME, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + smallCamel=smallCamel, + CapitalCamel=CapitalCamel, + small_Snake=small_Snake, + Capital_Snake=Capital_Snake, + SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, + ATT_NAME=ATT_NAME, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py new file mode 100644 index 00000000000..080d2bde5b8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Cat( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + Animal, + CatAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.animal import Animal +from petstore_api.model.cat_all_of import CatAllOf diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py new file mode 100644 index 00000000000..b08ff9b66f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -0,0 +1,90 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class CatAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + declawed (bool,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + declawed = BoolSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + declawed: typing.Union[declawed, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + declawed=declawed, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py new file mode 100644 index 00000000000..abc7c3fc95a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -0,0 +1,97 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Category( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + id (int,): + name (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'name', + )) + id = Int64Schema + name = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + name: name, + id: typing.Union[id, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + id=id, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py new file mode 100644 index 00000000000..e33b977dea1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ChildCat( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ParentPet, + ChildCatAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.child_cat_all_of import ChildCatAllOf +from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py new file mode 100644 index 00000000000..aadedf15481 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -0,0 +1,90 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ChildCatAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + name (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + name = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + name: typing.Union[name, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py new file mode 100644 index 00000000000..54118dfb5d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -0,0 +1,91 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ClassModel( + AnyTypeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Model for testing model with "_class" property + + Attributes: + _class (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _class = StrSchema + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _class: typing.Union[_class, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _class=_class, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py new file mode 100644 index 00000000000..713b3156872 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -0,0 +1,90 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Client( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + client (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + client = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + client: typing.Union[client, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + client=client, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py new file mode 100644 index 00000000000..8a7f81af753 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComplexQuadrilateral( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + QuadrilateralInterface, + ComplexQuadrilateralAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.complex_quadrilateral_all_of import ComplexQuadrilateralAllOf +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py new file mode 100644 index 00000000000..095c96095ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py @@ -0,0 +1,104 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComplexQuadrilateralAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + quadrilateralType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class quadrilateralType( + _SchemaEnumMaker( + enum_value_to_name={ + "ComplexQuadrilateral": "COMPLEXQUADRILATERAL", + } + ), + StrSchema + ): + + @classmethod + @property + def COMPLEXQUADRILATERAL(cls): + return cls._enum_by_value["ComplexQuadrilateral"]("ComplexQuadrilateral") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + quadrilateralType=quadrilateralType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py new file mode 100644 index 00000000000..fb200660c6e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py @@ -0,0 +1,141 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedAnyOfDifferentTypesNoValidations( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + anyOf_0 = DictSchema + anyOf_1 = DateSchema + anyOf_2 = DateTimeSchema + anyOf_3 = BinarySchema + anyOf_4 = StrSchema + anyOf_5 = StrSchema + anyOf_6 = DictSchema + anyOf_7 = BoolSchema + anyOf_8 = NoneSchema + + + class anyOf_9( + ListSchema + ): + _items = AnyTypeSchema + anyOf_10 = NumberSchema + anyOf_11 = Float32Schema + anyOf_12 = Float64Schema + anyOf_13 = IntSchema + anyOf_14 = Int32Schema + anyOf_15 = Int64Schema + return { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + anyOf_0, + anyOf_1, + anyOf_2, + anyOf_3, + anyOf_4, + anyOf_5, + anyOf_6, + anyOf_7, + anyOf_8, + anyOf_9, + anyOf_10, + anyOf_11, + anyOf_12, + anyOf_13, + anyOf_14, + anyOf_15, + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py new file mode 100644 index 00000000000..6a9d0e19c3f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py @@ -0,0 +1,72 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedArray( + ListSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _items (Schema): the schema definition of the array items + """ + _items = AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py new file mode 100644 index 00000000000..b74990ba87a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py @@ -0,0 +1,103 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedBool( + ComposedBase, + BoolSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + allOf_0 = AnyTypeSchema + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[bool, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py new file mode 100644 index 00000000000..ac6f516344f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py @@ -0,0 +1,103 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedNone( + ComposedBase, + NoneSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + allOf_0 = AnyTypeSchema + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py new file mode 100644 index 00000000000..e932e138bcc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py @@ -0,0 +1,103 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedNumber( + ComposedBase, + NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + allOf_0 = AnyTypeSchema + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[float, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py new file mode 100644 index 00000000000..92942e256c4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py @@ -0,0 +1,107 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedObject( + ComposedBase, + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + allOf_0 = AnyTypeSchema + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py new file mode 100644 index 00000000000..0a454dbceed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py @@ -0,0 +1,162 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedOneOfDifferentTypes( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + this is a model that allows payloads of type object or number + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + oneOf_2 = NoneSchema + oneOf_3 = DateSchema + + + class oneOf_4( + _SchemaValidator( + max_properties=4, + min_properties=4, + ), + DictSchema + ): + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class oneOf_5( + _SchemaValidator( + max_items=4, + min_items=4, + ), + ListSchema + ): + _items = AnyTypeSchema + + + class oneOf_6( + _SchemaValidator( + regex=[{ + 'pattern': r'^2020.*', # noqa: E501 + }], + ), + DateTimeSchema + ): + pass + return { + 'allOf': [ + ], + 'oneOf': [ + NumberWithValidations, + Animal, + oneOf_2, + oneOf_3, + oneOf_4, + oneOf_5, + oneOf_6, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.animal import Animal +from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py new file mode 100644 index 00000000000..dec60c328ef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py @@ -0,0 +1,103 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ComposedString( + ComposedBase, + StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + allOf_0 = AnyTypeSchema + return { + 'allOf': [ + allOf_0, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[str, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py new file mode 100644 index 00000000000..d269be73d17 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -0,0 +1,107 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class DanishPig( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + className (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'className', + )) + + + class className( + _SchemaEnumMaker( + enum_value_to_name={ + "DanishPig": "DANISHPIG", + } + ), + StrSchema + ): + + @classmethod + @property + def DANISHPIG(cls): + return cls._enum_by_value["DanishPig"]("DanishPig") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + className: className, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + className=className, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py new file mode 100644 index 00000000000..837edc52f03 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py @@ -0,0 +1,59 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +DateTimeTest = DateTimeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py new file mode 100644 index 00000000000..d7bc79a11f9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py @@ -0,0 +1,80 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class DateTimeWithValidations( + _SchemaValidator( + regex=[{ + 'pattern': r'^2020.*', # noqa: E501 + }], + ), + DateTimeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py new file mode 100644 index 00000000000..a61d8da1b01 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py @@ -0,0 +1,80 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class DateWithValidations( + _SchemaValidator( + regex=[{ + 'pattern': r'^2020.*', # noqa: E501 + }], + ), + DateSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py new file mode 100644 index 00000000000..dbfc2b13770 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Dog( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + Animal, + DogAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.animal import Animal +from petstore_api.model.dog_all_of import DogAllOf diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py new file mode 100644 index 00000000000..1767fc983ae --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -0,0 +1,90 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class DogAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + breed (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + breed = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + breed: typing.Union[breed, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + breed=breed, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py new file mode 100644 index 00000000000..5196bd01cce --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -0,0 +1,133 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Drawing( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + mainShape (): + shapeOrNull (): + nullableShape (): + shapes (tuple,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def mainShape(cls) -> typing.Type['Shape']: + return Shape + + @classmethod + @property + def shapeOrNull(cls) -> typing.Type['ShapeOrNull']: + return ShapeOrNull + + @classmethod + @property + def nullableShape(cls) -> typing.Type['NullableShape']: + return NullableShape + + + class shapes( + ListSchema + ): + + @classmethod + @property + def _items(cls) -> typing.Type['Shape']: + return Shape + + @classmethod + @property + def _additional_properties(cls) -> typing.Type['Fruit']: + return Fruit + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + mainShape: typing.Union['Shape', Unset] = unset, + shapeOrNull: typing.Union['ShapeOrNull', Unset] = unset, + nullableShape: typing.Union['NullableShape', Unset] = unset, + shapes: typing.Union[shapes, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + mainShape=mainShape, + shapeOrNull=shapeOrNull, + nullableShape=nullableShape, + shapes=shapes, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.fruit import Fruit +from petstore_api.model.nullable_shape import NullableShape +from petstore_api.model.shape import Shape +from petstore_api.model.shape_or_null import ShapeOrNull diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py new file mode 100644 index 00000000000..54d293edd16 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -0,0 +1,139 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class EnumArrays( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + just_symbol (str,): + array_enum (tuple,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class just_symbol( + _SchemaEnumMaker( + enum_value_to_name={ + ">=": "GREATER_THAN_EQUALS", + "$": "DOLLAR", + } + ), + StrSchema + ): + + @classmethod + @property + def GREATER_THAN_EQUALS(cls): + return cls._enum_by_value[">="](">=") + + @classmethod + @property + def DOLLAR(cls): + return cls._enum_by_value["$"]("$") + + + class array_enum( + ListSchema + ): + + + class _items( + _SchemaEnumMaker( + enum_value_to_name={ + "fish": "FISH", + "crab": "CRAB", + } + ), + StrSchema + ): + + @classmethod + @property + def FISH(cls): + return cls._enum_by_value["fish"]("fish") + + @classmethod + @property + def CRAB(cls): + return cls._enum_by_value["crab"]("crab") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + just_symbol: typing.Union[just_symbol, Unset] = unset, + array_enum: typing.Union[array_enum, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + just_symbol=just_symbol, + array_enum=array_enum, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py new file mode 100644 index 00000000000..475c1dd6ca2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class EnumClass( + _SchemaEnumMaker( + enum_value_to_name={ + "_abc": "_ABC", + "-efg": "EFG", + "(xyz)": "XYZ", + } + ), + StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def _ABC(cls): + return cls._enum_by_value["_abc"]("_abc") + + @classmethod + @property + def EFG(cls): + return cls._enum_by_value["-efg"]("-efg") + + @classmethod + @property + def XYZ(cls): + return cls._enum_by_value["(xyz)"]("(xyz)") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py new file mode 100644 index 00000000000..77769e3cd74 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -0,0 +1,243 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class EnumTest( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + enum_string (str,): + enum_string_required (str,): + enum_integer (int,): + enum_number (float,): + stringEnum (): + IntegerEnum (): + StringEnumWithDefaultValue (): + IntegerEnumWithDefaultValue (): + IntegerEnumOneValue (): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'enum_string_required', + )) + + + class enum_string( + _SchemaEnumMaker( + enum_value_to_name={ + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + ), + StrSchema + ): + + @classmethod + @property + def UPPER(cls): + return cls._enum_by_value["UPPER"]("UPPER") + + @classmethod + @property + def LOWER(cls): + return cls._enum_by_value["lower"]("lower") + + @classmethod + @property + def EMPTY(cls): + return cls._enum_by_value[""]("") + + + class enum_string_required( + _SchemaEnumMaker( + enum_value_to_name={ + "UPPER": "UPPER", + "lower": "LOWER", + "": "EMPTY", + } + ), + StrSchema + ): + + @classmethod + @property + def UPPER(cls): + return cls._enum_by_value["UPPER"]("UPPER") + + @classmethod + @property + def LOWER(cls): + return cls._enum_by_value["lower"]("lower") + + @classmethod + @property + def EMPTY(cls): + return cls._enum_by_value[""]("") + + + class enum_integer( + _SchemaEnumMaker( + enum_value_to_name={ + 1: "POSITIVE_1", + -1: "NEGATIVE_1", + } + ), + Int32Schema + ): + + @classmethod + @property + def POSITIVE_1(cls): + return cls._enum_by_value[1](1) + + @classmethod + @property + def NEGATIVE_1(cls): + return cls._enum_by_value[-1](-1) + + + class enum_number( + _SchemaEnumMaker( + enum_value_to_name={ + 1.1: "POSITIVE_1_PT_1", + -1.2: "NEGATIVE_1_PT_2", + } + ), + Float64Schema + ): + + @classmethod + @property + def POSITIVE_1_PT_1(cls): + return cls._enum_by_value[1.1](1.1) + + @classmethod + @property + def NEGATIVE_1_PT_2(cls): + return cls._enum_by_value[-1.2](-1.2) + + @classmethod + @property + def stringEnum(cls) -> typing.Type['StringEnum']: + return StringEnum + + @classmethod + @property + def IntegerEnum(cls) -> typing.Type['IntegerEnum']: + return IntegerEnum + + @classmethod + @property + def StringEnumWithDefaultValue(cls) -> typing.Type['StringEnumWithDefaultValue']: + return StringEnumWithDefaultValue + + @classmethod + @property + def IntegerEnumWithDefaultValue(cls) -> typing.Type['IntegerEnumWithDefaultValue']: + return IntegerEnumWithDefaultValue + + @classmethod + @property + def IntegerEnumOneValue(cls) -> typing.Type['IntegerEnumOneValue']: + return IntegerEnumOneValue + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + enum_string_required: enum_string_required, + enum_string: typing.Union[enum_string, Unset] = unset, + enum_integer: typing.Union[enum_integer, Unset] = unset, + enum_number: typing.Union[enum_number, Unset] = unset, + stringEnum: typing.Union['StringEnum', Unset] = unset, + IntegerEnum: typing.Union['IntegerEnum', Unset] = unset, + StringEnumWithDefaultValue: typing.Union['StringEnumWithDefaultValue', Unset] = unset, + IntegerEnumWithDefaultValue: typing.Union['IntegerEnumWithDefaultValue', Unset] = unset, + IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + enum_string_required=enum_string_required, + enum_string=enum_string, + enum_integer=enum_integer, + enum_number=enum_number, + stringEnum=stringEnum, + IntegerEnum=IntegerEnum, + StringEnumWithDefaultValue=StringEnumWithDefaultValue, + IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, + IntegerEnumOneValue=IntegerEnumOneValue, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.integer_enum import IntegerEnum +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py new file mode 100644 index 00000000000..69bf6944cf7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class EquilateralTriangle( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + TriangleInterface, + EquilateralTriangleAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.equilateral_triangle_all_of import EquilateralTriangleAllOf +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py new file mode 100644 index 00000000000..fb6edf7c749 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py @@ -0,0 +1,104 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class EquilateralTriangleAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + triangleType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class triangleType( + _SchemaEnumMaker( + enum_value_to_name={ + "EquilateralTriangle": "EQUILATERALTRIANGLE", + } + ), + StrSchema + ): + + @classmethod + @property + def EQUILATERALTRIANGLE(cls): + return cls._enum_by_value["EquilateralTriangle"]("EquilateralTriangle") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + triangleType: typing.Union[triangleType, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + triangleType=triangleType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py new file mode 100644 index 00000000000..30ccd52a5f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class File( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Must be named `File` for test. + + Attributes: + sourceURI (str,): Test capitalization + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + sourceURI = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + sourceURI: typing.Union[sourceURI, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + sourceURI=sourceURI, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py new file mode 100644 index 00000000000..f0f6f4d9d83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class FileSchemaTestClass( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + file (): + files (tuple,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def file(cls) -> typing.Type['File']: + return File + + + class files( + ListSchema + ): + + @classmethod + @property + def _items(cls) -> typing.Type['File']: + return File + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + file: typing.Union['File', Unset] = unset, + files: typing.Union[files, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + file=file, + files=files, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.file import File diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py new file mode 100644 index 00000000000..2160642188d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -0,0 +1,90 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Foo( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + bar (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + bar = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + bar: typing.Union[bar, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + bar=bar, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py new file mode 100644 index 00000000000..913a2a90d1b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -0,0 +1,276 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class FormatTest( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + integer (int,): + int32 (int,): + int32withValidations (int,): + int64 (int,): + number (int, float,): + float (float,): this is a reserved python keyword + float32 (float,): + double (float,): + float64 (float,): + arrayWithUniqueItems (tuple,): + string (str,): + byte (str,): + binary (): + date (date,): + dateTime (datetime,): + uuid (str,): + uuidNoExample (str,): + password (str,): + pattern_with_digits (str,): A string that is a 10 digit number. Can have leading zeros. + pattern_with_digits_and_delimiter (str,): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + noneProp ( none_type,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'number', + 'byte', + 'date', + 'password', + )) + + + class integer( + _SchemaValidator( + inclusive_maximum=100, + inclusive_minimum=10, + multiple_of=[2], + ), + IntSchema + ): + pass + int32 = Int32Schema + + + class int32withValidations( + _SchemaValidator( + inclusive_maximum=200, + inclusive_minimum=20, + ), + Int32Schema + ): + pass + int64 = Int64Schema + + + class number( + _SchemaValidator( + inclusive_maximum=543.2, + inclusive_minimum=32.1, + multiple_of=[32.5], + ), + NumberSchema + ): + pass + + + class _float( + _SchemaValidator( + inclusive_maximum=987.6, + inclusive_minimum=54.3, + ), + Float32Schema + ): + pass + locals()['float'] = _float + del locals()['_float'] + float32 = Float32Schema + + + class double( + _SchemaValidator( + inclusive_maximum=123.4, + inclusive_minimum=67.8, + ), + Float64Schema + ): + pass + float64 = Float64Schema + + + class arrayWithUniqueItems( + _SchemaValidator( + unique_items=True, + ), + ListSchema + ): + _items = NumberSchema + + + class string( + _SchemaValidator( + regex=[{ + 'pattern': r'[a-z]', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }], + ), + StrSchema + ): + pass + byte = StrSchema + binary = BinarySchema + date = DateSchema + dateTime = DateTimeSchema + uuid = StrSchema + uuidNoExample = StrSchema + + + class password( + _SchemaValidator( + max_length=64, + min_length=10, + ), + StrSchema + ): + pass + + + class pattern_with_digits( + _SchemaValidator( + regex=[{ + 'pattern': r'^\d{10}$', # noqa: E501 + }], + ), + StrSchema + ): + pass + + + class pattern_with_digits_and_delimiter( + _SchemaValidator( + regex=[{ + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': ( + re.IGNORECASE + ) + }], + ), + StrSchema + ): + pass + noneProp = NoneSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + number: number, + byte: byte, + date: date, + password: password, + integer: typing.Union[integer, Unset] = unset, + int32: typing.Union[int32, Unset] = unset, + int32withValidations: typing.Union[int32withValidations, Unset] = unset, + int64: typing.Union[int64, Unset] = unset, + float32: typing.Union[float32, Unset] = unset, + double: typing.Union[double, Unset] = unset, + float64: typing.Union[float64, Unset] = unset, + arrayWithUniqueItems: typing.Union[arrayWithUniqueItems, Unset] = unset, + string: typing.Union[string, Unset] = unset, + binary: typing.Union[binary, Unset] = unset, + dateTime: typing.Union[dateTime, Unset] = unset, + uuid: typing.Union[uuid, Unset] = unset, + uuidNoExample: typing.Union[uuidNoExample, Unset] = unset, + pattern_with_digits: typing.Union[pattern_with_digits, Unset] = unset, + pattern_with_digits_and_delimiter: typing.Union[pattern_with_digits_and_delimiter, Unset] = unset, + noneProp: typing.Union[noneProp, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + number=number, + byte=byte, + date=date, + password=password, + integer=integer, + int32=int32, + int32withValidations=int32withValidations, + int64=int64, + float32=float32, + double=double, + float64=float64, + arrayWithUniqueItems=arrayWithUniqueItems, + string=string, + binary=binary, + dateTime=dateTime, + uuid=uuid, + uuidNoExample=uuidNoExample, + pattern_with_digits=pattern_with_digits, + pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, + noneProp=noneProp, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py new file mode 100644 index 00000000000..77d38d632d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -0,0 +1,113 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Fruit( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + color (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + color = StrSchema + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + Apple, + Banana, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + color: typing.Union[color, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + color=color, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py new file mode 100644 index 00000000000..37fcf71a44b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -0,0 +1,111 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class FruitReq( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + oneOf_0 = NoneSchema + return { + 'allOf': [ + ], + 'oneOf': [ + oneOf_0, + AppleReq, + BananaReq, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.apple_req import AppleReq +from petstore_api.model.banana_req import BananaReq diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py new file mode 100644 index 00000000000..ab342907147 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -0,0 +1,113 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class GmFruit( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + color (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + color = StrSchema + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + ], + 'anyOf': [ + Apple, + Banana, + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + color: typing.Union[color, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + color=color, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py new file mode 100644 index 00000000000..f5625407bc7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -0,0 +1,108 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class GrandparentAnimal( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + pet_type (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + _required_property_names = set(( + 'pet_type', + )) + pet_type = StrSchema + + @classmethod + @property + def _discriminator(cls): + return { + 'pet_type': { + 'ChildCat': ChildCat, + 'ParentPet': ParentPet, + } + } + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + pet_type: pet_type, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + pet_type=pet_type, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py new file mode 100644 index 00000000000..3a84082bd47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -0,0 +1,94 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class HasOnlyReadOnly( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + bar (str,): + foo (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + bar = StrSchema + foo = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + bar: typing.Union[bar, Unset] = unset, + foo: typing.Union[foo, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + bar=bar, + foo=foo, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py new file mode 100644 index 00000000000..9cf48be2b36 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -0,0 +1,110 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class HealthCheckResult( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + + Attributes: + NullableMessage (str, none_type,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class NullableMessage( + _SchemaTypeChecker(typing.Union[none_type, str, ]), + StrBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[str, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + NullableMessage: typing.Union[NullableMessage, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + NullableMessage=NullableMessage, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py new file mode 100644 index 00000000000..6b0f32db72a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -0,0 +1,96 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class InlineResponseDefault( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + string (): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def string(cls) -> typing.Type['Foo']: + return Foo + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + string: typing.Union['Foo', Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + string=string, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.foo import Foo diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py new file mode 100644 index 00000000000..02a228957b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IntegerEnum( + _SchemaEnumMaker( + enum_value_to_name={ + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", + } + ), + IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls._enum_by_value[0](0) + + @classmethod + @property + def POSITIVE_1(cls): + return cls._enum_by_value[1](1) + + @classmethod + @property + def POSITIVE_2(cls): + return cls._enum_by_value[2](2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py new file mode 100644 index 00000000000..babc39df7d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IntegerEnumBig( + _SchemaEnumMaker( + enum_value_to_name={ + 10: "POSITIVE_10", + 11: "POSITIVE_11", + 12: "POSITIVE_12", + } + ), + IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def POSITIVE_10(cls): + return cls._enum_by_value[10](10) + + @classmethod + @property + def POSITIVE_11(cls): + return cls._enum_by_value[11](11) + + @classmethod + @property + def POSITIVE_12(cls): + return cls._enum_by_value[12](12) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py new file mode 100644 index 00000000000..fa7e4258cbb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -0,0 +1,80 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IntegerEnumOneValue( + _SchemaEnumMaker( + enum_value_to_name={ + 0: "POSITIVE_0", + } + ), + IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls._enum_by_value[0](0) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py new file mode 100644 index 00000000000..cb5860a0bdb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IntegerEnumWithDefaultValue( + _SchemaEnumMaker( + enum_value_to_name={ + 0: "POSITIVE_0", + 1: "POSITIVE_1", + 2: "POSITIVE_2", + } + ), + IntSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def POSITIVE_0(cls): + return cls._enum_by_value[0](0) + + @classmethod + @property + def POSITIVE_1(cls): + return cls._enum_by_value[1](1) + + @classmethod + @property + def POSITIVE_2(cls): + return cls._enum_by_value[2](2) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py new file mode 100644 index 00000000000..affe4283ac6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py @@ -0,0 +1,78 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IntegerMax10( + _SchemaValidator( + inclusive_maximum=10, + ), + Int64Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py new file mode 100644 index 00000000000..6a6488136d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py @@ -0,0 +1,78 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IntegerMin15( + _SchemaValidator( + inclusive_minimum=15, + ), + Int64Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py new file mode 100644 index 00000000000..b8527d08df5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IsoscelesTriangle( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + TriangleInterface, + IsoscelesTriangleAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.isosceles_triangle_all_of import IsoscelesTriangleAllOf +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py new file mode 100644 index 00000000000..8d9bc65556f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py @@ -0,0 +1,104 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class IsoscelesTriangleAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + triangleType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class triangleType( + _SchemaEnumMaker( + enum_value_to_name={ + "IsoscelesTriangle": "ISOSCELESTRIANGLE", + } + ), + StrSchema + ): + + @classmethod + @property + def ISOSCELESTRIANGLE(cls): + return cls._enum_by_value["IsoscelesTriangle"]("IsoscelesTriangle") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + triangleType: typing.Union[triangleType, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + triangleType=triangleType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py new file mode 100644 index 00000000000..fd1784636b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -0,0 +1,124 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Mammal( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'className': { + 'Pig': Pig, + 'whale': Whale, + 'zebra': Zebra, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + Whale, + Zebra, + Pig, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.pig import Pig +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/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py new file mode 100644 index 00000000000..90e2f053e68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -0,0 +1,204 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class MapTest( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + map_map_of_string (dict,): + map_of_enum_string (dict,): + direct_map (dict,): + indirect_map (): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class map_map_of_string( + DictSchema + ): + + + class _additional_properties( + DictSchema + ): + _additional_properties = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class map_of_enum_string( + DictSchema + ): + + + class _additional_properties( + _SchemaEnumMaker( + enum_value_to_name={ + "UPPER": "UPPER", + "lower": "LOWER", + } + ), + StrSchema + ): + + @classmethod + @property + def UPPER(cls): + return cls._enum_by_value["UPPER"]("UPPER") + + @classmethod + @property + def LOWER(cls): + return cls._enum_by_value["lower"]("lower") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class direct_map( + DictSchema + ): + _additional_properties = BoolSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + @classmethod + @property + def indirect_map(cls) -> typing.Type['StringBooleanMap']: + return StringBooleanMap + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + map_map_of_string: typing.Union[map_map_of_string, Unset] = unset, + map_of_enum_string: typing.Union[map_of_enum_string, Unset] = unset, + direct_map: typing.Union[direct_map, Unset] = unset, + indirect_map: typing.Union['StringBooleanMap', Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + map_map_of_string=map_map_of_string, + map_of_enum_string=map_of_enum_string, + direct_map=direct_map, + indirect_map=indirect_map, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.string_boolean_map import StringBooleanMap diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..e3a39533757 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,121 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class MixedPropertiesAndAdditionalPropertiesClass( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + uuid (str,): + dateTime (datetime,): + map (dict,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + uuid = StrSchema + dateTime = DateTimeSchema + + + class map( + DictSchema + ): + + @classmethod + @property + def _additional_properties(cls) -> typing.Type['Animal']: + return Animal + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + uuid: typing.Union[uuid, Unset] = unset, + dateTime: typing.Union[dateTime, Unset] = unset, + map: typing.Union[map, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + uuid=uuid, + dateTime=dateTime, + map=map, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py new file mode 100644 index 00000000000..c47980d5a7f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -0,0 +1,95 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Model200Response( + AnyTypeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + model with an invalid class name for python, starts with a number + + Attributes: + name (int,): + class (str,): this is a reserved python keyword + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + name = Int32Schema + _class = StrSchema + locals()['class'] = _class + del locals()['_class'] + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + name: typing.Union[name, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py new file mode 100644 index 00000000000..81116280224 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -0,0 +1,91 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ModelReturn( + AnyTypeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Model for testing reserved words + + Attributes: + return (int,): this is a reserved python keyword + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _return = Int32Schema + locals()['return'] = _return + del locals()['_return'] + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py new file mode 100644 index 00000000000..7343223c4d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -0,0 +1,102 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Name( + AnyTypeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Model for testing model name same as property name + + Attributes: + name (int,): + snake_case (int,): + property (str,): this is a reserved python keyword + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'name', + )) + name = Int32Schema + snake_case = Int32Schema + _property = StrSchema + locals()['property'] = _property + del locals()['_property'] + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + name: name, + snake_case: typing.Union[snake_case, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + snake_case=snake_case, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py new file mode 100644 index 00000000000..910b8bc1f11 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py @@ -0,0 +1,94 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class NoAdditionalProperties( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + id (int,): + petId (int,): + """ + _required_property_names = set(( + 'id', + )) + id = Int64Schema + petId = Int64Schema + _additional_properties = None + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + id: id, + petId: typing.Union[petId, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + id=id, + petId=petId, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py new file mode 100644 index 00000000000..45743da4394 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -0,0 +1,425 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class NullableClass( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + integer_prop (int, none_type,): + number_prop (int, float, none_type,): + boolean_prop (bool, none_type,): + string_prop (str, none_type,): + date_prop (date, none_type,): + datetime_prop (datetime, none_type,): + array_nullable_prop (tuple, none_type,): + array_and_items_nullable_prop (tuple, none_type,): + array_items_nullable (tuple,): + object_nullable_prop (dict, none_type,): + object_and_items_nullable_prop (dict, none_type,): + object_items_nullable (dict,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class integer_prop( + _SchemaTypeChecker(typing.Union[none_type, Decimal, ]), + IntBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[int, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class number_prop( + _SchemaTypeChecker(typing.Union[none_type, Decimal, ]), + NumberBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[float, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class boolean_prop( + _SchemaTypeChecker(typing.Union[none_type, bool, ]), + BoolBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[bool, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class string_prop( + _SchemaTypeChecker(typing.Union[none_type, str, ]), + StrBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[str, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class date_prop( + _SchemaTypeChecker(typing.Union[none_type, str, ]), + DateBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class datetime_prop( + _SchemaTypeChecker(typing.Union[none_type, str, ]), + DateTimeBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class array_nullable_prop( + _SchemaTypeChecker(typing.Union[tuple, none_type, ]), + ListBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[list, tuple, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class array_and_items_nullable_prop( + _SchemaTypeChecker(typing.Union[tuple, none_type, ]), + ListBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[list, tuple, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) + + + class array_items_nullable( + ListSchema + ): + + + class _items( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class object_nullable_prop( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + _additional_properties = DictSchema + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class object_and_items_nullable_prop( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + + + class _additional_properties( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class object_items_nullable( + DictSchema + ): + + + class _additional_properties( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + class _additional_properties( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + integer_prop: typing.Union[integer_prop, Unset] = unset, + number_prop: typing.Union[number_prop, Unset] = unset, + boolean_prop: typing.Union[boolean_prop, Unset] = unset, + string_prop: typing.Union[string_prop, Unset] = unset, + date_prop: typing.Union[date_prop, Unset] = unset, + datetime_prop: typing.Union[datetime_prop, Unset] = unset, + array_nullable_prop: typing.Union[array_nullable_prop, Unset] = unset, + array_and_items_nullable_prop: typing.Union[array_and_items_nullable_prop, Unset] = unset, + array_items_nullable: typing.Union[array_items_nullable, Unset] = unset, + object_nullable_prop: typing.Union[object_nullable_prop, Unset] = unset, + object_and_items_nullable_prop: typing.Union[object_and_items_nullable_prop, Unset] = unset, + object_items_nullable: typing.Union[object_items_nullable, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + integer_prop=integer_prop, + number_prop=number_prop, + boolean_prop=boolean_prop, + string_prop=string_prop, + date_prop=date_prop, + datetime_prop=datetime_prop, + array_nullable_prop=array_nullable_prop, + array_and_items_nullable_prop=array_and_items_nullable_prop, + array_items_nullable=array_items_nullable, + object_nullable_prop=object_nullable_prop, + object_and_items_nullable_prop=object_and_items_nullable_prop, + object_items_nullable=object_items_nullable, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py new file mode 100644 index 00000000000..7c4e3079234 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -0,0 +1,125 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class NullableShape( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + 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. For a nullable composed schema to work, one of its chosen oneOf schemas must be type null + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + oneOf_2 = NoneSchema + return { + 'allOf': [ + ], + 'oneOf': [ + Triangle, + Quadrilateral, + oneOf_2, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py new file mode 100644 index 00000000000..2386522587d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py @@ -0,0 +1,84 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class NullableString( + _SchemaTypeChecker(typing.Union[none_type, str, ]), + StrBase, + NoneBase, + Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + def __new__( + cls, + *args: typing.Union[str, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py new file mode 100644 index 00000000000..c4c4695e8be --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py @@ -0,0 +1,59 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +Number = NumberSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py new file mode 100644 index 00000000000..ff476caf032 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -0,0 +1,90 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class NumberOnly( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + JustNumber (int, float,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + JustNumber = NumberSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + JustNumber: typing.Union[JustNumber, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + JustNumber=JustNumber, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py new file mode 100644 index 00000000000..25ec9cdf00f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -0,0 +1,79 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class NumberWithValidations( + _SchemaValidator( + inclusive_maximum=20, + inclusive_minimum=10, + ), + NumberSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py new file mode 100644 index 00000000000..a5e32358a31 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py @@ -0,0 +1,59 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +ObjectInterface = DictSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py new file mode 100644 index 00000000000..99ca8288ee8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -0,0 +1,106 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ObjectModelWithRefProps( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations + + Attributes: + myNumber (): + myString (str,): + myBoolean (bool,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def myNumber(cls) -> typing.Type['NumberWithValidations']: + return NumberWithValidations + myString = StrSchema + myBoolean = BoolSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + myNumber: typing.Union['NumberWithValidations', Unset] = unset, + myString: typing.Union[myString, Unset] = unset, + myBoolean: typing.Union[myBoolean, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + myNumber=myNumber, + myString=myString, + myBoolean=myBoolean, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.number_with_validations import NumberWithValidations diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py new file mode 100644 index 00000000000..11c22fd99f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py @@ -0,0 +1,103 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ObjectWithDifficultlyNamedProps( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + model with properties that have invalid names for python + + Attributes: + $special[property.name] (int,): + 123-list (str,): + 123Number (int,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + '123-list', + )) + special_property_name = Int64Schema + locals()['$special[property.name]'] = special_property_name + del locals()['special_property_name'] + _123_list = StrSchema + locals()['123-list'] = _123_list + del locals()['_123_list'] + _123_number = IntSchema + locals()['123Number'] = _123_number + del locals()['_123_number'] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py new file mode 100644 index 00000000000..c55d028c374 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py @@ -0,0 +1,93 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ObjectWithValidations( + _SchemaValidator( + min_properties=2, + ), + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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 (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py new file mode 100644 index 00000000000..b00c227a86c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -0,0 +1,136 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Order( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + id (int,): + petId (int,): + quantity (int,): + shipDate (datetime,): + status (str,): Order Status + complete (bool,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + id = Int64Schema + petId = Int64Schema + quantity = Int32Schema + shipDate = DateTimeSchema + + + class status( + _SchemaEnumMaker( + enum_value_to_name={ + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + ), + StrSchema + ): + + @classmethod + @property + def PLACED(cls): + return cls._enum_by_value["placed"]("placed") + + @classmethod + @property + def APPROVED(cls): + return cls._enum_by_value["approved"]("approved") + + @classmethod + @property + def DELIVERED(cls): + return cls._enum_by_value["delivered"]("delivered") + complete = BoolSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + id: typing.Union[id, Unset] = unset, + petId: typing.Union[petId, Unset] = unset, + quantity: typing.Union[quantity, Unset] = unset, + shipDate: typing.Union[shipDate, Unset] = unset, + status: typing.Union[status, Unset] = unset, + complete: typing.Union[complete, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + id=id, + petId=petId, + quantity=quantity, + shipDate=shipDate, + status=status, + complete=complete, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py new file mode 100644 index 00000000000..b9066defb50 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -0,0 +1,120 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ParentPet( + ComposedBase, + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'pet_type': { + 'ChildCat': ChildCat, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + GrandparentAnimal, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.grandparent_animal import GrandparentAnimal diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py new file mode 100644 index 00000000000..f602e6e722d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -0,0 +1,163 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Pet( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Pet object that needs to be added to the store + + Attributes: + id (int,): + category (): + name (str,): + photoUrls (tuple,): + tags (tuple,): + status (str,): pet status in the store + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'name', + 'photoUrls', + )) + id = Int64Schema + + @classmethod + @property + def category(cls) -> typing.Type['Category']: + return Category + name = StrSchema + + + class photoUrls( + ListSchema + ): + _items = StrSchema + + + class tags( + ListSchema + ): + + @classmethod + @property + def _items(cls) -> typing.Type['Tag']: + return Tag + + + class status( + _SchemaEnumMaker( + enum_value_to_name={ + "available": "AVAILABLE", + "pending": "PENDING", + "sold": "SOLD", + } + ), + StrSchema + ): + + @classmethod + @property + def AVAILABLE(cls): + return cls._enum_by_value["available"]("available") + + @classmethod + @property + def PENDING(cls): + return cls._enum_by_value["pending"]("pending") + + @classmethod + @property + def SOLD(cls): + return cls._enum_by_value["sold"]("sold") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + name: name, + photoUrls: photoUrls, + id: typing.Union[id, Unset] = unset, + category: typing.Union['Category', Unset] = unset, + tags: typing.Union[tags, Unset] = unset, + status: typing.Union[status, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + photoUrls=photoUrls, + id=id, + category=category, + tags=tags, + status=status, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.category import Category +from petstore_api.model.tag import Tag diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py new file mode 100644 index 00000000000..02ef6df613b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -0,0 +1,121 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Pig( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'className': { + 'BasquePig': BasquePig, + 'DanishPig': DanishPig, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + BasquePig, + DanishPig, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.danish_pig import DanishPig diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py new file mode 100644 index 00000000000..b568eadf36e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py @@ -0,0 +1,100 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Player( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties + + Attributes: + name (str,): + enemyPlayer (): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + name = StrSchema + + @classmethod + @property + def enemyPlayer(cls) -> typing.Type['Player']: + return Player + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + name: typing.Union[name, Unset] = unset, + enemyPlayer: typing.Union['Player', Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + name=name, + enemyPlayer=enemyPlayer, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py new file mode 100644 index 00000000000..e5e8dd8788a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -0,0 +1,121 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Quadrilateral( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'quadrilateralType': { + 'ComplexQuadrilateral': ComplexQuadrilateral, + 'SimpleQuadrilateral': SimpleQuadrilateral, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + SimpleQuadrilateral, + ComplexQuadrilateral, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py new file mode 100644 index 00000000000..606805b40ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -0,0 +1,111 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class QuadrilateralInterface( + AnyTypeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + shapeType (str,): + quadrilateralType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'shapeType', + 'quadrilateralType', + )) + + + class shapeType( + _SchemaEnumMaker( + enum_value_to_name={ + "Quadrilateral": "QUADRILATERAL", + } + ), + StrSchema + ): + + @classmethod + @property + def QUADRILATERAL(cls): + return cls._enum_by_value["Quadrilateral"]("Quadrilateral") + quadrilateralType = StrSchema + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + shapeType: shapeType, + quadrilateralType: quadrilateralType, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + shapeType=shapeType, + quadrilateralType=quadrilateralType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py new file mode 100644 index 00000000000..136a772cd00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -0,0 +1,94 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ReadOnlyFirst( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + bar (str,): + baz (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + bar = StrSchema + baz = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + bar: typing.Union[bar, Unset] = unset, + baz: typing.Union[baz, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + bar=bar, + baz=baz, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py new file mode 100644 index 00000000000..0639b5aeb3c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ScaleneTriangle( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + TriangleInterface, + ScaleneTriangleAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.scalene_triangle_all_of import ScaleneTriangleAllOf +from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py new file mode 100644 index 00000000000..9e031ca5a74 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py @@ -0,0 +1,104 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ScaleneTriangleAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + triangleType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class triangleType( + _SchemaEnumMaker( + enum_value_to_name={ + "ScaleneTriangle": "SCALENETRIANGLE", + } + ), + StrSchema + ): + + @classmethod + @property + def SCALENETRIANGLE(cls): + return cls._enum_by_value["ScaleneTriangle"]("ScaleneTriangle") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + triangleType: typing.Union[triangleType, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + triangleType=triangleType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py new file mode 100644 index 00000000000..6142062fbc7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -0,0 +1,121 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Shape( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + Triangle, + Quadrilateral, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py new file mode 100644 index 00000000000..b1a7ecd967d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -0,0 +1,125 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ShapeOrNull( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'shapeType': { + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 + oneOf_0 = NoneSchema + return { + 'allOf': [ + ], + 'oneOf': [ + oneOf_0, + Triangle, + Quadrilateral, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.triangle import Triangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py new file mode 100644 index 00000000000..bc907bfb30b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -0,0 +1,109 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class SimpleQuadrilateral( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + QuadrilateralInterface, + SimpleQuadrilateralAllOf, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface +from petstore_api.model.simple_quadrilateral_all_of import SimpleQuadrilateralAllOf diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py new file mode 100644 index 00000000000..b6b63fb9ff0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py @@ -0,0 +1,104 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class SimpleQuadrilateralAllOf( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + quadrilateralType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + + class quadrilateralType( + _SchemaEnumMaker( + enum_value_to_name={ + "SimpleQuadrilateral": "SIMPLEQUADRILATERAL", + } + ), + StrSchema + ): + + @classmethod + @property + def SIMPLEQUADRILATERAL(cls): + return cls._enum_by_value["SimpleQuadrilateral"]("SimpleQuadrilateral") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + quadrilateralType=quadrilateralType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py new file mode 100644 index 00000000000..c4fa2a0cff6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py @@ -0,0 +1,107 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class SomeObject( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ObjectInterface, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.object_interface import ObjectInterface diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py new file mode 100644 index 00000000000..47c8e538244 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class SpecialModelName( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + model with an invalid class name for python + + Attributes: + a (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + a = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + a: typing.Union[a, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + a=a, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py new file mode 100644 index 00000000000..9b51e661bfd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py @@ -0,0 +1,59 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +String = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py new file mode 100644 index 00000000000..8022c91ced1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -0,0 +1,87 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class StringBooleanMap( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _additional_properties = BoolSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py new file mode 100644 index 00000000000..0f803ec7d24 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -0,0 +1,136 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class StringEnum( + _SchemaTypeChecker(typing.Union[none_type, str, ]), + _SchemaEnumMaker( + enum_value_to_name={ + None: "NONE", + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + "single quoted": "SINGLE_QUOTED", + '''multiple +lines''': "MULTIPLE_LINES", + '''double quote + with newline''': "DOUBLE_QUOTE_WITH_NEWLINE", + } + ), + StrBase, + NoneBase, + Schema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def NONE(cls): + return cls._enum_by_value[None](None) + + @classmethod + @property + def PLACED(cls): + return cls._enum_by_value["placed"]("placed") + + @classmethod + @property + def APPROVED(cls): + return cls._enum_by_value["approved"]("approved") + + @classmethod + @property + def DELIVERED(cls): + return cls._enum_by_value["delivered"]("delivered") + + @classmethod + @property + def SINGLE_QUOTED(cls): + return cls._enum_by_value["single quoted"]("single quoted") + + @classmethod + @property + def MULTIPLE_LINES(cls): + return cls._enum_by_value['''multiple +lines''']('''multiple +lines''') + + @classmethod + @property + def DOUBLE_QUOTE_WITH_NEWLINE(cls): + return cls._enum_by_value['''double quote + with newline''']('''double quote + with newline''') + + def __new__( + cls, + *args: typing.Union[str, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py new file mode 100644 index 00000000000..7894c4093a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -0,0 +1,92 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class StringEnumWithDefaultValue( + _SchemaEnumMaker( + enum_value_to_name={ + "placed": "PLACED", + "approved": "APPROVED", + "delivered": "DELIVERED", + } + ), + StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + """ + + @classmethod + @property + def PLACED(cls): + return cls._enum_by_value["placed"]("placed") + + @classmethod + @property + def APPROVED(cls): + return cls._enum_by_value["approved"]("approved") + + @classmethod + @property + def DELIVERED(cls): + return cls._enum_by_value["delivered"]("delivered") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py new file mode 100644 index 00000000000..135b181127d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py @@ -0,0 +1,78 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class StringWithValidation( + _SchemaValidator( + min_length=7, + ), + StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _validations (dict): the validations which apply to the current Schema + 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. + """ + pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py new file mode 100644 index 00000000000..275974b2ecf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -0,0 +1,94 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Tag( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + id (int,): + name (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + id = Int64Schema + name = StrSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + id: typing.Union[id, Unset] = unset, + name: typing.Union[name, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + id=id, + name=name, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py new file mode 100644 index 00000000000..a35af496f9c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -0,0 +1,124 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Triangle( + ComposedSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + _discriminator(cls) -> dict: the key is the required discriminator propertyName + the value is a dict mapping from a string name to the corresponding Schema class + """ + + @classmethod + @property + def _discriminator(cls): + return { + 'triangleType': { + 'EquilateralTriangle': EquilateralTriangle, + 'IsoscelesTriangle': IsoscelesTriangle, + 'ScaleneTriangle': ScaleneTriangle, + } + } + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [ + ], + 'oneOf': [ + EquilateralTriangle, + IsoscelesTriangle, + ScaleneTriangle, + ], + 'anyOf': [ + ], + } + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.equilateral_triangle import EquilateralTriangle +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.scalene_triangle import ScaleneTriangle diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py new file mode 100644 index 00000000000..d21d93687c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -0,0 +1,111 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class TriangleInterface( + AnyTypeSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + shapeType (str,): + triangleType (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'shapeType', + 'triangleType', + )) + + + class shapeType( + _SchemaEnumMaker( + enum_value_to_name={ + "Triangle": "TRIANGLE", + } + ), + StrSchema + ): + + @classmethod + @property + def TRIANGLE(cls): + return cls._enum_by_value["Triangle"]("Triangle") + triangleType = StrSchema + + def __new__( + cls, + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + shapeType: shapeType, + triangleType: triangleType, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + shapeType=shapeType, + triangleType=triangleType, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py new file mode 100644 index 00000000000..dccbf4d2040 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -0,0 +1,154 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class User( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + id (int,): + username (str,): + firstName (str,): + lastName (str,): + email (str,): + password (str,): + phone (str,): + userStatus (int,): User Status + objectWithNoDeclaredProps (dict,): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable (dict, none_type,): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + anyTypeProp (): 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 (): 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. + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + id = Int64Schema + username = StrSchema + firstName = StrSchema + lastName = StrSchema + email = StrSchema + password = StrSchema + phone = StrSchema + userStatus = Int32Schema + objectWithNoDeclaredProps = DictSchema + + + class objectWithNoDeclaredPropsNullable( + _SchemaTypeChecker(typing.Union[frozendict, none_type, ]), + DictBase, + NoneBase, + Schema + ): + + def __new__( + cls, + *args: typing.Union[dict, frozendict, None, ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + anyTypeProp = AnyTypeSchema + anyTypePropNullable = AnyTypeSchema + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + id: typing.Union[id, Unset] = unset, + username: typing.Union[username, Unset] = unset, + firstName: typing.Union[firstName, Unset] = unset, + lastName: typing.Union[lastName, Unset] = unset, + email: typing.Union[email, Unset] = unset, + password: typing.Union[password, Unset] = unset, + phone: typing.Union[phone, Unset] = unset, + userStatus: typing.Union[userStatus, Unset] = unset, + objectWithNoDeclaredProps: typing.Union[objectWithNoDeclaredProps, Unset] = unset, + objectWithNoDeclaredPropsNullable: typing.Union[objectWithNoDeclaredPropsNullable, Unset] = unset, + anyTypeProp: typing.Union[anyTypeProp, Unset] = unset, + anyTypePropNullable: typing.Union[anyTypePropNullable, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + id=id, + username=username, + firstName=firstName, + lastName=lastName, + email=email, + password=password, + phone=phone, + userStatus=userStatus, + objectWithNoDeclaredProps=objectWithNoDeclaredProps, + objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, + anyTypeProp=anyTypeProp, + anyTypePropNullable=anyTypePropNullable, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py new file mode 100644 index 00000000000..2018c62eb3c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -0,0 +1,115 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Whale( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + hasBaleen (bool,): + hasTeeth (bool,): + className (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'className', + )) + hasBaleen = BoolSchema + hasTeeth = BoolSchema + + + class className( + _SchemaEnumMaker( + enum_value_to_name={ + "whale": "WHALE", + } + ), + StrSchema + ): + + @classmethod + @property + def WHALE(cls): + return cls._enum_by_value["whale"]("whale") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + className: className, + hasBaleen: typing.Union[hasBaleen, Unset] = unset, + hasTeeth: typing.Union[hasTeeth, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + className=className, + hasBaleen=hasBaleen, + hasTeeth=hasTeeth, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py new file mode 100644 index 00000000000..8a5ef4550d7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -0,0 +1,137 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +from decimal import Decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Zebra( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + type (str,): + className (str,): + _additional_properties (Schema): the definition used for additional properties + that are not defined in _properties + """ + _required_property_names = set(( + 'className', + )) + + + class type( + _SchemaEnumMaker( + enum_value_to_name={ + "plains": "PLAINS", + "mountain": "MOUNTAIN", + "grevys": "GREVYS", + } + ), + StrSchema + ): + + @classmethod + @property + def PLAINS(cls): + return cls._enum_by_value["plains"]("plains") + + @classmethod + @property + def MOUNTAIN(cls): + return cls._enum_by_value["mountain"]("mountain") + + @classmethod + @property + def GREVYS(cls): + return cls._enum_by_value["grevys"]("grevys") + + + class className( + _SchemaEnumMaker( + enum_value_to_name={ + "zebra": "ZEBRA", + } + ), + StrSchema + ): + + @classmethod + @property + def ZEBRA(cls): + return cls._enum_by_value["zebra"]("zebra") + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + className: className, + type: typing.Union[type, Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ): + return super().__new__( + cls, + *args, + className=className, + type=type, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) 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 new file mode 100644 index 00000000000..9d3b94558c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -0,0 +1,126 @@ +# 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 petstore_api.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +from petstore_api.model.address import Address +from petstore_api.model.animal import Animal +from petstore_api.model.animal_farm import AnimalFarm +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_holding_any_type import ArrayHoldingAnyType +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.model.array_of_enums import ArrayOfEnums +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly +from petstore_api.model.array_test import ArrayTest +from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.model.banana import Banana +from petstore_api.model.banana_req import BananaReq +from petstore_api.model.bar import Bar +from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.boolean import Boolean +from petstore_api.model.boolean_enum import BooleanEnum +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.complex_quadrilateral_all_of import ComplexQuadrilateralAllOf +from petstore_api.model.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations +from petstore_api.model.composed_array import ComposedArray +from petstore_api.model.composed_bool import ComposedBool +from petstore_api.model.composed_none import ComposedNone +from petstore_api.model.composed_number import ComposedNumber +from petstore_api.model.composed_object import ComposedObject +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.model.composed_string import ComposedString +from petstore_api.model.danish_pig import DanishPig +from petstore_api.model.date_time_test import DateTimeTest +from petstore_api.model.date_time_with_validations import DateTimeWithValidations +from petstore_api.model.date_with_validations import DateWithValidations +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.equilateral_triangle_all_of import EquilateralTriangleAllOf +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_response_default import InlineResponseDefault +from petstore_api.model.integer_enum import IntegerEnum +from petstore_api.model.integer_enum_big import IntegerEnumBig +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue +from petstore_api.model.integer_max10 import IntegerMax10 +from petstore_api.model.integer_min15 import IntegerMin15 +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.isosceles_triangle_all_of import IsoscelesTriangleAllOf +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.no_additional_properties import NoAdditionalProperties +from petstore_api.model.nullable_class import NullableClass +from petstore_api.model.nullable_shape import NullableShape +from petstore_api.model.nullable_string import NullableString +from petstore_api.model.number import Number +from petstore_api.model.number_only import NumberOnly +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_interface import ObjectInterface +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps +from petstore_api.model.object_with_validations import ObjectWithValidations +from petstore_api.model.order import Order +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.player import Player +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.scalene_triangle_all_of import ScaleneTriangleAllOf +from petstore_api.model.shape import Shape +from petstore_api.model.shape_or_null import ShapeOrNull +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral +from petstore_api.model.simple_quadrilateral_all_of import SimpleQuadrilateralAllOf +from petstore_api.model.some_object import SomeObject +from petstore_api.model.special_model_name import SpecialModelName +from petstore_api.model.string import String +from petstore_api.model.string_boolean_map import StringBooleanMap +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue +from petstore_api.model.string_with_validation import StringWithValidation +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/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py new file mode 100644 index 00000000000..7724b98a71c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -0,0 +1,258 @@ +# 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 +""" + +import logging +import ssl +from urllib.parse import urlencode +import typing + +import certifi +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from petstore_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method: str, + url: str, + query_params: typing.Optional[typing.Tuple[typing.Tuple[str, str], ...]] = None, + headers: typing.Optional[HTTPHeaderDict] = None, + fields: typing.Optional[typing.Tuple[typing.Tuple[str, typing.Any], ...]] = None, + body: typing.Optional[typing.Union[str, bytes]] = None, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> urllib3.HTTPResponse: + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request body, for other types + :param fields: request parameters for + `application/x-www-form-urlencoded` + or `multipart/form-data` + :param stream: if True, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is False. + :param timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if fields and body: + raise ApiValueError( + "body parameter cannot be used with fields parameter." + ) + + fields = fields or {} + headers = headers or {} + + if timeout: + if isinstance(timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=timeout) + elif (isinstance(timeout, tuple) and + len(timeout) == 2): + timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=False, + preload_content=not stream, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=fields, + encode_multipart=True, + preload_content=not stream, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=not stream, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=not stream, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if not stream: + # log response body + logger.debug("response body: %s", r.data) + + return r + + def GET(self, url, headers=None, query_params=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("GET", url, + headers=headers, + stream=stream, + timeout=timeout, + query_params=query_params, fields=fields) + + def HEAD(self, url, headers=None, query_params=None, stream=False, + timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("HEAD", url, + headers=headers, + stream=stream, + timeout=timeout, + query_params=query_params, fields=fields) + + def OPTIONS(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def DELETE(self, url, headers=None, query_params=None, body=None, + stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def POST(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("POST", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PUT(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PUT", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) + + def PATCH(self, url, headers=None, query_params=None, + body=None, stream=False, timeout=None, fields=None) -> urllib3.HTTPResponse: + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + stream=stream, + timeout=timeout, + body=body, fields=fields) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py new file mode 100644 index 00000000000..e230675efaa --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -0,0 +1,1994 @@ +# 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 collections import defaultdict +from datetime import date, datetime, timedelta # noqa: F401 +from dataclasses import dataclass +import functools +from decimal import Decimal +import io +import os +import re +import tempfile +import typing + +from dateutil.parser.isoparser import isoparser, _takes_ascii +from frozendict import frozendict + +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError, +) +from petstore_api.configuration import ( + Configuration, +) + + +class Unset(object): + """ + An instance of this class is set as the default value for object type(dict) properties that are optional + When a property has an unset value, that property will not be assigned in the dict + """ + pass + +unset = Unset() + +none_type = type(None) +file_type = io.IOBase + + +class FileIO(io.FileIO): + """ + A class for storing files + Note: this class is not immutable + """ + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + arg.close() + inst = super(FileIO, cls).__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) + return inst + raise ApiValueError('FileIO must be passed arg which contains the open file') + + +def update(d: dict, u: dict): + """ + Adds u to d + Where each dict is defaultdict(set) + """ + for k, v in u.items(): + d[k] = d[k].union(v) + return d + + +class InstantiationMetadata: + """ + A class to store metadata that is needed when instantiating OpenApi Schema subclasses + """ + def __init__( + self, + path_to_item: typing.Tuple[typing.Union[str, int], ...] = tuple(['args[0]']), + from_server: bool = False, + configuration: typing.Optional[Configuration] = None, + base_classes: typing.FrozenSet[typing.Type] = frozenset(), + path_to_schemas: typing.Optional[typing.Dict[str, typing.Set[typing.Type]]] = None, + ): + """ + Args: + path_to_item: the path to the current data being instantiated. + For {'a': [1]} if the code is handling, 1, then the path is ('args[0]', 'a', 0) + from_server: whether or not this data came form the server + True when receiving server data + False when instantiating model with client side data not form the server + configuration: the Configuration instance to use + This is needed because in Configuration: + - one can disable validation checking + base_classes: when deserializing data that matches multiple schemas, this is used to store + the schemas that have been traversed. This is used to stop processing when a cycle is seen. + path_to_schemas: a dict that goes from path to a list of classes at each path location + """ + self.path_to_item = path_to_item + self.from_server = from_server + self.configuration = configuration + self.base_classes = base_classes + if path_to_schemas is None: + path_to_schemas = defaultdict(set) + self.path_to_schemas = path_to_schemas + + def __repr__(self): + return str(self.__dict__) + + def __eq__(self, other): + if not isinstance(other, InstantiationMetadata): + return False + return self.__dict__ == other.__dict__ + + +class ValidatorBase: + @staticmethod + def __is_json_validation_enabled(schema_keyword, configuration=None): + """Returns true if JSON schema validation is enabled for the specified + validation keyword. This can be used to skip JSON schema structural validation + as requested in the configuration. + + Args: + schema_keyword (string): the name of a JSON schema validation keyword. + configuration (Configuration): the configuration class. + """ + + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) + + @staticmethod + def __raise_validation_error_message(value, constraint_msg, constraint_value, path_to_item, additional_txt=""): + raise ApiValueError( + "Invalid value `{value}`, {constraint_msg} `{constraint_value}`{additional_txt} at {path_to_item}".format( + value=value, + constraint_msg=constraint_msg, + constraint_value=constraint_value, + additional_txt=additional_txt, + path_to_item=path_to_item, + ) + ) + + @classmethod + def __check_str_validations(cls, + validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if (cls.__is_json_validation_enabled('maxLength', _instantiation_metadata.configuration) and + 'max_length' in validations and + len(input_values) > validations['max_length']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="length must be less than or equal to", + constraint_value=validations['max_length'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minLength', _instantiation_metadata.configuration) and + 'min_length' in validations and + len(input_values) < validations['min_length']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="length must be greater than or equal to", + constraint_value=validations['min_length'], + path_to_item=_instantiation_metadata.path_to_item + ) + + checked_value = input_values + if (cls.__is_json_validation_enabled('pattern', _instantiation_metadata.configuration) and + 'regex' in validations): + for regex_dict in validations['regex']: + flags = regex_dict.get('flags', 0) + if not re.search(regex_dict['pattern'], checked_value, flags=flags): + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=_instantiation_metadata.path_to_item, + additional_txt=" with flags=`{}`".format(flags) + ) + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must match regular expression", + constraint_value=regex_dict['pattern'], + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def __check_tuple_validations( + cls, validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if (cls.__is_json_validation_enabled('maxItems', _instantiation_metadata.configuration) and + 'max_items' in validations and + len(input_values) > validations['max_items']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of items must be less than or equal to", + constraint_value=validations['max_items'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minItems', _instantiation_metadata.configuration) and + 'min_items' in validations and + len(input_values) < validations['min_items']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of items must be greater than or equal to", + constraint_value=validations['min_items'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('uniqueItems', _instantiation_metadata.configuration) and + 'unique_items' in validations and validations['unique_items'] and input_values): + unique_items = [] + # print(validations) + for item in input_values: + if item not in unique_items: + unique_items.append(item) + if len(input_values) > len(unique_items): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="duplicate items were found, and the tuple must not contain duplicates because", + constraint_value='unique_items==True', + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def __check_dict_validations( + cls, validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if (cls.__is_json_validation_enabled('maxProperties', _instantiation_metadata.configuration) and + 'max_properties' in validations and + len(input_values) > validations['max_properties']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of properties must be less than or equal to", + constraint_value=validations['max_properties'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minProperties', _instantiation_metadata.configuration) and + 'min_properties' in validations and + len(input_values) < validations['min_properties']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="number of properties must be greater than or equal to", + constraint_value=validations['min_properties'], + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def __check_numeric_validations( + cls, validations, input_values, + _instantiation_metadata: InstantiationMetadata): + + if cls.__is_json_validation_enabled('multipleOf', + _instantiation_metadata.configuration) and 'multiple_of' in validations: + multiple_of_values = validations['multiple_of'] + for multiple_of_value in multiple_of_values: + if (isinstance(input_values, Decimal) and + not (float(input_values) / multiple_of_value).is_integer() + ): + # Note 'multipleOf' will be as good as the floating point arithmetic. + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="value must be a multiple of", + constraint_value=multiple_of_value, + path_to_item=_instantiation_metadata.path_to_item + ) + + checking_max_or_min_values = {'exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum'}.isdisjoint(validations) is False + if not checking_max_or_min_values: + return + max_val = input_values + min_val = input_values + + if (cls.__is_json_validation_enabled('exclusiveMaximum', _instantiation_metadata.configuration) and + 'exclusive_maximum' in validations and + max_val >= validations['exclusive_maximum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value less than", + constraint_value=validations['exclusive_maximum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('maximum', _instantiation_metadata.configuration) and + 'inclusive_maximum' in validations and + max_val > validations['inclusive_maximum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value less than or equal to", + constraint_value=validations['inclusive_maximum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('exclusiveMinimum', _instantiation_metadata.configuration) and + 'exclusive_minimum' in validations and + min_val <= validations['exclusive_minimum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value greater than", + constraint_value=validations['exclusive_maximum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + if (cls.__is_json_validation_enabled('minimum', _instantiation_metadata.configuration) and + 'inclusive_minimum' in validations and + min_val < validations['inclusive_minimum']): + cls.__raise_validation_error_message( + value=input_values, + constraint_msg="must be a value greater than or equal to", + constraint_value=validations['inclusive_minimum'], + path_to_item=_instantiation_metadata.path_to_item + ) + + @classmethod + def _check_validations_for_types( + cls, + validations, + input_values, + _instantiation_metadata: InstantiationMetadata + ): + if isinstance(input_values, str): + cls.__check_str_validations(validations, input_values, _instantiation_metadata) + elif isinstance(input_values, tuple): + cls.__check_tuple_validations(validations, input_values, _instantiation_metadata) + elif isinstance(input_values, frozendict): + cls.__check_dict_validations(validations, input_values, _instantiation_metadata) + elif isinstance(input_values, Decimal): + cls.__check_numeric_validations(validations, input_values, _instantiation_metadata) + try: + return super()._validate_validations_pass(input_values, _instantiation_metadata) + except AttributeError: + return True + + +class Validator(typing.Protocol): + def _validate_validations_pass( + cls, + input_values, + _instantiation_metadata: InstantiationMetadata + ): + pass + + +def _SchemaValidator(**validations: typing.Union[str, bool, None, int, float, list[dict[str, typing.Union[str, int, float]]]]) -> Validator: + class SchemaValidator(ValidatorBase): + @classmethod + def _validate_validations_pass( + cls, + input_values, + _instantiation_metadata: InstantiationMetadata + ): + cls._check_validations_for_types(validations, input_values, _instantiation_metadata) + try: + return super()._validate_validations_pass(input_values, _instantiation_metadata) + except AttributeError: + return True + + return SchemaValidator + + +class TypeChecker(typing.Protocol): + @classmethod + def _validate_type( + cls, arg_simple_class: type + ) -> typing.Tuple[type]: + pass + + +def _SchemaTypeChecker(union_type_cls: typing.Union[typing.Any]) -> TypeChecker: + if typing.get_origin(union_type_cls) is typing.Union: + union_classes = typing.get_args(union_type_cls) + else: + # note: when a union of a single class is passed in, the union disappears + union_classes = tuple([union_type_cls]) + """ + I want the type hint... union_type_cls + and to use it as a base class but when I do, I get + TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases + """ + class SchemaTypeChecker: + @classmethod + def _validate_type(cls, arg_simple_class: type): + if arg_simple_class not in union_classes: + return union_classes + try: + return super()._validate_type(arg_simple_class) + except AttributeError: + return tuple() + + return SchemaTypeChecker + + +class EnumMakerBase: + @classmethod + @property + def _enum_by_value( + cls + ) -> type: + enum_classes = {} + if not hasattr(cls, "_enum_value_to_name"): + return enum_classes + for enum_value, enum_name in cls._enum_value_to_name.items(): + base_class = type(enum_value) + if base_class is none_type: + enum_classes[enum_value] = get_new_class( + "Dynamic" + cls.__name__, (cls, NoneClass)) + log_cache_usage(get_new_class) + elif base_class is bool: + enum_classes[enum_value] = get_new_class( + "Dynamic" + cls.__name__, (cls, BoolClass)) + log_cache_usage(get_new_class) + else: + enum_classes[enum_value] = get_new_class( + "Dynamic" + cls.__name__, (cls, Singleton, base_class)) + log_cache_usage(get_new_class) + return enum_classes + + +class EnumMakerInterface(typing.Protocol): + @classmethod + @property + def _enum_value_to_name( + cls + ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + pass + + @classmethod + @property + def _enum_by_value( + cls + ) -> type: + pass + + +def _SchemaEnumMaker(enum_value_to_name: typing.Dict[typing.Union[str, Decimal, bool, none_type], str]) -> EnumMakerInterface: + class SchemaEnumMaker(EnumMakerBase): + @classmethod + @property + def _enum_value_to_name( + cls + ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + pass + try: + super_enum_value_to_name = super()._enum_value_to_name + except AttributeError: + return enum_value_to_name + intersection = dict(enum_value_to_name.items() & super_enum_value_to_name.items()) + return intersection + + return SchemaEnumMaker + + +class Singleton: + """ + Enums and singletons are the same + The same instance is returned for a given key of (cls, arg) + """ + # TODO use bidict to store this so boolean enums can move through it in reverse to get their own arg value? + _instances = {} + + def __new__(cls, *args, **kwargs): + if not args: + raise ValueError('arg must be passed') + arg = args[0] + key = (cls, arg) + if key not in cls._instances: + if arg in {None, True, False}: + inst = super().__new__(cls) + # inst._value = arg + cls._instances[key] = inst + else: + cls._instances[key] = super().__new__(cls, arg) + return cls._instances[key] + + def __repr__(self): + return '({}, {})'.format(self.__class__.__name__, self) + + +class NoneClass(Singleton): + @classmethod + @property + def NONE(cls): + return cls(None) + + def is_none(self) -> bool: + return True + + def __bool__(self) -> bool: + return False + + +class BoolClass(Singleton): + @classmethod + @property + def TRUE(cls): + return cls(True) + + @classmethod + @property + def FALSE(cls): + return cls(False) + + @functools.cache + def __bool__(self) -> bool: + for key, instance in self._instances.items(): + if self is instance: + return key[1] + raise ValueError('Unable to find the boolean value of this instance') + + def is_true(self): + return bool(self) + + def is_false(self): + return bool(self) + + +class BoolBase: + pass + + +class NoneBase: + pass + + +class StrBase: + @property + def as_str(self) -> str: + return self + + @property + def as_date(self) -> date: + raise Exception('not implemented') + + @property + def as_datetime(self) -> datetime: + raise Exception('not implemented') + + +class CustomIsoparser(isoparser): + + @_takes_ascii + def parse_isodatetime(self, dt_str): + components, pos = self._parse_isodate(dt_str) + if len(dt_str) > pos: + if self._sep is None or dt_str[pos:pos + 1] == self._sep: + components += self._parse_isotime(dt_str[pos + 1:]) + else: + raise ValueError('String contains unknown ISO components') + + if len(components) > 3 and components[3] == 24: + components[3] = 0 + return datetime(*components) + timedelta(days=1) + + if len(components) <= 3: + raise ValueError('Value is not a datetime') + + return datetime(*components) + + @_takes_ascii + def parse_isodate(self, datestr): + components, pos = self._parse_isodate(datestr) + + if len(datestr) > pos: + raise ValueError('String contains invalid time components') + + if len(components) > 3: + raise ValueError('String contains invalid time components') + + return date(*components) + + +DEFAULT_ISOPARSER = CustomIsoparser() + + +class DateBase(StrBase): + @property + @functools.cache + def as_date(self) -> date: + return DEFAULT_ISOPARSER.parse_isodate(self) + + @classmethod + def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, str): + try: + DEFAULT_ISOPARSER.parse_isodate(arg) + return True + except ValueError: + raise ApiValueError( + "Value does not conform to the required ISO-8601 date format. " + "Invalid value '{}' for type date at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DateBase _validate + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + +class DateTimeBase: + @property + @functools.cache + def as_datetime(self) -> datetime: + return DEFAULT_ISOPARSER.parse_isodatetime(self) + + @classmethod + def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, str): + try: + DEFAULT_ISOPARSER.parse_isodatetime(arg) + return True + except ValueError: + raise ApiValueError( + "Value does not conform to the required ISO-8601 datetime format. " + "Invalid value '{}' for type datetime at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DateTimeBase _validate + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + +class NumberBase: + @property + def as_int(self) -> int: + try: + return self._as_int + except AttributeError: + """ + Note: for some numbers like 9.0 they could be represented as an + integer but our code chooses to store them as + >>> Decimal('9.0').as_tuple() + DecimalTuple(sign=0, digits=(9, 0), exponent=-1) + so we can tell that the value came from a float and convert it back to a float + during later serialization + """ + if self.as_tuple().exponent < 0: + # this could be represented as an integer but should be represented as a float + # because that's what it was serialized from + raise ApiValueError(f'{self} is not an integer') + self._as_int = int(self) + return self._as_int + + @property + def as_float(self) -> float: + try: + return self._as_float + except AttributeError: + if self.as_tuple().exponent >= 0: + raise ApiValueError(f'{self} is not an float') + self._as_float = float(self) + return self._as_float + + +class ListBase: + @classmethod + def _validate_items(cls, list_items, _instantiation_metadata: InstantiationMetadata): + """ + Ensures that: + - values passed in for items are valid + Exceptions will be raised if: + - invalid arguments were passed in + + Args: + list_items: the input list of items + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + + # if we have definitions for an items schema, use it + # otherwise accept anything + item_cls = getattr(cls, '_items', AnyTypeSchema) + path_to_schemas = defaultdict(set) + for i, value in enumerate(list_items): + if isinstance(value, item_cls): + continue + item_instantiation_metadata = InstantiationMetadata( + from_server=_instantiation_metadata.from_server, + configuration=_instantiation_metadata.configuration, + path_to_item=_instantiation_metadata.path_to_item+(i,) + ) + other_path_to_schemas = item_cls._validate( + value, _instantiation_metadata=item_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + ListBase _validate + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + arg = args[0] + _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + if not isinstance(arg, tuple): + return _path_to_schemas + if cls in _instantiation_metadata.base_classes: + # we have already moved through this class so stop here + return _path_to_schemas + _instantiation_metadata.base_classes |= frozenset({cls}) + other_path_to_schemas = cls._validate_items(arg, _instantiation_metadata=_instantiation_metadata) + update(_path_to_schemas, other_path_to_schemas) + return _path_to_schemas + + @classmethod + def _get_items(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + ''' + ListBase _get_items + ''' + _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata + + list_items = args[0] + cast_items = [] + # if we have definitions for an items schema, use it + # otherwise accept anything + + cls_item_cls = getattr(cls, '_items', AnyTypeSchema) + for i, value in enumerate(list_items): + item_path_to_item = _instantiation_metadata.path_to_item+(i,) + if item_path_to_item in _instantiation_metadata.path_to_schemas: + item_cls = _instantiation_metadata.path_to_schemas[item_path_to_item] + else: + item_cls = cls_item_cls + + if isinstance(value, item_cls): + cast_items.append(value) + continue + item_instantiation_metadata = InstantiationMetadata( + configuration=_instantiation_metadata.configuration, + from_server=_instantiation_metadata.from_server, + path_to_item=item_path_to_item, + path_to_schemas=_instantiation_metadata.path_to_schemas, + ) + + if _instantiation_metadata.from_server: + new_value = item_cls._from_openapi_data(value, _instantiation_metadata=item_instantiation_metadata) + else: + new_value = item_cls(value, _instantiation_metadata=item_instantiation_metadata) + cast_items.append(new_value) + + return cast_items + + +class Discriminable: + @classmethod + def _ensure_discriminator_value_present(cls, disc_property_name: str, _instantiation_metadata: InstantiationMetadata, *args): + if not args or args and disc_property_name not in args[0]: + # The input data does not contain the discriminator property + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '{}' is missing at path: {}".format(disc_property_name, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _get_discriminated_class(cls, disc_property_name: str, disc_payload_value: str): + """ + Used in schemas with discriminators + """ + if not hasattr(cls, '_discriminator'): + return None + disc = cls._discriminator + if disc_property_name not in disc: + return None + discriminated_cls = disc[disc_property_name].get(disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + elif not hasattr(cls, '_composed_schemas'): + return None + # TODO stop traveling if a cycle is hit + for allof_cls in cls._composed_schemas['allOf']: + discriminated_cls = allof_cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + for oneof_cls in cls._composed_schemas['oneOf']: + discriminated_cls = oneof_cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + for anyof_cls in cls._composed_schemas['anyOf']: + discriminated_cls = anyof_cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=disc_payload_value) + if discriminated_cls is not None: + return discriminated_cls + return None + + +class DictBase(Discriminable): + # subclass properties + _required_property_names = set() + + @classmethod + def _validate_arg_presence(cls, arg): + """ + Ensures that: + - all required arguments are passed in + - the input variable names are valid + - present in properties or + - accepted because additionalProperties exists + Exceptions will be raised if: + - invalid arguments were passed in + - a var_name is invalid if additionProperties == None and var_name not in _properties + - required properties were not passed in + + Args: + arg: the input dict + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + seen_required_properties = set() + invalid_arguments = [] + for property_name in arg: + if property_name in cls._required_property_names: + seen_required_properties.add(property_name) + elif property_name in cls._property_names: + continue + elif cls._additional_properties: + continue + else: + invalid_arguments.append(property_name) + missing_required_arguments = list(cls._required_property_names - seen_required_properties) + if missing_required_arguments: + missing_required_arguments.sort() + raise ApiTypeError( + "{} is missing {} required argument{}: {}".format( + cls.__name__, + len(missing_required_arguments), + "s" if len(missing_required_arguments) > 1 else "", + missing_required_arguments + ) + ) + if invalid_arguments: + invalid_arguments.sort() + raise ApiTypeError( + "{} was passed {} invalid argument{}: {}".format( + cls.__name__, + len(invalid_arguments), + "s" if len(invalid_arguments) > 1 else "", + invalid_arguments + ) + ) + + @classmethod + def _validate_args(cls, arg, _instantiation_metadata: InstantiationMetadata): + """ + Ensures that: + - values passed in for properties are valid + Exceptions will be raised if: + - invalid arguments were passed in + + Args: + arg: the input dict + + Raises: + ApiTypeError - for missing required arguments, or for invalid properties + """ + path_to_schemas = defaultdict(set) + for property_name, value in arg.items(): + if property_name in cls._required_property_names or property_name in cls._property_names: + schema = getattr(cls, property_name) + elif cls._additional_properties: + schema = cls._additional_properties + else: + raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format( + value, cls, _instantiation_metadata.path_to_item+(property_name,) + )) + if isinstance(value, schema): + continue + arg_instantiation_metadata = InstantiationMetadata( + from_server=_instantiation_metadata.from_server, + configuration=_instantiation_metadata.configuration, + path_to_item=_instantiation_metadata.path_to_item+(property_name,) + ) + other_path_to_schemas = schema._validate(value, _instantiation_metadata=arg_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + _instantiation_metadata.path_to_schemas.update(arg_instantiation_metadata.path_to_schemas) + return path_to_schemas + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DictBase _validate + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + if args and isinstance(args[0], cls): + # an instance of the correct type was passed in + return {} + arg = args[0] + _path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + if not isinstance(arg, frozendict): + return _path_to_schemas + cls._validate_arg_presence(args[0]) + other_path_to_schemas = cls._validate_args(args[0], _instantiation_metadata=_instantiation_metadata) + update(_path_to_schemas, other_path_to_schemas) + try: + _discriminator = cls._discriminator + except AttributeError: + return _path_to_schemas + # discriminator exists + disc_prop_name = list(_discriminator.keys())[0] + cls._ensure_discriminator_value_present(disc_prop_name, _instantiation_metadata, *args) + discriminated_cls = cls._get_discriminated_class( + disc_property_name=disc_prop_name, disc_payload_value=arg[disc_prop_name]) + if discriminated_cls is None: + raise ApiValueError( + "Invalid discriminator value was passed in to {}.{} Only the values {} are allowed at {}".format( + cls.__name__, + disc_prop_name, + list(_discriminator[disc_prop_name].keys()), + _instantiation_metadata.path_to_item + (disc_prop_name,) + ) + ) + if discriminated_cls in _instantiation_metadata.base_classes: + # we have already moved through this class so stop here + return _path_to_schemas + _instantiation_metadata.base_classes |= frozenset({cls}) + other_path_to_schemas = discriminated_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + update(_path_to_schemas, other_path_to_schemas) + return _path_to_schemas + + @classmethod + @property + def _additional_properties(cls): + return AnyTypeSchema + + @classmethod + @property + @functools.cache + def _property_names(cls): + property_names = set() + for var_name, var_value in cls.__dict__.items(): + # referenced models are classmethods + is_classmethod = type(var_value) is classmethod + if is_classmethod: + property_names.add(var_name) + continue + is_class = type(var_value) is type + if not is_class: + continue + if not issubclass(var_value, Schema): + continue + if var_name == '_additional_properties': + continue + property_names.add(var_name) + property_names = list(property_names) + property_names.sort() + return tuple(property_names) + + @classmethod + def _get_properties(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DictBase _get_properties, this is how properties are set + These values already passed validation + """ + dict_items = {} + # if we have definitions for property schemas convert values using it + # otherwise accept anything + + _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata + + for property_name_js, value in arg.items(): + property_cls = getattr(cls, property_name_js, cls._additional_properties) + property_path_to_item = _instantiation_metadata.path_to_item+(property_name_js,) + stored_property_cls = _instantiation_metadata.path_to_schemas.get(property_path_to_item) + if stored_property_cls: + property_cls = stored_property_cls + + if isinstance(value, property_cls): + dict_items[property_name_js] = value + continue + + prop_instantiation_metadata = InstantiationMetadata( + configuration=_instantiation_metadata.configuration, + from_server=_instantiation_metadata.from_server, + path_to_item=property_path_to_item, + path_to_schemas=_instantiation_metadata.path_to_schemas, + ) + if _instantiation_metadata.from_server: + new_value = property_cls._from_openapi_data(value, _instantiation_metadata=prop_instantiation_metadata) + else: + new_value = property_cls(value, _instantiation_metadata=prop_instantiation_metadata) + dict_items[property_name_js] = new_value + return dict_items + + def __setattr__(self, name, value): + if not isinstance(self, FileIO): + raise AttributeError('property setting not supported on immutable instances') + + def __getattr__(self, name): + if isinstance(self, frozendict): + # if an attribute does not exist + try: + return self[name] + except KeyError as ex: + raise AttributeError(str(ex)) + # print(('non-frozendict __getattr__', name)) + return super().__getattr__(self, name) + + def __getattribute__(self, name): + # print(('__getattribute__', name)) + # if an attribute does exist (for example as a class property but not as an instance method) + try: + return self[name] + except (KeyError, TypeError): + return super().__getattribute__(name) + + +inheritable_primitive_types_set = {Decimal, str, tuple, frozendict, FileIO, bytes} + + +class Schema: + """ + the base class of all swagger/openapi schemas/models + + ensures that: + - payload passes required validations + - payload is of allowed types + - payload value is an allowed enum value + """ + + @staticmethod + def __get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, frozendict): + return frozendict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, bytes): + return bytes + elif isinstance(input_value, (io.FileIO, io.BufferedReader)): + return FileIO + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + return int + elif isinstance(input_value, float): + return float + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif isinstance(input_value, str): + return str + return type(input_value) + + @staticmethod + def __get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed""" + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return "is {0}".format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + @classmethod + def __type_error_message( + cls, var_value=None, var_name=None, valid_classes=None, key_type=None + ): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a tuple + """ + key_or_value = "value" + if key_type: + key_or_value = "key" + valid_classes_phrase = cls.__get_valid_classes_phrase(valid_classes) + msg = "Invalid type. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + return msg + + @classmethod + def __get_type_error(cls, var_value, path_to_item, valid_classes, key_type=False): + error_msg = cls.__type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type, + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type, + ) + + @classmethod + def _class_by_base_class(cls, base_cls: type) -> type: + cls_name = "Dynamic"+cls.__name__ + if base_cls is bool: + new_cls = get_new_class(cls_name, (cls, BoolBase, BoolClass)) + elif base_cls is str: + new_cls = get_new_class(cls_name, (cls, StrBase, str)) + elif base_cls is Decimal: + new_cls = get_new_class(cls_name, (cls, NumberBase, Decimal)) + elif base_cls is tuple: + new_cls = get_new_class(cls_name, (cls, ListBase, tuple)) + elif base_cls is frozendict: + new_cls = get_new_class(cls_name, (cls, DictBase, frozendict)) + elif base_cls is none_type: + new_cls = get_new_class(cls_name, (cls, NoneBase, NoneClass)) + log_cache_usage(get_new_class) + return new_cls + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + Schema _validate + Runs all schema validation logic and + returns a dynamic class of different bases depending upon the input + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Use cases: + 1. inheritable type: string/Decimal/frozendict/tuple + 2. enum value cases: 'hi', 1 -> no base_class set because the enum includes the base class + 3. uninheritable type: True/False/None -> no base_class because the base class is not inheritable + _enum_by_value will handle this use case + + Required Steps: + 1. verify type of input is valid vs the allowed _types + 2. check validations that are applicable for this type of input + 3. if enums exist, check that the value exists in the enum + + Returns: + path_to_schemas: a map of path to schemas + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + arg = args[0] + + base_class = cls.__get_simple_class(arg) + failed_type_check_classes = cls._validate_type(base_class) + if failed_type_check_classes: + raise cls.__get_type_error( + arg, + _instantiation_metadata.path_to_item, + failed_type_check_classes, + key_type=False, + ) + if hasattr(cls, '_validate_validations_pass'): + cls._validate_validations_pass(arg, _instantiation_metadata) + path_to_schemas = defaultdict(set) + path_to_schemas[_instantiation_metadata.path_to_item].add(cls) + + if hasattr(cls, "_enum_by_value"): + cls._validate_enum_value(arg) + return path_to_schemas + + if base_class is none_type or base_class is bool: + return path_to_schemas + + path_to_schemas[_instantiation_metadata.path_to_item].add(base_class) + return path_to_schemas + + @classmethod + def _validate_enum_value(cls, arg): + try: + cls._enum_by_value[arg] + except KeyError: + raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name)) + + @classmethod + def __get_new_cls(cls, arg, _instantiation_metadata: InstantiationMetadata): + """ + PATH 1 - make a new dynamic class and return an instance of that class + We are making an instance of cls, but instead of making cls + make a new class, new_cls + which includes dynamic bases including cls + return an instance of that new class + """ + if ( + _instantiation_metadata.path_to_schemas and + _instantiation_metadata.path_to_item in _instantiation_metadata.path_to_schemas): + chosen_new_cls = _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] + # print('leaving __get_new_cls early for cls {} because path_to_schemas exists'.format(cls)) + # print(_instantiation_metadata.path_to_item) + # print(chosen_new_cls) + return chosen_new_cls + """ + Dict property + List Item Assignment Use cases: + 1. value is NOT an instance of the required schema class + the value is validated by _validate + _validate returns a key value pair + where the key is the path to the item, and the value will be the required manufactured class + made out of the matching schemas + 2. value is an instance of the the correct schema type + the value is NOT validated by _validate, _validate only checks that the instance is of the correct schema type + for this value, _validate does NOT return an entry for it in _path_to_schemas + and in list/dict _get_items,_get_properties the value will be directly assigned + because value is of the correct type, and validation was run earlier when the instance was created + """ + _path_to_schemas = cls._validate(arg, _instantiation_metadata=_instantiation_metadata) + from pprint import pprint + pprint(dict(_path_to_schemas)) + # loop through it make a new class for each entry + for path, schema_classes in _path_to_schemas.items(): + enum_schema = any( + hasattr(this_cls, '_enum_by_value') for this_cls in schema_classes) + inheritable_primitive_type = schema_classes.intersection(inheritable_primitive_types_set) + chosen_schema_classes = schema_classes + suffix = tuple() + if inheritable_primitive_type: + chosen_schema_classes = schema_classes - inheritable_primitive_types_set + if not enum_schema: + # include the inheritable_primitive_type + suffix = tuple(inheritable_primitive_type) + + if len(chosen_schema_classes) == 1 and not suffix: + mfg_cls = tuple(chosen_schema_classes)[0] + else: + x_schema = schema_descendents & chosen_schema_classes + if x_schema: + x_schema = x_schema.pop() + if any(c is not x_schema and issubclass(c, x_schema) for c in chosen_schema_classes): + # needed to not have a mro error in get_new_class + chosen_schema_classes.remove(x_schema) + used_classes = tuple(sorted(chosen_schema_classes, key=lambda a_cls: a_cls.__name__)) + suffix + mfg_cls = get_new_class(class_name='DynamicSchema', bases=used_classes) + + if inheritable_primitive_type and not enum_schema: + _instantiation_metadata.path_to_schemas[path] = mfg_cls + continue + + # Use case: value is None, True, False, or an enum value + # print('choosing enum class for path {} in arg {}'.format(path, arg)) + value = arg + for key in path[1:]: + value = value[key] + if hasattr(mfg_cls, '_enum_by_value'): + mfg_cls = mfg_cls._enum_by_value[value] + elif value in {True, False}: + mfg_cls = mfg_cls._class_by_base_class(bool) + elif value is None: + mfg_cls = mfg_cls._class_by_base_class(none_type) + else: + raise ApiValueError('Unhandled case value={} bases={}'.format(value, mfg_cls.__bases__)) + _instantiation_metadata.path_to_schemas[path] = mfg_cls + + return _instantiation_metadata.path_to_schemas[_instantiation_metadata.path_to_item] + + @classmethod + def __get_new_instance_without_conversion(cls, arg, _instantiation_metadata): + # PATH 2 - we have a Dynamic class and we are making an instance of it + if issubclass(cls, tuple): + items = cls._get_items(arg, _instantiation_metadata=_instantiation_metadata) + return super(Schema, cls).__new__(cls, items) + elif issubclass(cls, frozendict): + properties = cls._get_properties(arg, _instantiation_metadata=_instantiation_metadata) + return super(Schema, cls).__new__(cls, properties) + """ + str = openapi str, date, and datetime + Decimal = openapi int and float + FileIO = openapi binary type and the user inputs a file + bytes = openapi binary type and the user inputs bytes + """ + return super(Schema, cls).__new__(cls, arg) + + @classmethod + def _from_openapi_data( + cls, + arg: typing.Union[ + str, + date, + datetime, + int, + float, + Decimal, + bool, + None, + 'Schema', + dict, + frozendict, + tuple, + list, + io.FileIO, + io.BufferedReader, + bytes + ], + _instantiation_metadata: typing.Optional[InstantiationMetadata] + ): + arg = cast_to_allowed_types(arg, from_server=True) + _instantiation_metadata = InstantiationMetadata(from_server=True) if _instantiation_metadata is None else _instantiation_metadata + if not _instantiation_metadata.from_server: + raise ApiValueError( + 'from_server must be True in this code path, if you need it to be False, use cls()' + ) + new_cls = cls.__get_new_cls(arg, _instantiation_metadata) + new_inst = new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + return new_inst + + @staticmethod + def __get_input_dict(*args, **kwargs) -> frozendict: + input_dict = {} + if args and isinstance(args[0], (dict, frozendict)): + input_dict.update(args[0]) + if kwargs: + input_dict.update(kwargs) + return frozendict(input_dict) + + @staticmethod + def __remove_unsets(kwargs): + return {key: val for key, val in kwargs.items() if val is not unset} + + def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + """ + Schema __new__ + + Args: + args (int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): the value + kwargs (str, int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + _instantiation_metadata: contains the needed from_server, configuration, path_to_item + """ + kwargs = cls.__remove_unsets(kwargs) + if not args and not kwargs: + raise TypeError( + 'No input given. args or kwargs must be given.' + ) + if not kwargs and args and not isinstance(args[0], dict): + arg = args[0] + else: + arg = cls.__get_input_dict(*args, **kwargs) + _instantiation_metadata = InstantiationMetadata() if _instantiation_metadata is None else _instantiation_metadata + if _instantiation_metadata.from_server: + raise ApiValueError( + 'from_server must be False in this code path, if you need it to be True, use cls._from_openapi_data()' + ) + arg = cast_to_allowed_types(arg, from_server=_instantiation_metadata.from_server) + new_cls = cls.__get_new_cls(arg, _instantiation_metadata) + return new_cls.__get_new_instance_without_conversion(arg, _instantiation_metadata) + + def __init__( + self, + *args: typing.Union[ + dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Union[ + dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + ] + ): + """ + this is needed to fix 'Unexpected argument' warning in pycharm + this code does nothing because all Schema instances are immutable + this means that all input data is passed into and used in new, and after the new instance is made + no new attributes are assigned and init is not used + """ + pass + + +def cast_to_allowed_types(arg: typing.Union[str, date, datetime, int, float, None, dict, frozendict, list, tuple, bytes, Schema], from_server=False) -> typing.Union[str, bytes, int, float, None, frozendict, tuple, Schema]: + """ + from_server=False date, datetime -> str + int, float -> Decimal + StrSchema will convert that to bytes and remember the encoding when we pass in str input + """ + if isinstance(arg, (date, datetime)): + if not from_server: + return arg.isoformat() + # ApiTypeError will be thrown later by _validate_type + return arg + elif isinstance(arg, bool): + """ + this check must come before isinstance(arg, (int, float)) + because isinstance(True, int) is True + """ + return arg + elif isinstance(arg, Decimal): + return arg + elif isinstance(arg, int): + return Decimal(arg) + elif isinstance(arg, float): + decimal_from_float = Decimal(arg) + if decimal_from_float.as_integer_ratio()[1] == 1: + # 9.0 -> Decimal('9.0') + # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') + return Decimal(str(decimal_from_float)+'.0') + return decimal_from_float + elif isinstance(arg, str): + return arg + elif isinstance(arg, bytes): + return arg + elif isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: + raise ApiValueError('Invalid file state; file is closed and must be open') + return arg + elif type(arg) is list or type(arg) is tuple: + return tuple([cast_to_allowed_types(item) for item in arg]) + elif type(arg) is dict or type(arg) is frozendict: + return frozendict({key: cast_to_allowed_types(val) for key, val in arg.items() if val is not unset}) + elif arg is None: + return arg + elif isinstance(arg, Schema): + return arg + raise ValueError('Invalid type passed in got input={} type={}'.format(arg, type(arg))) + + +class ComposedBase(Discriminable): + + @classmethod + def __get_allof_classes(cls, *args, _instantiation_metadata: InstantiationMetadata): + path_to_schemas = defaultdict(set) + for allof_cls in cls._composed_schemas['allOf']: + if allof_cls in _instantiation_metadata.base_classes: + continue + other_path_to_schemas = allof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + return path_to_schemas + + @classmethod + def __get_oneof_class( + cls, + *args, + discriminated_cls, + _instantiation_metadata: InstantiationMetadata, + path_to_schemas: typing.Dict[typing.Tuple, typing.Set[typing.Type[Schema]]] + ): + oneof_classes = [] + chosen_oneof_cls = None + original_base_classes = _instantiation_metadata.base_classes + new_base_classes = _instantiation_metadata.base_classes + path_to_schemas = defaultdict(set) + for oneof_cls in cls._composed_schemas['oneOf']: + if oneof_cls in path_to_schemas[_instantiation_metadata.path_to_item]: + oneof_classes.append(oneof_cls) + continue + if isinstance(args[0], oneof_cls): + # passed in instance is the correct type + chosen_oneof_cls = oneof_cls + oneof_classes.append(oneof_cls) + continue + _instantiation_metadata.base_classes = original_base_classes + try: + path_to_schemas = oneof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + new_base_classes = _instantiation_metadata.base_classes + except (ApiValueError, ApiTypeError) as ex: + if discriminated_cls is not None and oneof_cls is discriminated_cls: + raise ex + continue + chosen_oneof_cls = oneof_cls + oneof_classes.append(oneof_cls) + if not oneof_classes: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the oneOf schemas matched the input data.".format(cls) + ) + elif len(oneof_classes) > 1: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. Multiple " + "oneOf schemas {} matched the inputs, but a max of one is allowed.".format(cls, oneof_classes) + ) + _instantiation_metadata.base_classes = new_base_classes + return path_to_schemas + + @classmethod + def __get_anyof_classes( + cls, + *args, + discriminated_cls, + _instantiation_metadata: InstantiationMetadata + ): + anyof_classes = [] + chosen_anyof_cls = None + original_base_classes = _instantiation_metadata.base_classes + path_to_schemas = defaultdict(set) + for anyof_cls in cls._composed_schemas['anyOf']: + if anyof_cls in _instantiation_metadata.base_classes: + continue + if isinstance(args[0], anyof_cls): + # passed in instance is the correct type + chosen_anyof_cls = anyof_cls + anyof_classes.append(anyof_cls) + continue + + _instantiation_metadata.base_classes = original_base_classes + try: + other_path_to_schemas = anyof_cls._validate(*args, _instantiation_metadata=_instantiation_metadata) + except (ApiValueError, ApiTypeError) as ex: + if discriminated_cls is not None and anyof_cls is discriminated_cls: + raise ex + continue + original_base_classes = _instantiation_metadata.base_classes + chosen_anyof_cls = anyof_cls + anyof_classes.append(anyof_cls) + update(path_to_schemas, other_path_to_schemas) + if not anyof_classes: + raise ApiValueError( + "Invalid inputs given to generate an instance of {}. None " + "of the anyOf schemas matched the input data.".format(cls) + ) + return path_to_schemas + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + ComposedBase _validate + We return dynamic classes of different bases depending upon the inputs + This makes it so: + - the returned instance is always a subclass of our defining schema + - this allows us to check type based on whether an instance is a subclass of a schema + - the returned instance is a serializable type (except for None, True, and False) which are enums + + Returns: + new_cls (type): the new class + + Raises: + ApiValueError: when a string can't be converted into a date or datetime and it must be one of those classes + ApiTypeError: when the input type is not in the list of allowed spec types + """ + if args and isinstance(args[0], Schema) and _instantiation_metadata.from_server is False: + if isinstance(args[0], cls): + # an instance of the correct type was passed in + return {} + raise ApiTypeError( + 'Incorrect type passed in, required type was {} and passed type was {} at {}'.format( + cls, + type(args[0]), + _instantiation_metadata.path_to_item + ) + ) + + # validation checking on types, validations, and enums + path_to_schemas = super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + _instantiation_metadata.base_classes |= frozenset({cls}) + + # process composed schema + _discriminator = getattr(cls, '_discriminator', None) + discriminated_cls = None + if _discriminator and args and isinstance(args[0], frozendict): + disc_property_name = list(_discriminator.keys())[0] + cls._ensure_discriminator_value_present(disc_property_name, _instantiation_metadata, *args) + # get discriminated_cls by looking at the dict in the current class + discriminated_cls = cls._get_discriminated_class( + disc_property_name=disc_property_name, disc_payload_value=args[0][disc_property_name]) + if discriminated_cls is None: + raise ApiValueError( + "Invalid discriminator value '{}' was passed in to {}.{} Only the values {} are allowed at {}".format( + args[0][disc_property_name], + cls.__name__, + disc_property_name, + list(_discriminator[disc_property_name].keys()), + _instantiation_metadata.path_to_item + (disc_property_name,) + ) + ) + + if cls._composed_schemas['allOf']: + other_path_to_schemas = cls.__get_allof_classes(*args, _instantiation_metadata=_instantiation_metadata) + update(path_to_schemas, other_path_to_schemas) + if cls._composed_schemas['oneOf']: + other_path_to_schemas = cls.__get_oneof_class( + *args, + discriminated_cls=discriminated_cls, + _instantiation_metadata=_instantiation_metadata, + path_to_schemas=path_to_schemas + ) + update(path_to_schemas, other_path_to_schemas) + if cls._composed_schemas['anyOf']: + other_path_to_schemas = cls.__get_anyof_classes( + *args, + discriminated_cls=discriminated_cls, + _instantiation_metadata=_instantiation_metadata + ) + update(path_to_schemas, other_path_to_schemas) + + if discriminated_cls is not None: + # TODO use an exception from this package here + assert discriminated_cls in path_to_schemas[_instantiation_metadata.path_to_item] + return path_to_schemas + + +# DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase +class ComposedSchema( + _SchemaTypeChecker(typing.Union[none_type, str, Decimal, bool, tuple, frozendict]), + ComposedBase, + DictBase, + ListBase, + NumberBase, + StrBase, + BoolBase, + NoneBase, + Schema +): + + # subclass properties + _composed_schemas = {} + + @classmethod + def _from_openapi_data(cls, *args: typing.Any, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs): + if not args: + if not kwargs: + raise ApiTypeError('{} is missing required input data in args or kwargs'.format(cls.__name__)) + args = (kwargs, ) + return super()._from_openapi_data(args[0], _instantiation_metadata=_instantiation_metadata) + + +class ListSchema( + _SchemaTypeChecker(typing.Union[tuple]), + ListBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.List[typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[list, tuple], **kwargs: InstantiationMetadata): + return super().__new__(cls, arg, **kwargs) + + +class NoneSchema( + _SchemaTypeChecker(typing.Union[none_type]), + NoneBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: None, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: None, **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class NumberSchema( + _SchemaTypeChecker(typing.Union[Decimal]), + NumberBase, + Schema +): + """ + This is used for type: number with no format + Both integers AND floats are accepted + """ + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[int, float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class IntBase(NumberBase): + @property + def as_int(self) -> int: + try: + return self._as_int + except AttributeError: + self._as_int = int(self) + return self._as_int + + @classmethod + def _validate_format(cls, arg: typing.Optional[Decimal], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, Decimal): + exponent = arg.as_tuple().exponent + if exponent != 0: + raise ApiValueError( + "Invalid value '{}' for type integer at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + IntBase _validate + TODO what about types = (int, number) -> IntBase, NumberBase? We could drop int and keep number only + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + +class IntSchema(IntBase, NumberSchema): + + @classmethod + def _from_openapi_data(cls, arg: int, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class Int32Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-2147483648), + inclusive_maximum=Decimal(2147483647) + ), + IntSchema +): + pass + +class Int64Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-9223372036854775808), + inclusive_maximum=Decimal(9223372036854775807) + ), + IntSchema +): + pass + + +class Float32Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-3.4028234663852886e+38), + inclusive_maximum=Decimal(3.4028234663852886e+38) + ), + NumberSchema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + # todo check format + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + +class Float64Schema( + _SchemaValidator( + inclusive_minimum=Decimal(-1.7976931348623157E+308), + inclusive_maximum=Decimal(1.7976931348623157E+308) + ), + NumberSchema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + # todo check format + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + +class StrSchema( + _SchemaTypeChecker(typing.Union[str]), + StrBase, + Schema +): + """ + date + datetime string types must inherit from this class + That is because one can validate a str payload as both: + - type: string (format unset) + - type: string, format: date + """ + + @classmethod + def _from_openapi_data(cls, arg: typing.Union[str], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None) -> 'StrSchema': + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: typing.Union[str, date, datetime], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class DateSchema(DateBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class DateTimeSchema(DateTimeBase, StrSchema): + + def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class BytesSchema( + _SchemaTypeChecker(typing.Union[bytes]), + Schema, +): + """ + this class will subclass bytes and is immutable + """ + def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[InstantiationMetadata]): + return super(Schema, cls).__new__(cls, arg) + + +class FileSchema( + _SchemaTypeChecker(typing.Union[FileIO]), + Schema, +): + """ + This class is NOT immutable + Dynamic classes are built using it for example when AnyType allows in binary data + Al other schema classes ARE immutable + If one wanted to make this immutable one could make this a DictSchema with required properties: + - data = BytesSchema (which would be an immutable bytes based schema) + - file_name = StrSchema + and cast_to_allowed_types would convert bytes and file instances into dicts containing data + file_name + The downside would be that data would be stored in memory which one may not want to do for very large files + + The developer is responsible for closing this file and deleting it + + This class was kept as mutable: + - to allow file reading and writing to disk + - to be able to preserve file name info + """ + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[InstantiationMetadata]): + return super(Schema, cls).__new__(cls, arg) + + +class BinaryBase: + pass + + +class BinarySchema( + _SchemaTypeChecker(typing.Union[bytes, FileIO]), + ComposedBase, + BinaryBase, + Schema, +): + + @classmethod + @property + def _composed_schemas(cls): + # 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 because 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 { + 'allOf': [], + 'oneOf': [ + BytesSchema, + FileSchema, + ], + 'anyOf': [ + ], + } + + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg) + + +class BoolSchema( + _SchemaTypeChecker(typing.Union[bool]), + BoolBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: bool, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, arg: bool, **kwargs: typing.Union[InstantiationMetadata]): + return super().__new__(cls, arg, **kwargs) + + +class AnyTypeSchema( + _SchemaTypeChecker( + typing.Union[frozendict, tuple, Decimal, str, bool, none_type, bytes, FileIO] + ), + DictBase, + ListBase, + NumberBase, + StrBase, + BoolBase, + NoneBase, + Schema +): + pass + + +class DictSchema( + _SchemaTypeChecker(typing.Union[frozendict]), + DictBase, + Schema +): + + @classmethod + def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) + + def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): + return super().__new__(cls, *args, **kwargs) + + +schema_descendents = set([NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema]) + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +@functools.cache +def get_new_class( + class_name: str, + bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...] +) -> typing.Type[Schema]: + """ + Returns a new class that is made with the subclass bases + """ + return type(class_name, bases, {}) + + +LOG_CACHE_USAGE = False + + +def log_cache_usage(cache_fn): + if LOG_CACHE_USAGE: + print(cache_fn.__name__, cache_fn.cache_info()) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py new file mode 100644 index 00000000000..22b3bf2bf1d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -0,0 +1,416 @@ +# 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 base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from email.utils import formatdate +import json +import os +import re +from time import time +from urllib.parse import urlencode, urlparse + +# The constants below define a subset of HTTP headers that can be included in the +# HTTP signature scheme. Additional headers may be included in the signature. + +# The '(request-target)' header is a calculated field that includes the HTTP verb, +# the URL path and the URL query. +HEADER_REQUEST_TARGET = '(request-target)' +# The time when the HTTP signature was generated. +HEADER_CREATED = '(created)' +# The time when the HTTP signature expires. The API server should reject HTTP requests +# that have expired. +HEADER_EXPIRES = '(expires)' +# The 'Host' header. +HEADER_HOST = 'Host' +# The 'Date' header. +HEADER_DATE = 'Date' +# When the 'Digest' header is included in the HTTP signature, the client automatically +# computes the digest of the HTTP request body, per RFC 3230. +HEADER_DIGEST = 'Digest' +# The 'Authorization' header is automatically generated by the client. It includes +# the list of signed headers and a base64-encoded signature. +HEADER_AUTHORIZATION = 'Authorization' + +# The constants below define the cryptographic schemes for the HTTP signature scheme. +SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' + +# The constants below define the signature algorithms that can be used for the HTTP +# signature scheme. +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 +} + +# The cryptographic hash algorithm for the message signature. +HASH_SHA256 = 'sha256' +HASH_SHA512 = 'sha512' + + +class HttpSigningConfiguration(object): + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: A string value specifying the identifier of the cryptographic key, + when signing HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + If None, the signing algorithm is inferred from the private key. + The default signing algorithm for RSA keys is RSASSA-PSS. + The default signing algorithm for ECDSA keys is fips-186-3. + :param hash_algorithm: The hash algorithm for the signature. Supported values are + sha256 and sha512. + If the signing_scheme is rsa-sha256, the hash algorithm must be set + to None or sha256. + If the signing_scheme is rsa-sha512, the hash algorithm must be set + to None or sha512. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. + """ + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, + signed_headers=None, + signing_algorithm=None, + hash_algorithm=None, + signature_max_validity=None): + self.key_id = key_id + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) + self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase + self.signing_algorithm = signing_algorithm + self.hash_algorithm = hash_algorithm + if signing_scheme == SCHEME_RSA_SHA256: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA256 + elif self.hash_algorithm != HASH_SHA256: + raise Exception("Hash algorithm must be sha256 when security scheme is %s" % + SCHEME_RSA_SHA256) + elif signing_scheme == SCHEME_RSA_SHA512: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA512 + elif self.hash_algorithm != HASH_SHA512: + raise Exception("Hash algorithm must be sha512 when security scheme is %s" % + SCHEME_RSA_SHA512) + elif signing_scheme == SCHEME_HS2019: + if self.hash_algorithm is None: + self.hash_algorithm = HASH_SHA256 + elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}: + raise Exception("Invalid hash algorithm") + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: + raise Exception( + "Signature max validity must be set when " + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if HEADER_AUTHORIZATION in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + """ + self._load_private_key() + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_list, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) + + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) + + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( + signed_headers_list, b64_signed_msg) + + return request_headers_dict + + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + + def _load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) + else: + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) + + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object (e.g. a dict) representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + request_target += "?" + urlencode(query_params) + + # Get UNIX time, e.g. seconds since epoch, not including leap seconds. + now = time() + # Format date per RFC 7231 section-7.1.1.2. An example is: + # Date: Wed, 21 Oct 2015 07:28:00 GMT + cdate = formatdate(timeval=now, localtime=False, usegmt=True) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = int(now) + if self.signature_max_validity is not None: + expires = now + self.signature_max_validity.total_seconds() + + signed_headers_list = [] + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = '{0}'.format(created) + elif hdr_key == HEADER_EXPIRES: + value = '{0}'.format(expires) + elif hdr_key == HEADER_DATE.lower(): + value = cdate + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST.lower(): + request_body = body.encode() + body_digest, digest_prefix = self._get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST.lower(): + value = target_host + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + else: + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception( + "Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) + signed_headers_list.append((hdr_key, value)) + + return signed_headers_list, request_headers_dict + + def _get_message_digest(self, data): + """Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. + """ + if self.hash_algorithm == HASH_SHA512: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.hash_algorithm == HASH_SHA256: + digest = SHA256.new() + prefix = 'SHA-256=' + else: + raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm)) + digest.update(data) + return digest, prefix + + def _sign_digest(self, digest): + """Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: + # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding. + # Issue: https://github.com/w3c-ccg/http-signatures/issues/107 + signature = DSS.new(key=self.private_key, mode=sig_alg, + encoding='der').sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + else: + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) + + def _get_authorization_header(self, signed_headers, signed_msg): + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) + + return auth_str diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt new file mode 100644 index 00000000000..c9227e58a1b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +frozendict >= 2.0.3 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.cfg b/samples/openapi3/client/petstore/python-experimental/setup.cfg new file mode 100644 index 00000000000..11433ee875a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py new file mode 100644 index 00000000000..c0194e51636 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -0,0 +1,48 @@ +# 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 setuptools import setup, find_packages # noqa: H301 + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "urllib3 >= 1.15", + "certifi", + "python-dateutil", + "frozendict >= 2.0.3", + "pem>=19.3.0", + "pycryptodome>=3.9.0", +] + +setup( + name=NAME, + version=VERSION, + description="OpenAPI Petstore", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + python_requires=">=3.9", + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache-2.0", + long_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: \" \\ # noqa: E501 + """ +) diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt new file mode 100644 index 00000000000..36d9b4fa7a8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -0,0 +1,4 @@ +pytest~=4.6.7 # needed for python 3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 3.4 +pycryptodome>=3.9.0 diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d 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 new file mode 100644 index 00000000000..442b5ed138a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_AdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py new file mode 100644 index 00000000000..076df41d63f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums + + +class TestAdditionalPropertiesWithArrayOfEnums(unittest.TestCase): + """AdditionalPropertiesWithArrayOfEnums unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_AdditionalPropertiesWithArrayOfEnums(self): + """Test AdditionalPropertiesWithArrayOfEnums""" + # FIXME: construct object with mandatory attributes with example values + # model = AdditionalPropertiesWithArrayOfEnums() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_address.py b/samples/openapi3/client/petstore/python-experimental/test/test_address.py new file mode 100644 index 00000000000..78d67400748 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_address.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.address import Address + + +class TestAddress(unittest.TestCase): + """Address unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Address(self): + """Test Address""" + # FIXME: construct object with mandatory attributes with example values + # model = Address() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py new file mode 100644 index 00000000000..572450a9704 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.animal import Animal + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Animal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py new file mode 100644 index 00000000000..3ee8615f57c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.animal_farm import AnimalFarm + + +class TestAnimalFarm(unittest.TestCase): + """AnimalFarm unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_AnimalFarm(self): + """Test AnimalFarm""" + # FIXME: construct object with mandatory attributes with example values + # model = AnimalFarm() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..c58dfa6202b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..63dc0ede9b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.api_response import ApiResponse + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py new file mode 100644 index 00000000000..e8abc62ef04 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.apple import Apple + + +class TestApple(unittest.TestCase): + """Apple unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Apple(self): + """Test Apple""" + # FIXME: construct object with mandatory attributes with example values + # model = Apple() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..38edc7a55da --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.apple_req import AppleReq + + +class TestAppleReq(unittest.TestCase): + """AppleReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_AppleReq(self): + """Test AppleReq""" + # FIXME: construct object with mandatory attributes with example values + # model = AppleReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py new file mode 100644 index 00000000000..cee2263dd67 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType + + +class TestArrayHoldingAnyType(unittest.TestCase): + """ArrayHoldingAnyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ArrayHoldingAnyType(self): + """Test ArrayHoldingAnyType""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayHoldingAnyType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..ebf1ad38367 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py new file mode 100644 index 00000000000..44a59bb5263 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_of_enums import ArrayOfEnums + + +class TestArrayOfEnums(unittest.TestCase): + """ArrayOfEnums unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ArrayOfEnums(self): + """Test ArrayOfEnums""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayOfEnums() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..21bffad3329 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..4528c568690 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_test import ArrayTest + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py new file mode 100644 index 00000000000..95a19cba751 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems + + +class TestArrayWithValidationsInItems(unittest.TestCase): + """ArrayWithValidationsInItems unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ArrayWithValidationsInItems(self): + """Test ArrayWithValidationsInItems""" + # FIXME: construct object with mandatory attributes with example values + # model = ArrayWithValidationsInItems() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py new file mode 100644 index 00000000000..77b1b2aaf30 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.banana import Banana + + +class TestBanana(unittest.TestCase): + """Banana unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Banana(self): + """Test Banana""" + # FIXME: construct object with mandatory attributes with example values + # model = Banana() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..2bfbb9edb4c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.banana_req import BananaReq + + +class TestBananaReq(unittest.TestCase): + """BananaReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_BananaReq(self): + """Test BananaReq""" + # FIXME: construct object with mandatory attributes with example values + # model = BananaReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_bar.py b/samples/openapi3/client/petstore/python-experimental/test/test_bar.py new file mode 100644 index 00000000000..3d942938467 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_bar.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.bar import Bar + + +class TestBar(unittest.TestCase): + """Bar unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Bar(self): + """Test Bar""" + # FIXME: construct object with mandatory attributes with example values + # model = Bar() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..4af8d8947ca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.basque_pig import BasquePig + + +class TestBasquePig(unittest.TestCase): + """BasquePig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_BasquePig(self): + """Test BasquePig""" + # FIXME: construct object with mandatory attributes with example values + # model = BasquePig() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py b/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py new file mode 100644 index 00000000000..c2e2faab188 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.boolean import Boolean + + +class TestBoolean(unittest.TestCase): + """Boolean unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Boolean(self): + """Test Boolean""" + # FIXME: construct object with mandatory attributes with example values + # model = Boolean() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py new file mode 100644 index 00000000000..2d73bc707f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.boolean_enum import BooleanEnum + + +class TestBooleanEnum(unittest.TestCase): + """BooleanEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_BooleanEnum(self): + """Test BooleanEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = BooleanEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py new file mode 100644 index 00000000000..8cb68360735 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.capitalization import Capitalization + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Capitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py new file mode 100644 index 00000000000..7c2b75fe8af --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.cat import Cat + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Cat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..84ebd083410 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.cat_all_of import CatAllOf + + +class TestCatAllOf(unittest.TestCase): + """CatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_CatAllOf(self): + """Test CatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = CatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py new file mode 100644 index 00000000000..8f19639fb51 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.category import Category + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Category(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..f4be6a52a8d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.child_cat import ChildCat + + +class TestChildCat(unittest.TestCase): + """ChildCat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ChildCat(self): + """Test ChildCat""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildCat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..410ac2772ab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.child_cat_all_of import ChildCatAllOf + + +class TestChildCatAllOf(unittest.TestCase): + """ChildCatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ChildCatAllOf(self): + """Test ChildCatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChildCatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..6a472da41ae --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.class_model import ClassModel + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py new file mode 100644 index 00000000000..70a26741f40 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.client import Client + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Client(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..95c68678521 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + + +class TestComplexQuadrilateral(unittest.TestCase): + """ComplexQuadrilateral unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComplexQuadrilateral(self): + """Test ComplexQuadrilateral""" + # FIXME: construct object with mandatory attributes with example values + # model = ComplexQuadrilateral() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py new file mode 100644 index 00000000000..96fdc5103f3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.complex_quadrilateral_all_of import ComplexQuadrilateralAllOf + + +class TestComplexQuadrilateralAllOf(unittest.TestCase): + """ComplexQuadrilateralAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComplexQuadrilateralAllOf(self): + """Test ComplexQuadrilateralAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ComplexQuadrilateralAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py new file mode 100644 index 00000000000..92263d13945 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_any_of_different_types_no_validations import ComposedAnyOfDifferentTypesNoValidations + + +class TestComposedAnyOfDifferentTypesNoValidations(unittest.TestCase): + """ComposedAnyOfDifferentTypesNoValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedAnyOfDifferentTypesNoValidations(self): + """Test ComposedAnyOfDifferentTypesNoValidations""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedAnyOfDifferentTypesNoValidations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py new file mode 100644 index 00000000000..3e48ed79fe5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_array import ComposedArray + + +class TestComposedArray(unittest.TestCase): + """ComposedArray unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedArray(self): + """Test ComposedArray""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedArray() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py new file mode 100644 index 00000000000..790edcc16d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_bool import ComposedBool + + +class TestComposedBool(unittest.TestCase): + """ComposedBool unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedBool(self): + """Test ComposedBool""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedBool() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py new file mode 100644 index 00000000000..65c7dd5adb9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_none import ComposedNone + + +class TestComposedNone(unittest.TestCase): + """ComposedNone unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedNone(self): + """Test ComposedNone""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedNone() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py new file mode 100644 index 00000000000..66fdc3c591e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_number import ComposedNumber + + +class TestComposedNumber(unittest.TestCase): + """ComposedNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedNumber(self): + """Test ComposedNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedNumber() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py new file mode 100644 index 00000000000..6212b89f9bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_object import ComposedObject + + +class TestComposedObject(unittest.TestCase): + """ComposedObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedObject(self): + """Test ComposedObject""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py new file mode 100644 index 00000000000..b15712de301 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes + + +class TestComposedOneOfDifferentTypes(unittest.TestCase): + """ComposedOneOfDifferentTypes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedOneOfDifferentTypes(self): + """Test ComposedOneOfDifferentTypes""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedOneOfDifferentTypes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py new file mode 100644 index 00000000000..2bfcf2f74d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_string import ComposedString + + +class TestComposedString(unittest.TestCase): + """ComposedString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedString(self): + """Test ComposedString""" + # FIXME: construct object with mandatory attributes with example values + # model = ComposedString() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..1a46253ed9f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.danish_pig import DanishPig + + +class TestDanishPig(unittest.TestCase): + """DanishPig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_DanishPig(self): + """Test DanishPig""" + # FIXME: construct object with mandatory attributes with example values + # model = DanishPig() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py new file mode 100644 index 00000000000..275b74c92a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.date_time_test import DateTimeTest + + +class TestDateTimeTest(unittest.TestCase): + """DateTimeTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_DateTimeTest(self): + """Test DateTimeTest""" + # FIXME: construct object with mandatory attributes with example values + # model = DateTimeTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py new file mode 100644 index 00000000000..0edf5c5e85b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.date_time_with_validations import DateTimeWithValidations + + +class TestDateTimeWithValidations(unittest.TestCase): + """DateTimeWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_DateTimeWithValidations(self): + """Test DateTimeWithValidations""" + # FIXME: construct object with mandatory attributes with example values + # model = DateTimeWithValidations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py new file mode 100644 index 00000000000..866e5529225 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.date_with_validations import DateWithValidations + + +class TestDateWithValidations(unittest.TestCase): + """DateWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_DateWithValidations(self): + """Test DateWithValidations""" + # FIXME: construct object with mandatory attributes with example values + # model = DateWithValidations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..caf174d6d4b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -0,0 +1,36 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.api.default_api import DefaultApi # noqa: E501 + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_foo_get(self): + """Test case for foo_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py new file mode 100644 index 00000000000..4643c7af835 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.dog import Dog + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Dog(self): + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = Dog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..89526f7051f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.dog_all_of import DogAllOf + + +class TestDogAllOf(unittest.TestCase): + """DogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_DogAllOf(self): + """Test DogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = DogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py new file mode 100644 index 00000000000..091d89c80e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.drawing import Drawing + + +class TestDrawing(unittest.TestCase): + """Drawing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Drawing(self): + """Test Drawing""" + # FIXME: construct object with mandatory attributes with example values + # model = Drawing() # noqa: E501 + pass + + +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 new file mode 100644 index 00000000000..0b7e553a7d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.enum_arrays import EnumArrays + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_EnumArrays(self): + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = EnumArrays() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..298c740defa --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.enum_class import EnumClass + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_EnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..2022b10d5d5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.enum_test import EnumTest + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_EnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..d85647271ce --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.equilateral_triangle import EquilateralTriangle + + +class TestEquilateralTriangle(unittest.TestCase): + """EquilateralTriangle unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_EquilateralTriangle(self): + """Test EquilateralTriangle""" + # FIXME: construct object with mandatory attributes with example values + # model = EquilateralTriangle() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py new file mode 100644 index 00000000000..9651e4efd43 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.equilateral_triangle_all_of import EquilateralTriangleAllOf + + +class TestEquilateralTriangleAllOf(unittest.TestCase): + """EquilateralTriangleAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_EquilateralTriangleAllOf(self): + """Test EquilateralTriangleAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = EquilateralTriangleAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..abe26cc6c4d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -0,0 +1,192 @@ +# 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 +""" + +import unittest + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_additional_properties_with_array_of_enums(self): + """Test case for additional_properties_with_array_of_enums + + Additional Properties with Array of Enums # noqa: E501 + """ + pass + + def test_array_model(self): + """Test case for array_model + + """ + pass + + def test_array_of_enums(self): + """Test case for array_of_enums + + Array of Enums # noqa: E501 + """ + pass + + def test_body_with_file_schema(self): + """Test case for body_with_file_schema + + """ + pass + + def test_body_with_query_params(self): + """Test case for body_with_query_params + + """ + pass + + def test_boolean(self): + """Test case for boolean + + """ + pass + + def test_case_sensitive_params(self): + """Test case for case_sensitive_params + + """ + pass + + def test_client_model(self): + """Test case for client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_composed_one_of_different_types(self): + """Test case for composed_one_of_different_types + + """ + pass + + def test_endpoint_parameters(self): + """Test case for endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + """ + pass + + def test_enum_parameters(self): + """Test case for enum_parameters + + To test enum parameters # noqa: E501 + """ + pass + + def test_fake_health_get(self): + """Test case for fake_health_get + + Health check endpoint # noqa: E501 + """ + pass + + def test_group_parameters(self): + """Test case for group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + + def test_inline_additional_properties(self): + """Test case for inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_json_form_data(self): + """Test case for json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + def test_mammal(self): + """Test case for mammal + + """ + pass + + def test_number_with_validations(self): + """Test case for number_with_validations + + """ + pass + + def test_object_model_with_ref_props(self): + """Test case for object_model_with_ref_props + + """ + pass + + def test_parameter_collisions(self): + """Test case for parameter_collisions + + parameter collision case # noqa: E501 + """ + pass + + def test_query_parameter_collection_format(self): + """Test case for query_parameter_collection_format + + """ + pass + + def test_string(self): + """Test case for string + + """ + pass + + def test_string_enum(self): + """Test case for string_enum + + """ + pass + + def test_upload_download_file(self): + """Test case for upload_download_file + + uploads a file and downloads a file using application/octet-stream # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads a file using multipart/form-data # noqa: E501 + """ + pass + + def test_upload_files(self): + """Test case for upload_files + + uploads files using multipart/form-data # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..b7724aaed7d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py new file mode 100644 index 00000000000..7154338bc7a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.file import File + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_File(self): + """Test File""" + # FIXME: construct object with mandatory attributes with example values + # model = File() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..0b56063d59f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.file_schema_test_class import FileSchemaTestClass + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_FileSchemaTestClass(self): + """Test FileSchemaTestClass""" + # FIXME: construct object with mandatory attributes with example values + # model = FileSchemaTestClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py new file mode 100644 index 00000000000..69fbc69ba9e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.foo import Foo + + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Foo(self): + """Test Foo""" + # FIXME: construct object with mandatory attributes with example values + # model = Foo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..e5d081ceaa4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.format_test import FormatTest + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_FormatTest(self): + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = FormatTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py new file mode 100644 index 00000000000..43a58a870c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.fruit import Fruit + + +class TestFruit(unittest.TestCase): + """Fruit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Fruit(self): + """Test Fruit""" + # FIXME: construct object with mandatory attributes with example values + # model = Fruit() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.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 new file mode 100644 index 00000000000..3745b38f17e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.fruit_req import FruitReq + + +class TestFruitReq(unittest.TestCase): + """FruitReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_FruitReq(self): + """Test FruitReq""" + # FIXME: construct object with mandatory attributes with example values + # model = FruitReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..487e5275516 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.gm_fruit import GmFruit + + +class TestGmFruit(unittest.TestCase): + """GmFruit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_GmFruit(self): + """Test GmFruit""" + # FIXME: construct object with mandatory attributes with example values + # model = GmFruit() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..8820ad5f253 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.grandparent_animal import GrandparentAnimal + + +class TestGrandparentAnimal(unittest.TestCase): + """GrandparentAnimal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_GrandparentAnimal(self): + """Test GrandparentAnimal""" + # FIXME: construct object with mandatory attributes with example values + # model = GrandparentAnimal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..0019338c2bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.has_only_read_only import HasOnlyReadOnly + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_HasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..e654924727b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.health_check_result import HealthCheckResult + + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_HealthCheckResult(self): + """Test HealthCheckResult""" + # FIXME: construct object with mandatory attributes with example values + # model = HealthCheckResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..98b9b31821a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.inline_response_default import InlineResponseDefault + + +class TestInlineResponseDefault(unittest.TestCase): + """InlineResponseDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_InlineResponseDefault(self): + """Test InlineResponseDefault""" + # FIXME: construct object with mandatory attributes with example values + # model = InlineResponseDefault() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py new file mode 100644 index 00000000000..b94fef7543a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_enum import IntegerEnum + + +class TestIntegerEnum(unittest.TestCase): + """IntegerEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IntegerEnum(self): + """Test IntegerEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = IntegerEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py new file mode 100644 index 00000000000..61052164aee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_enum_big import IntegerEnumBig + + +class TestIntegerEnumBig(unittest.TestCase): + """IntegerEnumBig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IntegerEnumBig(self): + """Test IntegerEnumBig""" + # FIXME: construct object with mandatory attributes with example values + # model = IntegerEnumBig() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py new file mode 100644 index 00000000000..9c94769ef70 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue + + +class TestIntegerEnumOneValue(unittest.TestCase): + """IntegerEnumOneValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IntegerEnumOneValue(self): + """Test IntegerEnumOneValue""" + # FIXME: construct object with mandatory attributes with example values + # model = IntegerEnumOneValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py new file mode 100644 index 00000000000..bcdd005b2fb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue + + +class TestIntegerEnumWithDefaultValue(unittest.TestCase): + """IntegerEnumWithDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IntegerEnumWithDefaultValue(self): + """Test IntegerEnumWithDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = IntegerEnumWithDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py new file mode 100644 index 00000000000..9a982a0cb28 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_max10 import IntegerMax10 + + +class TestIntegerMax10(unittest.TestCase): + """IntegerMax10 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IntegerMax10(self): + """Test IntegerMax10""" + # FIXME: construct object with mandatory attributes with example values + # model = IntegerMax10() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py new file mode 100644 index 00000000000..b54a5c3e1a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_min15 import IntegerMin15 + + +class TestIntegerMin15(unittest.TestCase): + """IntegerMin15 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IntegerMin15(self): + """Test IntegerMin15""" + # FIXME: construct object with mandatory attributes with example values + # model = IntegerMin15() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..00a236f5544 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.isosceles_triangle import IsoscelesTriangle + + +class TestIsoscelesTriangle(unittest.TestCase): + """IsoscelesTriangle unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IsoscelesTriangle(self): + """Test IsoscelesTriangle""" + # FIXME: construct object with mandatory attributes with example values + # model = IsoscelesTriangle() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py new file mode 100644 index 00000000000..ec2e16403f7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.isosceles_triangle_all_of import IsoscelesTriangleAllOf + + +class TestIsoscelesTriangleAllOf(unittest.TestCase): + """IsoscelesTriangleAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_IsoscelesTriangleAllOf(self): + """Test IsoscelesTriangleAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = IsoscelesTriangleAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py new file mode 100644 index 00000000000..361f043de97 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.mammal import Mammal + + +class TestMammal(unittest.TestCase): + """Mammal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Mammal(self): + """Test Mammal""" + # FIXME: construct object with mandatory attributes with example values + # model = Mammal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.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 new file mode 100644 index 00000000000..7239da64e29 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.map_test import MapTest + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_MapTest(self): + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = MapTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..8291a671896 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_MixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..11caf2a0c0b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.model200_response import Model200Response + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Model200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..61841ab2acb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.model_return import ModelReturn + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py new file mode 100644 index 00000000000..67b92d6ef0d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.name import Name + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Name(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py new file mode 100644 index 00000000000..a7665403245 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.no_additional_properties import NoAdditionalProperties + + +class TestNoAdditionalProperties(unittest.TestCase): + """NoAdditionalProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_NoAdditionalProperties(self): + """Test NoAdditionalProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = NoAdditionalProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..8eeb087512f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.nullable_class import NullableClass + + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_NullableClass(self): + """Test NullableClass""" + # FIXME: construct object with mandatory attributes with example values + # model = NullableClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..7126a23ed42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.nullable_shape import NullableShape + + +class TestNullableShape(unittest.TestCase): + """NullableShape unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_NullableShape(self): + """Test NullableShape""" + # FIXME: construct object with mandatory attributes with example values + # model = NullableShape() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py new file mode 100644 index 00000000000..fac8c8653bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.nullable_string import NullableString + + +class TestNullableString(unittest.TestCase): + """NullableString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_NullableString(self): + """Test NullableString""" + # FIXME: construct object with mandatory attributes with example values + # model = NullableString() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number.py b/samples/openapi3/client/petstore/python-experimental/test/test_number.py new file mode 100644 index 00000000000..9dff8542047 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.number import Number + + +class TestNumber(unittest.TestCase): + """Number unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Number(self): + """Test Number""" + # FIXME: construct object with mandatory attributes with example values + # model = Number() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..a1572ab7f9e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.number_only import NumberOnly + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_NumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py new file mode 100644 index 00000000000..919d7c0d5a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.number_with_validations import NumberWithValidations + + +class TestNumberWithValidations(unittest.TestCase): + """NumberWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_NumberWithValidations(self): + """Test NumberWithValidations""" + # FIXME: construct object with mandatory attributes with example values + # model = NumberWithValidations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py new file mode 100644 index 00000000000..42994360b37 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.object_interface import ObjectInterface + + +class TestObjectInterface(unittest.TestCase): + """ObjectInterface unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectInterface(self): + """Test ObjectInterface""" + # FIXME: construct object with mandatory attributes with example values + # model = ObjectInterface() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py new file mode 100644 index 00000000000..6c8aaa4c9cf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectModelWithRefProps(self): + """Test ObjectModelWithRefProps""" + # FIXME: construct object with mandatory attributes with example values + # model = ObjectModelWithRefProps() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py new file mode 100644 index 00000000000..6bd3ec317cd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py @@ -0,0 +1,55 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps + + +class TestObjectWithDifficultlyNamedProps(unittest.TestCase): + """ObjectWithDifficultlyNamedProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectWithDifficultlyNamedProps(self): + """Test ObjectWithDifficultlyNamedProps""" + kwargs = { + '$special[property.name]': 1, + '123-list': '', + '123Number': 2, + } + model = ObjectWithDifficultlyNamedProps(**kwargs) + self.assertEqual(model['$special[property.name]'], 1) + self.assertEqual(model['123-list'], '') + self.assertEqual(model['123Number'], 2) + self.assertEqual(model, kwargs) + + # without the required argument, an exception is raised + optional_kwargs = { + '$special[property.name]': 1, + '123Number': 2, + } + with self.assertRaisesRegex( + petstore_api.ApiTypeError, + r"ObjectWithDifficultlyNamedProps is missing 1 required argument: ['123-list']" + ): + ObjectWithDifficultlyNamedProps(**optional_kwargs) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py new file mode 100644 index 00000000000..cfe0400fcee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.object_with_validations import ObjectWithValidations + + +class TestObjectWithValidations(unittest.TestCase): + """ObjectWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectWithValidations(self): + """Test ObjectWithValidations""" + # FIXME: construct object with mandatory attributes with example values + # model = ObjectWithValidations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py new file mode 100644 index 00000000000..9463845b34a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.order import Order + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Order(self): + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = Order() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..d1507e114f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.parent_pet import ParentPet + + +class TestParentPet(unittest.TestCase): + """ParentPet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ParentPet(self): + """Test ParentPet""" + # FIXME: construct object with mandatory attributes with example values + # model = ParentPet() # noqa: E501 + pass + + +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 new file mode 100644 index 00000000000..dc34ae0012b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.pet import Pet + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Pet(self): + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = Pet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..d545f497297 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -0,0 +1,93 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + 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/openapi3/client/petstore/python-experimental/test/test_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py new file mode 100644 index 00000000000..8c092a8465b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.pig import Pig + + +class TestPig(unittest.TestCase): + """Pig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Pig(self): + """Test Pig""" + # FIXME: construct object with mandatory attributes with example values + # model = Pig() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_player.py b/samples/openapi3/client/petstore/python-experimental/test/test_player.py new file mode 100644 index 00000000000..ba15e0f576a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_player.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.player import Player + + +class TestPlayer(unittest.TestCase): + """Player unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Player(self): + """Test Player""" + # FIXME: construct object with mandatory attributes with example values + # model = Player() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py new file mode 100644 index 00000000000..cc0c203d2ea --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.quadrilateral import Quadrilateral + + +class TestQuadrilateral(unittest.TestCase): + """Quadrilateral unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Quadrilateral(self): + """Test Quadrilateral""" + # FIXME: construct object with mandatory attributes with example values + # model = Quadrilateral() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.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 new file mode 100644 index 00000000000..cec68e36cf5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + + +class TestQuadrilateralInterface(unittest.TestCase): + """QuadrilateralInterface unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_QuadrilateralInterface(self): + """Test QuadrilateralInterface""" + # FIXME: construct object with mandatory attributes with example values + # model = QuadrilateralInterface() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..d447437eb16 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.read_only_first import ReadOnlyFirst + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..8df06216926 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.scalene_triangle import ScaleneTriangle + + +class TestScaleneTriangle(unittest.TestCase): + """ScaleneTriangle unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ScaleneTriangle(self): + """Test ScaleneTriangle""" + # FIXME: construct object with mandatory attributes with example values + # model = ScaleneTriangle() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py new file mode 100644 index 00000000000..f81248b1517 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.scalene_triangle_all_of import ScaleneTriangleAllOf + + +class TestScaleneTriangleAllOf(unittest.TestCase): + """ScaleneTriangleAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ScaleneTriangleAllOf(self): + """Test ScaleneTriangleAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ScaleneTriangleAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py new file mode 100644 index 00000000000..f34053a9bcb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.shape import Shape + + +class TestShape(unittest.TestCase): + """Shape unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Shape(self): + """Test Shape""" + # FIXME: construct object with mandatory attributes with example values + # model = Shape() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..ee182f6298c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.shape_or_null import ShapeOrNull + + +class TestShapeOrNull(unittest.TestCase): + """ShapeOrNull unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ShapeOrNull(self): + """Test ShapeOrNull""" + # FIXME: construct object with mandatory attributes with example values + # model = ShapeOrNull() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..8a6ce429abf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral + + +class TestSimpleQuadrilateral(unittest.TestCase): + """SimpleQuadrilateral unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_SimpleQuadrilateral(self): + """Test SimpleQuadrilateral""" + # FIXME: construct object with mandatory attributes with example values + # model = SimpleQuadrilateral() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py new file mode 100644 index 00000000000..ad9d92251b4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.simple_quadrilateral_all_of import SimpleQuadrilateralAllOf + + +class TestSimpleQuadrilateralAllOf(unittest.TestCase): + """SimpleQuadrilateralAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_SimpleQuadrilateralAllOf(self): + """Test SimpleQuadrilateralAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = SimpleQuadrilateralAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py new file mode 100644 index 00000000000..f3b94113824 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.some_object import SomeObject + + +class TestSomeObject(unittest.TestCase): + """SomeObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_SomeObject(self): + """Test SomeObject""" + # FIXME: construct object with mandatory attributes with example values + # model = SomeObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..b74b45db122 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.special_model_name import SpecialModelName + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_SpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..3680a34b42a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -0,0 +1,58 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string.py b/samples/openapi3/client/petstore/python-experimental/test/test_string.py new file mode 100644 index 00000000000..1c62f3606b8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.string import String + + +class TestString(unittest.TestCase): + """String unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_String(self): + """Test String""" + # FIXME: construct object with mandatory attributes with example values + # model = String() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..bf39e456cf0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.string_boolean_map import StringBooleanMap + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_StringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py new file mode 100644 index 00000000000..c63cb8cba8f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.string_enum import StringEnum + + +class TestStringEnum(unittest.TestCase): + """StringEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_StringEnum(self): + """Test StringEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = StringEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py new file mode 100644 index 00000000000..87073fe5be2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue + + +class TestStringEnumWithDefaultValue(unittest.TestCase): + """StringEnumWithDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_StringEnumWithDefaultValue(self): + """Test StringEnumWithDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = StringEnumWithDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py new file mode 100644 index 00000000000..33876844024 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.string_with_validation import StringWithValidation + + +class TestStringWithValidation(unittest.TestCase): + """StringWithValidation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_StringWithValidation(self): + """Test StringWithValidation""" + # FIXME: construct object with mandatory attributes with example values + # model = StringWithValidation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py new file mode 100644 index 00000000000..a0325e55679 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.tag import Tag + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Tag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py new file mode 100644 index 00000000000..e7978b7d1bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.triangle import Triangle + + +class TestTriangle(unittest.TestCase): + """Triangle unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Triangle(self): + """Test Triangle""" + # FIXME: construct object with mandatory attributes with example values + # model = Triangle() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.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 new file mode 100644 index 00000000000..9e498660c0b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.triangle_interface import TriangleInterface + + +class TestTriangleInterface(unittest.TestCase): + """TriangleInterface unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_TriangleInterface(self): + """Test TriangleInterface""" + # FIXME: construct object with mandatory attributes with example values + # model = TriangleInterface() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py new file mode 100644 index 00000000000..8d6e394ecb3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.user import User + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_User(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 new file mode 100644 index 00000000000..abf57b0733d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -0,0 +1,86 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py new file mode 100644 index 00000000000..16cfebae337 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.whale import Whale + + +class TestWhale(unittest.TestCase): + """Whale unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Whale(self): + """Test Whale""" + # FIXME: construct object with mandatory attributes with example values + # model = Whale() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py new file mode 100644 index 00000000000..dc53745dea5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.zebra import Zebra + + +class TestZebra(unittest.TestCase): + """Zebra unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Zebra(self): + """Test Zebra""" + # FIXME: construct object with mandatory attributes with example values + # model = Zebra() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test_python.sh b/samples/openapi3/client/petstore/python-experimental/test_python.sh new file mode 100755 index 00000000000..9728a9b5316 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test_python.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VENVV" ]; then + python3 -m venv $VENV + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +### locally install the package, needed for pycharm problem checking +pip install -e . + +### run tests +tox || exit 1 + +### static analysis of code +#flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic1.png b/samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic1.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3a386a21026f9b15b2c303a81f5c69333e9056 GIT binary patch literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic2.png b/samples/openapi3/client/petstore/python-experimental/testfiles/1px_pic2.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3a386a21026f9b15b2c303a81f5c69333e9056 GIT binary patch literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CSbBp9sfW`_bPE>9Q7kcv6UzxWv#Ss9tmFVH&+ OlJ#`;b6Mw<&;$T@!wsPT literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py new file mode 100644 index 00000000000..e3443becb14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_animal.py @@ -0,0 +1,97 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.cat import Cat +from petstore_api.model.cat_all_of import CatAllOf +from petstore_api.model.dog import Dog +from petstore_api.model.dog_all_of import DogAllOf +from petstore_api.model.animal import Animal +from petstore_api.schemas import StrSchema, BoolSchema, frozendict + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + + regex_err = ( + r"Invalid discriminator value was passed in to Animal.className " + r"Only the values \['Cat', 'Dog'\] are allowed at \('args\[0\]', 'className'\)" + ) + with self.assertRaisesRegex(petstore_api.ApiValueError, regex_err): + Animal(className='Fox', color='red') + + animal = Animal(className='Cat', color='black') + assert isinstance(animal, Animal) + assert isinstance(animal, frozendict) + assert isinstance(animal, Cat) + assert isinstance(animal, CatAllOf) + assert set(animal.keys()) == {'className', 'color'} + assert animal.className == 'Cat' + assert animal.color == 'black' + assert animal.__class__.color is StrSchema + assert animal.__class__.className is StrSchema + + # pass in optional param + animal = Animal(className='Cat', color='black', declawed=True) + assert isinstance(animal, Animal) + assert isinstance(animal, frozendict) + assert isinstance(animal, Cat) + assert isinstance(animal, CatAllOf) + assert set(animal.keys()) == {'className', 'color', 'declawed'} + assert animal.className == 'Cat' + assert animal.color == 'black' + assert bool(animal.declawed) is True + assert animal.__class__.color is StrSchema + assert animal.__class__.className is StrSchema + assert animal.__class__.declawed is BoolSchema + + # make a Dog + animal = Animal(className='Dog', color='black') + assert isinstance(animal, Animal) + assert isinstance(animal, frozendict) + assert isinstance(animal, Dog) + assert isinstance(animal, DogAllOf) + assert set(animal.keys()) == {'className', 'color'} + assert animal.className == 'Dog' + assert animal.color == 'black' + assert animal.__class__.color is StrSchema + assert animal.__class__.className is StrSchema + + # pass in optional param + animal = Animal(className='Dog', color='black', breed='Labrador') + assert isinstance(animal, Animal) + assert isinstance(animal, frozendict) + assert isinstance(animal, Dog) + assert isinstance(animal, DogAllOf) + assert set(animal.keys()) == {'className', 'color', 'breed'} + assert animal.className == 'Dog' + assert animal.color == 'black' + assert animal.breed == 'Labrador' + assert animal.__class__.color is StrSchema + assert animal.__class__.className is StrSchema + assert animal.__class__.breed is StrSchema + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py new file mode 100644 index 00000000000..e10f99b44bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py @@ -0,0 +1,273 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.schemas import ( + AnyTypeSchema, + DictSchema, + ListSchema, + StrSchema, + NumberSchema, + IntSchema, + BoolSchema, + NoneSchema, + DateSchema, + DateTimeSchema, + ComposedSchema, + frozendict, + Decimal, + NoneClass, + BoolClass +) + + +class TestAnyTypeSchema(unittest.TestCase): + + def testDictSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + DictSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model(a=1, b='hi') + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, DictSchema) + assert isinstance(m, frozendict) + assert m == frozendict(a=Decimal(1), b='hi') + + def testListSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + ListSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model([1, 'hi']) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, ListSchema) + assert isinstance(m, tuple) + assert m == tuple([Decimal(1), 'hi']) + + def testStrSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + StrSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model('hi') + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, StrSchema) + assert isinstance(m, str) + assert m == 'hi' + + def testNumberSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + NumberSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model(1) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, NumberSchema) + assert isinstance(m, Decimal) + assert m == Decimal(1) + + m = Model(3.14) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, NumberSchema) + assert isinstance(m, Decimal) + assert m == Decimal(3.14) + + def testIntSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + IntSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model(1) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, IntSchema) + assert isinstance(m, Decimal) + assert m == Decimal(1) + + with self.assertRaises(petstore_api.exceptions.ApiValueError): + # can't pass in float into Int + m = Model(3.14) + + def testBoolSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + BoolSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model(True) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, BoolSchema) + assert isinstance(m, BoolClass) + self.assertTrue(m) + + m = Model(False) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, BoolSchema) + assert isinstance(m, BoolClass) + self.assertFalse(m) + + def testNoneSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + NoneSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model(None) + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, NoneSchema) + assert isinstance(m, NoneClass) + self.assertTrue(m.is_none()) + + def testDateSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + DateSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model('1970-01-01') + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, DateSchema) + assert isinstance(m, str) + assert m == '1970-01-01' + + def testDateTimeSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + DateTimeSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model('2020-01-01T00:00:00') + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, DateTimeSchema) + assert isinstance(m, str) + assert m == '2020-01-01T00:00:00' + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_holding_any_type.py new file mode 100644 index 00000000000..6addb31d8fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_holding_any_type.py @@ -0,0 +1,64 @@ +# 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 +""" + + +import sys +import unittest +from datetime import date, datetime, timezone + +import petstore_api +from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType +from petstore_api.schemas import NoneClass, BoolClass + + +class TestArrayHoldingAnyType(unittest.TestCase): + """ArrayHoldingAnyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayHoldingAnyType(self): + """Test ArrayHoldingAnyType""" + + enum_values = [True, False] + for enum_value in enum_values: + inst = ArrayHoldingAnyType([enum_value]) + assert isinstance(inst, ArrayHoldingAnyType) + assert isinstance(inst, tuple) + assert isinstance(inst[0], BoolClass) + assert bool(inst[0]) is enum_value + + inst = ArrayHoldingAnyType([None]) + assert isinstance(inst, ArrayHoldingAnyType) + assert isinstance(inst, tuple) + assert isinstance(inst[0], NoneClass) + + input_to_stored_value = [ + (0, 0), + (3.14, 3.14), + (date(1970, 1, 1), '1970-01-01'), + (datetime(1970, 1, 1, 0, 0, 0), '1970-01-01T00:00:00'), + (datetime(1970, 1, 1, 0, 0, 0, tzinfo=timezone.utc), '1970-01-01T00:00:00+00:00'), + ([], ()), + ({}, {}), + ('hi', 'hi'), + ] + for input, stored_value in input_to_stored_value: + inst = ArrayHoldingAnyType([input]) + assert isinstance(inst, ArrayHoldingAnyType) + assert isinstance(inst, tuple) + assert inst[0] == stored_value + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_with_validations_in_items.py new file mode 100644 index 00000000000..1d3eccb68ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_array_with_validations_in_items.py @@ -0,0 +1,52 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems + + +class TestArrayWithValidationsInItems(unittest.TestCase): + """ArrayWithValidationsInItems unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayWithValidationsInItems(self): + """Test ArrayWithValidationsInItems""" + + valid_values = [-1, 5, 7] + for valid_value in valid_values: + inst = ArrayWithValidationsInItems([valid_value]) + assert isinstance(inst, ArrayWithValidationsInItems) + assert inst == (valid_value,) + + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `8`, must be a value less than or equal to `7` at \('args\[0\]', 0\)" + ): + ArrayWithValidationsInItems([8]) + + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `\(Decimal\('1'\), Decimal\('2'\), Decimal\('3'\)\)`, number of items must be less than or equal to `2` at \('args\[0\]',\)" + ): + ArrayWithValidationsInItems([1, 2, 3]) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py new file mode 100644 index 00000000000..b2080043ce2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_boolean_enum.py @@ -0,0 +1,39 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.boolean_enum import BooleanEnum + + +class TestBooleanEnum(unittest.TestCase): + """BooleanEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_BooleanEnum(self): + """Test BooleanEnum""" + # FIXME: construct object with mandatory attributes with example values + model = BooleanEnum(True) + model is BooleanEnum.TRUE + with self.assertRaises(petstore_api.ApiValueError): + BooleanEnum(False) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_object_schemas.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_object_schemas.py new file mode 100644 index 00000000000..cdbd7b1747c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_object_schemas.py @@ -0,0 +1,152 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.schemas import AnyTypeSchema, DictSchema, IntSchema, StrSchema, Float32Schema, DateSchema +from petstore_api.model.danish_pig import DanishPig +from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.no_additional_properties import NoAdditionalProperties +from petstore_api.model.address import Address +from petstore_api.model.apple_req import AppleReq +from petstore_api.model.banana_req import BananaReq +from petstore_api.model.player import Player + +class TestCombineObjectSchemas(unittest.TestCase): + pass +# def test_invalid_combo_additional_properties_missing(self): +# regex_err = ( +# r"Cannot combine additionalProperties schemas from.+?DanishPig.+?and.+?NoAdditionalProperties.+?" +# r"in.+?Combo.+?because additionalProperties does not exist in both schemas" +# ) +# with self.assertRaisesRegex(petstore_api.ApiTypeError, regex_err): +# class Combo(DanishPig, NoAdditionalProperties): +# pass +# +# def test_invalid_combo_both_no_addprops(self): +# regex_err = ( +# r"Cannot combine schemas from.+?AppleReq.+?and.+?BananaReq.+?" +# r"in.+?Combo.+?because cultivar is missing from.+?BananaReq.+?" +# ) +# with self.assertRaisesRegex(petstore_api.ApiTypeError, regex_err): +# class Combo(AppleReq, BananaReq): +# pass +# +# def test_valid_no_addprops(self): +# class FirstSchema(DictSchema): +# +# +# class a(IntSchema): +# _validations = { +# 'inclusive_maximum': 20, +# } +# +# b = Float32Schema +# +# _additional_properties = None +# +# class SecondSchema(DictSchema): +# +# +# class a(IntSchema): +# _validations = { +# 'inclusive_minimum': 10, +# } +# +# b = Float32Schema +# +# _additional_properties = None +# +# class Combo(FirstSchema, SecondSchema): +# pass +# +# assert Combo._additional_properties is None +# self.assertEqual(Combo._property_names, ('a', 'b')) +# assert Combo.a._validations == { +# 'inclusive_maximum': 20, +# 'inclusive_minimum': 10, +# } +# assert Combo.b is Float32Schema +# +# +# def test_valid_combo_additional_properties_anytype_prim(self): +# class TwoPropsAndIntegerAddProp(DictSchema): +# a = StrSchema +# b = Float32Schema +# _additional_properties = IntSchema +# +# class OnePropAndAnyTypeAddProps(DictSchema): +# c = IntSchema +# _additional_properties = AnyTypeSchema +# +# class Combo(TwoPropsAndIntegerAddProp, OnePropAndAnyTypeAddProps): +# pass +# +# assert Combo._additional_properties is TwoPropsAndIntegerAddProp._additional_properties +# self.assertEqual(Combo._property_names, ('a', 'b', 'c')) +# assert Combo.a is TwoPropsAndIntegerAddProp.a +# assert Combo.b is TwoPropsAndIntegerAddProp.b +# assert Combo.c is OnePropAndAnyTypeAddProps.c +# +# def test_invalid_type_disagreement(self): +# class StrSchemaA(DictSchema): +# a = StrSchema +# _additional_properties = AnyTypeSchema +# +# class FloatSchemaA(DictSchema): +# a = Float32Schema +# _additional_properties = AnyTypeSchema +# +# regex_err = ( +# r"Cannot combine schemas.+?StrSchema.+?and.+?Float32Schema.+?" +# r"in.+?a.+?because their types do not intersect" +# ) +# with self.assertRaisesRegex(petstore_api.ApiTypeError, regex_err): +# class Combo(StrSchemaA, FloatSchemaA): +# pass +# +# def test_valid_combo_including_self_reference(self): +# +# class EnemyPlayerAndA(DictSchema): +# a = DateSchema +# +# class enemyPlayer(DictSchema): +# heightCm = IntSchema +# _additional_properties = AnyTypeSchema +# +# _additional_properties = AnyTypeSchema +# +# class Combo(Player, EnemyPlayerAndA): +# # we have a self reference where Player.enemyPlayer = Player +# pass +# +# """ +# For Combo +# name is from Player +# enemyPlayer is from Player + EnemyPlayerAndA +# a is from EnemyPlayerAndA +# """ +# self.assertEqual(Combo._property_names, ('a', 'enemyPlayer', 'name')) +# self.assertEqual(Combo.enemyPlayer.__bases__, (EnemyPlayerAndA.enemyPlayer, Player)) +# """ +# For Combo.enemyPlayer +# heightCm is from EnemyPlayerAndA.enemyPlayer +# name is from Player.enemyPlayer +# enemyPlayer is from Player.enemyPlayer +# """ +# self.assertEqual(Combo.enemyPlayer._property_names, ('enemyPlayer', 'heightCm', 'name')) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_schemas.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_schemas.py new file mode 100644 index 00000000000..c6d353f66c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_combine_schemas.py @@ -0,0 +1,104 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.date_with_validations import DateWithValidations +from petstore_api.model.date_time_with_validations import DateTimeWithValidations +from petstore_api.model.string_with_validation import StringWithValidation +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue +from petstore_api.model.integer_enum import IntegerEnum +from petstore_api.model.integer_enum_big import IntegerEnumBig +from petstore_api.model.integer_max10 import IntegerMax10 +from petstore_api.model.integer_min15 import IntegerMin15 +from petstore_api.model.nullable_string import NullableString +from petstore_api.schemas import AnyTypeSchema, Schema, NoneSchema, StrSchema, none_type, Singleton + + +class TestCombineNonObjectSchemas(unittest.TestCase): + + def test_valid_enum_plus_prim(self): + class EnumPlusPrim(IntegerMax10, IntegerEnumOneValue): + pass + + assert EnumPlusPrim._enum_value_to_name == {0: "POSITIVE_0"} + + # order of base classes does not matter + class EnumPlusPrim(IntegerEnumOneValue, IntegerMax10): + pass + + assert EnumPlusPrim._enum_value_to_name == {0: "POSITIVE_0"} + + # _enum_value_to_name only contains one key + assert set(EnumPlusPrim._enum_value_to_name) == {0} + # the value is the expected enum class + enum_value_cls = EnumPlusPrim._enum_by_value[0] + assert issubclass(enum_value_cls, EnumPlusPrim) + assert issubclass(enum_value_cls, Singleton) + assert issubclass(enum_value_cls, int) + # the enum stored in that class is expected + enum_value = enum_value_cls.POSITIVE_0 + assert isinstance(enum_value, EnumPlusPrim) + assert isinstance(enum_value, Singleton) + assert isinstance(enum_value, int) + # we can access this enum from our class + assert EnumPlusPrim.POSITIVE_0 == enum_value + + # invalid value throws an exception + with self.assertRaises(petstore_api.ApiValueError): + EnumPlusPrim(9) + + # valid value succeeds + val = EnumPlusPrim(0) + assert val == 0 + assert isinstance(val, EnumPlusPrim) + assert isinstance(val, Singleton) + assert isinstance(val, int) + + def test_valid_enum_plus_enum(self): + class IntegerOneEnum(IntegerEnum, IntegerEnumOneValue): + pass + + assert IntegerOneEnum._enum_value_to_name == {0: "POSITIVE_0"} + + # order of base classes does not matter + class IntegerOneEnum(IntegerEnumOneValue, IntegerEnum): + pass + + assert IntegerOneEnum._enum_value_to_name == {0: "POSITIVE_0"} + + # _enum_by_value only contains one key + assert set(IntegerOneEnum._enum_by_value) == {0} + # the value is the expected enum class + enum_value_cls = IntegerOneEnum._enum_by_value[0] + assert issubclass(enum_value_cls, IntegerOneEnum) + assert issubclass(enum_value_cls, Singleton) + assert issubclass(enum_value_cls, int) + # the enum stored in that class is expected + enum_value = enum_value_cls.POSITIVE_0 + assert isinstance(enum_value, IntegerOneEnum) + assert isinstance(enum_value, Singleton) + assert isinstance(enum_value, int) + # we can access this enum from our class + assert IntegerOneEnum.POSITIVE_0 == enum_value + + # accessing invalid enum throws an exception + invalid_enums = ['POSITIVE_1', 'POSITIVE_2'] + for invalid_enum in invalid_enums: + with self.assertRaises(KeyError): + getattr(IntegerOneEnum, invalid_enum) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_bool.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_bool.py new file mode 100644 index 00000000000..7f0b29ee909 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_bool.py @@ -0,0 +1,42 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_bool import ComposedBool + + +class TestComposedBool(unittest.TestCase): + """ComposedBool unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedBool(self): + """Test ComposedBool""" + valid_values = [True, False] + all_values = [None, True, False, 2, 3.14, '', {}, []] + for value in all_values: + if value not in valid_values: + with self.assertRaises(petstore_api.ApiTypeError): + model = ComposedBool(value) + continue + model = ComposedBool(value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_none.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_none.py new file mode 100644 index 00000000000..a37eb26b104 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_none.py @@ -0,0 +1,42 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_none import ComposedNone + + +class TestComposedNone(unittest.TestCase): + """ComposedNone unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedNone(self): + """Test ComposedNone""" + valid_values = [None] + all_values = [None, True, False, 2, 3.14, '', {}, []] + for value in all_values: + if value not in valid_values: + with self.assertRaises(petstore_api.ApiTypeError): + model = ComposedNone(value) + continue + model = ComposedNone(value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_number.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_number.py new file mode 100644 index 00000000000..1cd982e3f33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_number.py @@ -0,0 +1,42 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_number import ComposedNumber + + +class TestComposedNumber(unittest.TestCase): + """ComposedNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedNumber(self): + """Test ComposedNumber""" + valid_values = [2, 3.14] + all_values = [None, True, False, 2, 3.14, '', {}, []] + for value in all_values: + if value not in valid_values: + with self.assertRaises(petstore_api.ApiTypeError): + model = ComposedNumber(value) + continue + model = ComposedNumber(value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_object.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_object.py new file mode 100644 index 00000000000..7c79c574d9b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_object.py @@ -0,0 +1,42 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_object import ComposedObject + + +class TestComposedObject(unittest.TestCase): + """ComposedObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedObject(self): + """Test ComposedObject""" + valid_values = [{}] + all_values = [None, True, False, 2, 3.14, '', {}, []] + for value in all_values: + if value not in valid_values: + with self.assertRaises(petstore_api.ApiTypeError): + model = ComposedObject(value) + continue + model = ComposedObject(value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py new file mode 100644 index 00000000000..f08dd500b1d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_one_of_different_types.py @@ -0,0 +1,107 @@ +# 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 +""" + + +import sys +import unittest +from datetime import date, datetime, timezone +from dateutil.tz import tzutc + +import petstore_api +from petstore_api.schemas import DateSchema, DateTimeSchema, Singleton, NoneClass, frozendict +from petstore_api.model.animal import Animal +from petstore_api.model.cat import Cat +from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes +from petstore_api.model.number_with_validations import NumberWithValidations + +class TestComposedOneOfDifferentTypes(unittest.TestCase): + """ComposedOneOfDifferentTypes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedOneOfDifferentTypes(self): + """Test ComposedOneOfDifferentTypes""" + # we can make an instance that stores float data + inst = ComposedOneOfDifferentTypes(10.0) + assert isinstance(inst, NumberWithValidations) + + # we can make an instance that stores object (dict) data + inst = ComposedOneOfDifferentTypes(className="Cat", color="black") + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert isinstance(inst, Animal) + assert isinstance(inst, Cat) + assert isinstance(inst, frozendict) + + # object that holds 4 properties and is not an Animal + inst = ComposedOneOfDifferentTypes(a="a", b="b", c="c", d="d") + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert not isinstance(inst, Animal) + assert isinstance(inst, frozendict) + + # None + inst = ComposedOneOfDifferentTypes(None) + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert isinstance(inst, Singleton) + assert isinstance(inst, NoneClass) + assert inst.is_none() is True + + # date + inst = ComposedOneOfDifferentTypes._from_openapi_data('2019-01-10') + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert isinstance(inst, DateSchema) + assert isinstance(inst, str) + assert inst.as_date.year == 2019 + assert inst.as_date.month == 1 + assert inst.as_date.day == 10 + + # date + inst = ComposedOneOfDifferentTypes(date(2019, 1, 10)) + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert isinstance(inst, DateSchema) + assert isinstance(inst, str) + assert inst.as_date.year == 2019 + assert inst.as_date.month == 1 + assert inst.as_date.day == 10 + + # date-time + inst = ComposedOneOfDifferentTypes._from_openapi_data('2020-01-02T03:04:05Z') + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert isinstance(inst, DateTimeSchema) + assert isinstance(inst, str) + assert inst.as_datetime.year == 2020 + assert inst.as_datetime.month == 1 + assert inst.as_datetime.day == 2 + assert inst.as_datetime.hour == 3 + assert inst.as_datetime.minute == 4 + assert inst.as_datetime.second == 5 + utc_tz = tzutc() + assert inst.as_datetime.tzinfo == utc_tz + + # date-time + inst = ComposedOneOfDifferentTypes(datetime(2020, 1, 2, 3, 4, 5, tzinfo=timezone.utc)) + assert isinstance(inst, ComposedOneOfDifferentTypes) + assert isinstance(inst, DateTimeSchema) + assert isinstance(inst, str) + assert inst.as_datetime.year == 2020 + assert inst.as_datetime.month == 1 + assert inst.as_datetime.day == 2 + assert inst.as_datetime.hour == 3 + assert inst.as_datetime.minute == 4 + assert inst.as_datetime.second == 5 + assert inst.as_datetime.tzinfo == utc_tz + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_string.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_string.py new file mode 100644 index 00000000000..aeb5ea3a972 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_composed_string.py @@ -0,0 +1,42 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.composed_string import ComposedString + + +class TestComposedString(unittest.TestCase): + """ComposedString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ComposedString(self): + """Test ComposedString""" + valid_values = [''] + all_values = [None, True, False, 2, 3.14, '', {}, []] + for value in all_values: + if value not in valid_values: + with self.assertRaises(petstore_api.ApiTypeError): + model = ComposedString(value) + continue + model = ComposedString(value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py new file mode 100644 index 00000000000..9218e4fc255 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_configuration.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIetstore-python +$ nosetests -v +""" + +import unittest + +from unittest.mock import patch +import urllib3 +from urllib3._collections import HTTPHeaderDict + +import petstore_api +from petstore_api.api_client import ApiClient +from petstore_api.api import pet_api + + +class ConfigurationTests(unittest.TestCase): + + def test_configuration(self): + config = petstore_api.Configuration() + config.host = 'http://localhost/' + + config.disabled_client_side_validations = ("multipleOf,maximum,exclusiveMaximum,minimum,exclusiveMinimum," + "maxLength,minLength,pattern,maxItems,minItems") + with self.assertRaisesRegex(ValueError, "Invalid keyword: 'foo'"): + config.disabled_client_side_validations = 'foo' + config.disabled_client_side_validations = "" + + def test_servers(self): + config = petstore_api.Configuration(server_index=1, server_variables={'version': 'v1'}) + client = pet_api.ApiClient(configuration=config) + api = pet_api.PetApi(client) + + with patch.object(ApiClient, 'request') as mock_request: + mock_request.return_value = urllib3.HTTPResponse(status=200) + api.add_pet({'name': 'pet', 'photoUrls': []}) + mock_request.assert_called_with( + 'POST', + 'http://path-server-test.petstore.local/v2/pet', + query_params=None, + headers=HTTPHeaderDict({ + 'Content-Type': 'application/json', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python' + }), + fields=None, + body=b'{"name":"pet","photoUrls":[]}', + stream=False, + timeout=None, + ) + + with patch.object(ApiClient, 'request') as mock_request: + mock_request.return_value = urllib3.HTTPResponse(status=200) + api.delete_pet(path_params=dict(petId=123456789)) + mock_request.assert_called_with( + 'DELETE', + 'https://localhost:8080/v1/pet/123456789', + query_params=None, + headers={'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + fields=None, + body=None, + stream=False, + timeout=None, + ) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_time_with_validations.py new file mode 100644 index 00000000000..3d26e42bc1d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_time_with_validations.py @@ -0,0 +1,87 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.model.date_time_with_validations import DateTimeWithValidations +from datetime import date, datetime, timezone + + +class TestDateTimeWithValidations(unittest.TestCase): + """DateTimeWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDateTimeWithValidations(self): + """Test DateTimeWithValidations""" + + # works with datetime input + valid_values = [datetime(2020, 1, 1), '2020-01-01T00:00:00'] + expected_datetime = '2020-01-01T00:00:00' + for valid_value in valid_values: + inst = DateTimeWithValidations(valid_value) + assert inst == expected_datetime + + # when passing data in with _from_openapi_data one must use str + with self.assertRaisesRegex( + petstore_api.ApiTypeError, + r"Invalid type. Required value type is str and passed type was datetime at \['args\[0\]'\]" + ): + DateTimeWithValidations._from_openapi_data(datetime(2020, 1, 1)) + + # when passing data _from_openapi_data we can use str + input_value_to_datetime = { + "2020-01-01T00:00:00": datetime(2020, 1, 1, tzinfo=None), + "2020-01-01T00:00:00Z": datetime(2020, 1, 1, tzinfo=timezone.utc), + "2020-01-01T00:00:00+00:00": datetime(2020, 1, 1, tzinfo=timezone.utc) + } + for input_value, expected_datetime in input_value_to_datetime.items(): + inst = DateTimeWithValidations._from_openapi_data(input_value) + assert inst.as_datetime == expected_datetime + + # value error is raised if an invalid string is passed in + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Value does not conform to the required ISO-8601 datetime format. Invalid value 'abcd' for type datetime at \('args\[0\]',\)" + ): + DateTimeWithValidations._from_openapi_data("abcd") + + # value error is raised if a date is passed in + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Value does not conform to the required ISO-8601 datetime format. Invalid value '2020-01-01' for type datetime at \('args\[0\]',\)" + ): + DateTimeWithValidations(date(2020, 1, 1)) + + # pattern checking with string input + error_regex = r"Invalid value `2019-01-01T00:00:00Z`, must match regular expression `.+?` at \('args\[0\]',\)" + with self.assertRaisesRegex( + petstore_api.ApiValueError, + error_regex + ): + DateTimeWithValidations._from_openapi_data("2019-01-01T00:00:00Z") + # pattern checking with date input + error_regex = r"Invalid value `2019-01-01T00:00:00`, must match regular expression `.+?` at \('args\[0\]',\)" + with self.assertRaisesRegex( + petstore_api.ApiValueError, + error_regex + ): + DateTimeWithValidations(datetime(2019, 1, 1)) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_with_validations.py new file mode 100644 index 00000000000..fff79f16cfc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_date_with_validations.py @@ -0,0 +1,90 @@ +# 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 +""" + + +import unittest + +import petstore_api +from petstore_api.model.date_with_validations import DateWithValidations +from datetime import date, datetime + + +class TestDateWithValidations(unittest.TestCase): + """DateWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDateWithValidations(self): + """Test DateWithValidations""" + + # client side date inputs + valid_values = [date(2020, 1, 1), '2020-01-01'] + expected_date = '2020-01-01' + for valid_value in valid_values: + inst = DateWithValidations(valid_value) + assert inst == expected_date + + # when passing data in with _from_openapi_data one must use str + with self.assertRaisesRegex( + petstore_api.ApiTypeError, + r"Invalid type. Required value type is str and passed type was date at \['args\[0\]'\]" + ): + DateWithValidations._from_openapi_data(date(2020, 1, 1)) + + # when passing data in from the server we can use str + valid_values = ["2020-01-01", "2020-01", "2020"] + expected_date = date(2020, 1, 1) + for valid_value in valid_values: + inst = DateWithValidations._from_openapi_data(valid_value) + assert inst.as_date == expected_date + + # value error is raised if an invalid string is passed in + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Value does not conform to the required ISO-8601 date format. Invalid value '2020-01-01T00:00:00Z' for type date at \('args\[0\]',\)" + ): + DateWithValidations._from_openapi_data("2020-01-01T00:00:00Z") + + # value error is raised if a datetime is passed in + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Value does not conform to the required ISO-8601 date format. Invalid value '2020-01-01T00:00:00' for type date at \('args\[0\]',\)" + ): + DateWithValidations(datetime(2020, 1, 1)) + + # value error is raised if an invalid string is passed in + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Value does not conform to the required ISO-8601 date format. Invalid value 'abcd' for type date at \('args\[0\]',\)" + ): + DateWithValidations._from_openapi_data("abcd") + + # pattern checking for str input + error_regex = r"Invalid value `2019-01-01`, must match regular expression `.+?` at \('args\[0\]',\)" + with self.assertRaisesRegex( + petstore_api.ApiValueError, + error_regex + ): + DateWithValidations._from_openapi_data("2019-01-01") + # pattern checking for date input + with self.assertRaisesRegex( + petstore_api.ApiValueError, + error_regex + ): + DateWithValidations(date(2019, 1, 1)) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py new file mode 100644 index 00000000000..f3a389d67e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_deserialization.py @@ -0,0 +1,458 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIPetstore-python +$ nosetests -v +""" +from collections import namedtuple +from decimal import Decimal +import json +import typing +import unittest + +import urllib3 + +import petstore_api +from petstore_api import api_client +from petstore_api.schemas import NoneClass + + +MockResponse = namedtuple('MockResponse', 'data') + + +class DeserializationTests(unittest.TestCase): + json_content_type = 'application/json' + json_content_type_headers = {'content-type': json_content_type} + configuration = petstore_api.Configuration() + + @classmethod + def __response(cls, data: typing.Any) -> urllib3.HTTPResponse: + return urllib3.HTTPResponse( + json.dumps(data).encode('utf-8'), + headers=cls.json_content_type_headers + ) + + def test_deserialize_shape(self): + """ + + deserialize Shape to an instance of: + - EquilateralTriangle + - IsoscelesTriangle + - IsoscelesTriangle + - ScaleneTriangle + - ComplexQuadrilateral + - SimpleQuadrilateral + by traveling through 2 discriminators + """ + from petstore_api.model import shape, equilateral_triangle + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=shape.Shape), + }, + ) + data = { + 'shapeType': 'Triangle', + 'triangleType': 'EquilateralTriangle', + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, equilateral_triangle.EquilateralTriangle)) + self.assertEqual(body.shapeType, 'Triangle') + self.assertEqual(body.triangleType, 'EquilateralTriangle') + + # invalid quadrilateralType, second discriminator value + data = { + 'shapeType': 'Quadrilateral', + 'quadrilateralType': 'Triangle', + } + response = self.__response(data) + + err_msg = ( + r"Invalid discriminator value was passed in to Quadrilateral.quadrilateralType Only the values " + r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" + ) + with self.assertRaisesRegex(petstore_api.ApiValueError, err_msg): + _response_for_200.deserialize(response, self.configuration) + + def test_deserialize_animal(self): + """ + deserialize Animal to a Dog instance + Animal uses a discriminator which has a map built of child classes + that inherrit from Animal + This is the swagger (v2) way of doing something like oneOf composition + """ + from petstore_api.model import animal, dog + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=animal.Animal), + }, + ) + data = { + 'className': 'Dog', + 'color': 'white', + 'breed': 'Jack Russel Terrier' + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, dog.Dog)) + self.assertEqual(body.className, 'Dog') + self.assertEqual(body.color, 'white') + self.assertEqual(body.breed, 'Jack Russel Terrier') + + def test_regex_constraint(self): + """ + Test regex pattern validation. + """ + from petstore_api.model import apple + + # Test with valid regex pattern. + inst = apple.Apple( + cultivar="Akane" + ) + assert isinstance(inst, apple.Apple) + + inst = apple.Apple( + cultivar="Golden Delicious", + origin="cHiLe" + ) + assert isinstance(inst, apple.Apple) + + # Test with invalid regex pattern. + err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'cultivar'\)" + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_regex + ): + inst = apple.Apple( + cultivar="!@#%@$#Akane" + ) + + err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'origin'\)" + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_regex + ): + inst = apple.Apple( + cultivar="Golden Delicious", + origin="!@#%@$#Chile" + ) + + def test_deserialize_mammal(self): + """ + deserialize mammal + mammal is a oneOf composed schema model with discriminator + """ + + # whale test + from petstore_api.model import mammal, zebra, whale + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=mammal.Mammal), + }, + ) + has_baleen = True + has_teeth = False + class_name = 'whale' + data = { + 'hasBaleen': has_baleen, + 'hasTeeth': has_teeth, + 'className': class_name + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, whale.Whale)) + self.assertEqual(bool(body.hasBaleen), has_baleen) + self.assertEqual(bool(body.hasTeeth), has_teeth) + self.assertEqual(body.className, class_name) + + # zebra test + zebra_type = 'plains' + class_name = 'zebra' + data = { + 'type': zebra_type, + 'className': class_name + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, zebra.Zebra)) + self.assertEqual(body.type, zebra_type) + self.assertEqual(body.className, class_name) + + def test_deserialize_float_value(self): + """ + Deserialize floating point values. + """ + from petstore_api.model import banana + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=banana.Banana), + }, + ) + data = { + 'lengthCm': 3.1415 + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, banana.Banana)) + self.assertTrue(isinstance(body.lengthCm, Decimal)) + self.assertEqual(body.lengthCm, 3.1415) + + """ + Float value is serialized without decimal point + The client receive it as an integer, which work because Banana.lengthCm is type number without format + Which accepts int AND float + """ + data = { + 'lengthCm': 3 + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, banana.Banana)) + self.assertTrue(isinstance(body.lengthCm, Decimal)) + self.assertEqual(body.lengthCm, 3) + + def test_deserialize_fruit_null_value(self): + """ + deserialize fruit with null value. + fruitReq is a oneOf composed schema model with discriminator, including 'null' type. + """ + from petstore_api.model import fruit_req + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=fruit_req.FruitReq), + }, + ) + data = None + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + self.assertTrue(isinstance(deserialized.body, fruit_req.FruitReq)) + self.assertTrue(isinstance(deserialized.body, NoneClass)) + + def test_deserialize_with_additional_properties(self): + """ + Deserialize data with schemas that have the additionalProperties keyword. + Test conditions when additional properties are allowed, not allowed, have + specific types... + """ + + # Dog is allOf with two child schemas. + # The OAS document for Dog does not specify the 'additionalProperties' keyword, + # which means that by default, the Dog schema must allow undeclared properties. + # The additionalProperties keyword is used to control the handling of extra stuff, + # that is, properties whose names are not listed in the properties keyword. + # By default any additional properties are allowed. + from petstore_api.model import dog, mammal, zebra, banana_req + data = { + 'className': 'Dog', + 'color': 'brown', + 'breed': 'golden retriever', + # Below are additional, undeclared properties. + 'group': 'Terrier Group', + 'size': 'medium', + } + response = self.__response(data) + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=dog.Dog), + }, + ) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, dog.Dog)) + self.assertEqual(body.className, 'Dog') + self.assertEqual(body.color, 'brown') + self.assertEqual(body.breed, 'golden retriever') + self.assertEqual(body.group, 'Terrier Group') + self.assertEqual(body.size, 'medium') + + # The 'zebra' schema allows additional properties by explicitly setting + # additionalProperties: true. + # This is equivalent to 'additionalProperties' not being present. + data = { + 'className': 'zebra', + 'type': 'plains', + # Below are additional, undeclared properties + 'group': 'abc', + 'size': 3, + 'p1': True, + 'p2': ['a', 'b', 123], + } + response = self.__response(data) + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=mammal.Mammal), + }, + ) + deserialized = _response_for_200.deserialize(response, self.configuration) + body = deserialized.body + self.assertTrue(isinstance(body, zebra.Zebra)) + self.assertEqual(body.className, 'zebra') + self.assertEqual(body.type, 'plains') + self.assertEqual(bool(body.p1), True) + + # The 'bananaReq' schema disallows additional properties by explicitly setting + # additionalProperties: false + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=banana_req.BananaReq), + }, + ) + with self.assertRaisesRegex( + petstore_api.exceptions.ApiTypeError, + r"BananaReq was passed 1 invalid argument: \['unknown-group'\]" + ): + data = { + 'lengthCm': 21.2, + 'sweet': False, + # Below are additional, undeclared properties. They are not allowed, + # an exception must be raised. + 'unknown-group': 'abc', + } + response = self.__response(data) + _response_for_200.deserialize(response, self.configuration) + + def test_deserialize_with_additional_properties_and_reference(self): + """ + Deserialize data with schemas that has the additionalProperties keyword + and the schema is specified as a reference ($ref). + """ + from petstore_api.model import drawing + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=drawing.Drawing), + }, + ) + data = { + 'mainShape': { + 'shapeType': 'Triangle', + 'triangleType': 'EquilateralTriangle', + }, + 'shapes': [ + { + 'shapeType': 'Triangle', + 'triangleType': 'IsoscelesTriangle', + }, + { + 'shapeType': 'Quadrilateral', + 'quadrilateralType': 'ComplexQuadrilateral', + }, + ], + 'an_additional_prop': { + 'lengthCm': 4, + 'color': 'yellow' + } + } + response = self.__response(data) + _response_for_200.deserialize(response, self.configuration) + + def test_deserialize_NumberWithValidations(self): + from petstore_api.model.number_with_validations import NumberWithValidations + from petstore_api.api.fake_api_endpoints.number_with_validations import _response_for_200 + + # make sure that an exception is thrown on an invalid type value + with self.assertRaises(petstore_api.ApiTypeError): + response = self.__response('test str') + _response_for_200.deserialize(response, self.configuration) + + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + response = self.__response(21.0) + _response_for_200.deserialize(response, self.configuration) + + # valid value works + number_val = 11.0 + response = self.__response(number_val) + response = _response_for_200.deserialize(response, self.configuration) + self.assertTrue(isinstance(response.body, NumberWithValidations)) + self.assertEqual(response.body, number_val) + + def test_array_of_enums(self): + from petstore_api.model.array_of_enums import ArrayOfEnums + from petstore_api.api.fake_api_endpoints.array_of_enums import _response_for_200 + from petstore_api.model import string_enum + data = ["placed", None] + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + assert isinstance(deserialized.body, ArrayOfEnums) + expected_results = ArrayOfEnums([string_enum.StringEnum(v) for v in data]) + assert expected_results == deserialized.body + + def test_multiple_of_deserialization(self): + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 30, + 'number': 65.0, + 'float': 62.4, + } + from petstore_api.model import format_test + _response_for_200 = api_client.OpenApiResponse( + content={ + self.json_content_type: api_client.MediaType(schema=format_test.FormatTest), + }, + ) + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, self.configuration) + self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) + + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" + ): + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2'. An error must be raised + 'number': 65.0, + 'float': 62.4, + } + response = self.__response(data) + _response_for_200.deserialize(response, self.configuration) + + # Disable JSON schema validation. No error should be raised during deserialization. + configuration = petstore_api.Configuration() + configuration.disabled_client_side_validations = "multipleOf" + + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2' + 'number': 65.0, + 'float': 62.4, + } + response = self.__response(data) + deserialized = _response_for_200.deserialize(response, configuration) + self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) + + # Disable JSON schema validation but for a different keyword. + # An error should be raised during deserialization. + configuration = petstore_api.Configuration() + configuration.disabled_client_side_validations = "maxItems" + + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" + ): + data = { + 'byte': '3', + 'date': '1970-01-01', + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2' + 'number': 65.0, + 'float': 62.4, + } + response = self.__response(data) + _response_for_200.deserialize(response, configuration) diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py new file mode 100644 index 00000000000..97d850d56b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_discard_unknown_properties.py @@ -0,0 +1,157 @@ +# # coding: utf-8 +# +# # flake8: noqa +# +# """ +# Run the tests. +# $ docker pull swaggerapi/petstore +# $ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +# $ pip install nose (optional) +# $ cd petstore_api-python +# $ nosetests -v +# """ +# from collections import namedtuple +# import json +# import re +# import unittest +# +# import petstore_api +# from petstore_api.model import cat, dog, isosceles_triangle, banana_req +# from petstore_api import Configuration, signing +# +# from petstore_api.schemas import ( +# file_type, +# model_to_dict, +# ) +# +# MockResponse = namedtuple('MockResponse', 'data') +# +# class DiscardUnknownPropertiesTests(unittest.TestCase): +# +# def test_deserialize_banana_req_do_not_discard_unknown_properties(self): +# """ +# deserialize bananaReq with unknown properties. +# Strict validation is enabled. +# Simple (non-composed) schema scenario. +# """ +# config = Configuration(discard_unknown_keys=False) +# api_client = petstore_api.ApiClient(config) +# data = { +# 'lengthCm': 21.3, +# 'sweet': False, +# # Below is an unknown property not explicitly declared in the OpenAPI document. +# # It should not be in the payload because additional properties (undeclared) are +# # not allowed in the bananaReq schema (additionalProperties: false). +# 'unknown_property': 'a-value' +# } +# response = MockResponse(data=json.dumps(data)) +# +# # 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, ((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))) +# +# +# def test_deserialize_isosceles_triangle_do_not_discard_unknown_properties(self): +# """ +# deserialize IsoscelesTriangle with unknown properties. +# Strict validation is enabled. +# Composed schema scenario. +# """ +# config = Configuration(discard_unknown_keys=False) +# api_client = petstore_api.ApiClient(config) +# data = { +# 'shape_type': 'Triangle', +# 'triangle_type': 'EquilateralTriangle', +# # Below is an unknown property not explicitly declared in the OpenAPI document. +# # It should not be in the payload because additional properties (undeclared) are +# # not allowed in the schema (additionalProperties: false). +# 'unknown_property': 'a-value' +# } +# response = MockResponse(data=json.dumps(data)) +# +# # 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, ((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))) +# +# +# def test_deserialize_banana_req_discard_unknown_properties(self): +# """ +# Deserialize bananaReq with unknown properties. +# Discard unknown properties. +# """ +# config = Configuration(discard_unknown_keys=True) +# api_client = petstore_api.ApiClient(config) +# data = { +# 'lengthCm': 21.3, +# 'sweet': False, +# # Below are additional (undeclared) properties not specified in the bananaReq schema. +# 'unknown_property': 'a-value', +# 'more-unknown': [ +# 'a' +# ] +# } +# # 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, ((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()) +# self.assertNotIn("unknown_property", deserialized.to_dict().keys()) +# self.assertNotIn("more-unknown", deserialized.to_dict().keys()) +# +# def test_deserialize_cat_do_not_discard_unknown_properties(self): +# """ +# Deserialize Cat with unknown properties. +# Strict validation is enabled. +# """ +# config = Configuration(discard_unknown_keys=False) +# api_client = petstore_api.ApiClient(config) +# data = { +# "class_name": "Cat", +# "color": "black", +# "declawed": True, +# "dynamic-property": 12345, +# } +# response = MockResponse(data=json.dumps(data)) +# +# # 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, ((cat.Cat),), True) +# self.assertTrue(isinstance(deserialized, cat.Cat)) +# self.assertIn('color', deserialized.to_dict()) +# self.assertEqual(deserialized['color'], 'black') +# +# def test_deserialize_cat_discard_unknown_properties(self): +# """ +# Deserialize Cat with unknown properties. +# Request to discard unknown properties, but Cat is composed schema +# with one inner schema that has 'additionalProperties' set to true. +# """ +# config = Configuration(discard_unknown_keys=True) +# api_client = petstore_api.ApiClient(config) +# data = { +# "class_name": "Cat", +# "color": "black", +# "declawed": True, +# # Below are additional (undeclared) properties. +# "my_additional_property": 123, +# } +# # 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, ((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()) +# self.assertIn("my_additional_property", deserialized.to_dict().keys()) +# diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py new file mode 100644 index 00000000000..3be8388499c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_drawing.py @@ -0,0 +1,166 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.schemas import NoneClass +from petstore_api.model import shape +from petstore_api.model import shape_or_null +from petstore_api.model.drawing import Drawing + + +class TestDrawing(unittest.TestCase): + """Drawing unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_create_instances(self): + """ + Validate instance can be created + """ + + inst = shape.Shape( + shapeType="Triangle", + triangleType="IsoscelesTriangle" + ) + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + 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 = shape.Shape( + shapeType="Triangle", + triangleType="IsoscelesTriangle" + ) + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + assert isinstance(isosceles_triangle, IsoscelesTriangle) + from petstore_api.model.equilateral_triangle import EquilateralTriangle + + inst = Drawing( + mainShape=isosceles_triangle, + shapes=[ + shape.Shape( + shapeType="Triangle", + triangleType="EquilateralTriangle" + ), + shape.Shape( + shapeType="Triangle", + triangleType="IsoscelesTriangle" + ), + shape.Shape( + shapeType="Triangle", + triangleType="EquilateralTriangle" + ), + shape.Shape( + shapeType="Quadrilateral", + quadrilateralType="ComplexQuadrilateral" + ) + ], + ) + assert isinstance(inst, Drawing) + assert isinstance(inst.mainShape, IsoscelesTriangle) + self.assertEqual(len(inst.shapes), 4) + from petstore_api.model.complex_quadrilateral import 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 mainShape because the 'null' type + # is not one of the allowed types in the 'Shape' schema. + err_msg = (r"Invalid inputs given to generate an instance of .+?Shape.+? " + r"None of the oneOf schemas matched the input data.") + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg + ): + inst = Drawing( + # 'mainShape' has type 'Shape', which is a oneOf [triangle, quadrilateral] + # So the None value should not be allowed and an exception should be raised. + mainShape=None, + ) + + """ + we can't pass in an incorrect type for shapes + 'shapes' items has type 'Shape', which is a oneOf [Triangle, Quadrilateral] + composed schema. We are not able to assign Triangle tor Quadrilateral + to a shapes item because those instances do not include Shape validation + Shape could require additional validations that Triangle + Quadrilateral do not include + """ + from petstore_api.model.triangle import Triangle + err_msg = (r"Incorrect type passed in, required type was " + r"and passed type was at " + r"\('args\[0\]', 'shapes', 0\)") + with self.assertRaisesRegex( + petstore_api.ApiTypeError, + err_msg + ): + inst = Drawing( + mainShape=isosceles_triangle, + shapes=[ + Triangle( + shapeType="Triangle", + triangleType="EquilateralTriangle" + ) + ] + ) + + def test_deserialize_oneof_reference_with_null_type(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. + Further, the 'oneOf' schema has a 'null' type child schema (as introduced in + OpenAPI 3.1). + """ + + # 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 = Drawing( + # 'shapeOrNull' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] + shapeOrNull=None, + ) + assert isinstance(inst, Drawing) + self.assertFalse('mainShape' in inst) + self.assertTrue('shapeOrNull' in inst) + self.assertTrue(isinstance(inst.shapeOrNull, NoneClass)) + + def test_deserialize_oneof_reference_with_nullable_type(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. + Further, the 'oneOf' schema has the 'nullable' attribute (as introduced in + OpenAPI 3.0 and deprecated in 3.1). + """ + + # Validate we can assign the None value to nullableShape, because the NullableShape + # has the 'nullable: true' attribute. + inst = Drawing( + # 'nullableShape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] + # and the 'nullable: true' attribute. + nullableShape=None, + ) + assert isinstance(inst, Drawing) + self.assertFalse('mainShape' in inst) + self.assertTrue('nullableShape' in inst) + self.assertTrue(isinstance(inst.nullableShape, NoneClass)) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py new file mode 100644 index 00000000000..5bf6b989ebe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_extra_pool_config_options.py @@ -0,0 +1,61 @@ +import unittest +from unittest.mock import patch + +import petstore_api + + +class StubPoolManager(object): + actual_kwargs = None + + def __init__(self, num_pools=10, headers=None, **kwargs): + # Matches the contract of urllib3.PoolManager + self.actual_kwargs = kwargs + + +class StubProxyManager: + actual_kwargs = None + + def __init__( + self, + proxy_url, + num_pools=10, + headers=None, + proxy_headers=None, + **kwargs + ): + # Matches the contract of urllib3.ProxyManager + self.actual_kwargs = kwargs + + +class TestExtraOptionsForPools(unittest.TestCase): + + def test_socket_options_get_passed_to_pool_manager(self): + + socket_options = ["extra", "socket", "options"] + + config = petstore_api.Configuration(host="HOST") + config.socket_options = socket_options + + with patch("petstore_api.rest.urllib3.PoolManager", StubPoolManager): + api_client = petstore_api.ApiClient(config) + + # urllib3.PoolManager promises to pass socket_options in kwargs + # to the underlying socket. So asserting that our manager + # gets it is a good start + assert api_client.rest_client.pool_manager.actual_kwargs["socket_options"] == socket_options + + def test_socket_options_get_passed_to_proxy_manager(self): + + socket_options = ["extra", "socket", "options"] + + config = petstore_api.Configuration(host="HOST") + config.socket_options = socket_options + config.proxy = True + + with patch("petstore_api.rest.urllib3.ProxyManager", StubProxyManager): + api_client = petstore_api.ApiClient(config) + + # urllib3.ProxyManager promises to pass socket_options in kwargs + # to the underlying socket. So asserting that our manager + # gets it is a good start + assert api_client.rest_client.pool_manager.actual_kwargs["socket_options"] == socket_options diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py new file mode 100644 index 00000000000..c053cee62fb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fake_api.py @@ -0,0 +1,575 @@ +# 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 +""" + +import io +import sys +import unittest +import json +import typing +from unittest.mock import patch + +import urllib3 +from urllib3._collections import HTTPHeaderDict + +import petstore_api +from petstore_api import api_client, schemas +from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import RESTClientObject + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + json_content_type = 'application/json' + configuration = petstore_api.Configuration() + api = FakeApi(api_client=api_client.ApiClient(configuration=configuration)) + + @staticmethod + def headers_for_content_type(content_type: str) -> dict[str, str]: + return {'content-type': content_type} + + @classmethod + def __response( + cls, + body: typing.Union[str, bytes], + status: int = 200, + content_type: str = json_content_type, + headers: typing.Optional[dict[str, str]] = None, + preload_content: bool = True + ) -> urllib3.HTTPResponse: + if headers is None: + headers = {} + headers.update(cls.headers_for_content_type(content_type)) + return urllib3.HTTPResponse( + body, + headers=headers, + status=status, + preload_content=preload_content + ) + + @staticmethod + def __json_bytes(in_data: typing.Any) -> bytes: + return json.dumps(in_data, separators=(",", ":"), ensure_ascii=False).encode('utf-8') + + @staticmethod + def __assert_request_called_with( + mock_request, + url: str, + body: typing.Optional[bytes] = None, + content_type: str = 'application/json', + fields: typing.Optional[tuple[api_client.RequestField, ...]] = None, + accept_content_type: str = 'application/json', + stream: bool = False, + ): + mock_request.assert_called_with( + 'POST', + url, + headers=HTTPHeaderDict( + { + 'Accept': accept_content_type, + 'Content-Type': content_type, + 'User-Agent': 'OpenAPI-Generator/1.0.0/python' + } + ), + body=body, + query_params=None, + fields=fields, + stream=stream, + timeout=None, + ) + + def test_array_model(self): + from petstore_api.model import animal_farm, animal + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_request: + json_data = [{"className": "Cat", "color": "black"}] + mock_request.return_value = self.__response( + self.__json_bytes(json_data) + ) + + cat = animal.Animal(className="Cat", color="black") + body = animal_farm.AnimalFarm([cat]) + api_response = self.api.array_model(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', + body=self.__json_bytes(json_data) + ) + + assert isinstance(api_response.body, animal_farm.AnimalFarm) + assert api_response.body == body + + def test_recursionlimit(self): + """Test case for recursionlimit + + """ + assert sys.getrecursionlimit() == 1234 + + def test_array_of_enums(self): + from petstore_api.model import array_of_enums, string_enum + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_request: + value = [string_enum.StringEnum("placed")] + body = array_of_enums.ArrayOfEnums(value) + value_simple = ["placed"] + mock_request.return_value = self.__response( + self.__json_bytes(value_simple) + ) + + api_response = self.api.array_of_enums(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', + body=self.__json_bytes(value_simple) + ) + + assert isinstance(api_response.body, array_of_enums.ArrayOfEnums) + assert api_response.body == body + + def test_number_with_validations(self): + from petstore_api.model import number_with_validations + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_request: + value = 10.0 + body = number_with_validations.NumberWithValidations(value) + mock_request.return_value = self.__response( + self.__json_bytes(value) + ) + + api_response = self.api.number_with_validations(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/number', + body=self.__json_bytes(value) + ) + + assert isinstance(api_response.body, number_with_validations.NumberWithValidations) + assert api_response.body == value + + def test_composed_one_of_different_types(self): + from petstore_api.model import composed_one_of_different_types + + # serialization + deserialization works + number = composed_one_of_different_types.ComposedOneOfDifferentTypes(10.0) + cat = composed_one_of_different_types.ComposedOneOfDifferentTypes( + className="Cat", color="black" + ) + none_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes(None) + date_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes('1970-01-01') + cast_to_simple_value = [ + (number, 10.0), + (cat, {"className": "Cat", "color": "black"}), + (none_instance, None), + (date_instance, '1970-01-01'), + ] + for (body, value_simple) in cast_to_simple_value: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.__response( + self.__json_bytes(value_simple) + ) + + api_response = self.api.composed_one_of_different_types(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', + body=self.__json_bytes(value_simple) + ) + + assert isinstance(api_response.body, composed_one_of_different_types.ComposedOneOfDifferentTypes) + assert api_response.body == body + + # inputting the uncast values into the endpoint also works + for (body, value_simple) in cast_to_simple_value: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.__response( + self.__json_bytes(value_simple) + ) + + api_response = self.api.composed_one_of_different_types(body=value_simple) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', + body=self.__json_bytes(value_simple) + ) + + assert isinstance(api_response.body, composed_one_of_different_types.ComposedOneOfDifferentTypes) + assert api_response.body == body + + def test_string(self): + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_request: + body = "blah" + value_simple = body + mock_request.return_value = self.__response( + self.__json_bytes(value_simple) + ) + + api_response = self.api.string(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/string', + body=self.__json_bytes(value_simple) + ) + + assert isinstance(api_response.body, str) + assert api_response.body == value_simple + + def test_string_enum(self): + from petstore_api.model import string_enum + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_request: + value = "placed" + body = string_enum.StringEnum(value) + mock_request.return_value = self.__response( + self.__json_bytes(value) + ) + + api_response = self.api.string_enum(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/enum', + body=self.__json_bytes(value) + ) + + assert isinstance(api_response.body, string_enum.StringEnum) + assert api_response.body == value + + def test_mammal(self): + # serialization + deserialization works + from petstore_api.model.mammal import Mammal + with patch.object(RESTClientObject, 'request') as mock_request: + body = Mammal(className="BasquePig") + value_simple = dict(className='BasquePig') + mock_request.return_value = self.__response( + self.__json_bytes(value_simple) + ) + + api_response = self.api.mammal(body=body) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/refs/mammal', + body=self.__json_bytes(value_simple) + ) + + assert isinstance(api_response.body, Mammal) + assert api_response.body == value_simple + + def test_missing_or_unset_required_body(self): + # missing required body + with self.assertRaises(TypeError): + self.api.mammal() + # required body may not be unset + with self.assertRaises(petstore_api.ApiValueError): + self.api.mammal(body=schemas.unset) + + def test_missing_or_unset_required_query_parameter(self): + from petstore_api.model.user import User + user = User({}) + # missing required query param + with self.assertRaises(petstore_api.ApiTypeError): + self.api.body_with_query_params(body=user) + # required query param may not be unset + with self.assertRaises(petstore_api.ApiValueError): + self.api.body_with_query_params(body=schemas.unset, query_params=dict(query=schemas.unset)) + + def test_upload_download_file_tx_bytes_and_file(self): + """Test case for upload_download_file + uploads a file and downloads a file using application/octet-stream # noqa: E501 + """ + import os + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + file1 = open(file_path1, "rb") + mock_response = self.__response( + file_bytes, + content_type='application/octet-stream' + ) + try: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file1) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream' + ) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.BytesSchema)) + self.assertTrue(isinstance(api_response.body, bytes)) + self.assertEqual(api_response.body, file_bytes) + except petstore_api.ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + + # sending just bytes works also + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file_bytes) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream' + ) + self.assertEqual(api_response.body, file_bytes) + + def test_upload_download_file_rx_file(self): + import os + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + + # passing in file1 as the response body simulates a streamed response + file1 = open(file_path1, "rb") + + class StreamableBody: + """ + This class simulates http.client.HTTPResponse for a streamable response + """ + def __init__(self, file: io.BufferedReader): + self.fp = file + + def read(self, *args, **kwargs): + return self.fp.read(*args, **kwargs) + + def close(self): + self.fp.close() + + streamable_body = StreamableBody(file1) + + mock_response = self.__response( + streamable_body, + content_type='application/octet-stream', + preload_content=False + ) + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file_bytes, stream=True) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream', + stream=True + ) + self.assertTrue(file1.closed) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileIO)) + self.assertEqual(api_response.body.read(), file_bytes) + api_response.body.close() + os.unlink(api_response.body.name) + + file1 = open(file_path1, "rb") + streamable_body = StreamableBody(file1) + saved_file_name = "fileName.abc" + + """ + when streaming is used and the response contains the content disposition header with a filename + that filename is used when saving the file locally + """ + mock_response = self.__response( + streamable_body, + content_type='application/octet-stream', + headers={'content-disposition': f'attachment; filename="{saved_file_name}"'}, + preload_content=False + ) + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = mock_response + api_response = self.api.upload_download_file(body=file_bytes, stream=True) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile', + body=file_bytes, + content_type='application/octet-stream', + accept_content_type='application/octet-stream', + stream=True + ) + self.assertTrue(file1.closed) + self.assertTrue(isinstance(api_response.body, schemas.BinarySchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileSchema)) + self.assertTrue(isinstance(api_response.body, schemas.FileIO)) + self.assertTrue(api_response.body.name.endswith(saved_file_name)) + self.assertEqual(api_response.body.read(), file_bytes) + api_response.body.close() + os.unlink(api_response.body.name) + + def test_upload_file(self): + """Test case for upload_file + uploads a file using multipart/form-data # noqa: E501 + """ + import os + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + file1 = open(file_path1, "rb") + response_json = { + 'code': 200, + 'type': 'blah', + 'message': 'file upload succeeded' + } + try: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.__response( + self.__json_bytes(response_json) + ) + api_response = self.api.upload_file(body={'file': file1}) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadFile', + fields=( + api_client.RequestField( + name='file', + data=file_bytes, + filename=file_name, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' + ) + self.assertEqual(api_response.body, response_json) + except petstore_api.ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + + # sending just bytes works also + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.__response( + self.__json_bytes(response_json) + ) + api_response = self.api.upload_file(body={'file': file_bytes}) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadFile', + fields=( + api_client.RequestField( + name='file', + data=file_bytes, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' + ) + self.assertEqual(api_response.body, response_json) + + # passing in an array of files to when file only allows one + # raises an exceptions + try: + file = open(file_path1, "rb") + with self.assertRaises(petstore_api.ApiTypeError): + self.api.upload_file(body={'file': [file]}) + finally: + file.close() + + # passing in a closed file raises an exception + with self.assertRaises(ValueError): + file = open(file_path1, "rb") + file.close() + self.api.upload_file(body={'file': file}) + + def test_upload_files(self): + """Test case for upload_files + uploads files using multipart/form-data # noqa: E501 + """ + import os + test_file_dir = os.path.realpath( + os.path.join(os.path.dirname(__file__), "..", "testfiles")) + file_name = '1px_pic1.png' + file_path1 = os.path.join(test_file_dir, file_name) + + with open(file_path1, "rb") as some_file: + file_bytes = some_file.read() + file1 = open(file_path1, "rb") + response_json = { + 'code': 200, + 'type': 'blah', + 'message': 'file upload succeeded' + } + try: + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.__response( + self.__json_bytes(response_json) + ) + api_response = self.api.upload_files(body={'files': [file1, file1]}) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadFiles', + fields=( + api_client.RequestField( + name='files', + data=file_bytes, + filename=file_name, + headers={'Content-Type': 'application/octet-stream'} + ), + api_client.RequestField( + name='files', + data=file_bytes, + filename=file_name, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' + ) + self.assertEqual(api_response.body, response_json) + except petstore_api.ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + finally: + file1.close() + + # sending just bytes works also + with patch.object(RESTClientObject, 'request') as mock_request: + mock_request.return_value = self.__response( + self.__json_bytes(response_json) + ) + api_response = self.api.upload_files(body={'files': [file_bytes, file_bytes]}) + self.__assert_request_called_with( + mock_request, + 'http://petstore.swagger.io:80/v2/fake/uploadFiles', + fields=( + api_client.RequestField( + name='files', + data=file_bytes, + headers={'Content-Type': 'application/octet-stream'} + ), + api_client.RequestField( + name='files', + data=file_bytes, + headers={'Content-Type': 'application/octet-stream'} + ), + ), + content_type='multipart/form-data' + ) + self.assertEqual(api_response.body, response_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py new file mode 100644 index 00000000000..91578395317 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_format_test.py @@ -0,0 +1,134 @@ +# 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 decimal import Decimal +import datetime +import unittest + +import petstore_api +from petstore_api.model.format_test import FormatTest +from petstore_api.schemas import BinarySchema, BytesSchema, frozendict, Singleton + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_FormatTest(self): + """Test FormatTest""" + + required_args = dict( + number=32.5, + byte='a', + date='2021-01-01', + password='abcdefghij' + ) + # int32 + # under min + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(int32=-2147483649, **required_args) + # over max + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(int32=2147483648, **required_args) + # valid values in range work + valid_values = [-2147483648, 2147483647] + for valid_value in valid_values: + model = FormatTest(int32=valid_value, **required_args) + assert model.int32 == valid_value + + # int64 + # under min + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(int64=-9223372036854775809, **required_args) + # over max + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(int64=9223372036854775808, **required_args) + # valid values in range work + valid_values = [-9223372036854775808, 9223372036854775807] + for valid_value in valid_values: + model = FormatTest(int64=valid_value, **required_args) + assert model.int64 == valid_value + + # float32 + # under min + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(float32=-3.402823466385289e+38, **required_args) + # over max + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(float32=3.402823466385289e+38, **required_args) + # valid values in range work + valid_values = [-3.4028234663852886e+38, 3.4028234663852886e+38] + for valid_value in valid_values: + model = FormatTest(float32=valid_value, **required_args) + assert model.float32 == valid_value + + # float64 + # under min, Decimal is used because flat can only store 64bit numbers and the max and min + # take up more space than 64bit + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(float64=Decimal('-1.7976931348623157082e+308'), **required_args) + # over max + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(float64=Decimal('1.7976931348623157082e+308'), **required_args) + valid_values = [-1.7976931348623157E+308, 1.7976931348623157E+308] + for valid_value in valid_values: + model = FormatTest(float64=valid_value, **required_args) + assert model.float64 == valid_value + + # unique_items with duplicates throws exception + with self.assertRaises(petstore_api.ApiValueError): + model = FormatTest(arrayWithUniqueItems=[0, 1, 1], **required_args) + # no duplicates works + values = [0, 1, 2] + model = FormatTest(arrayWithUniqueItems=values, **required_args) + assert model.arrayWithUniqueItems == tuple(values) + + # __bool__ value of noneProp is False + model = FormatTest(noneProp=None, **required_args) + assert isinstance(model.noneProp, Singleton) + self.assertFalse(model.noneProp) + self.assertTrue(model.noneProp.is_none()) + + # binary check + model = FormatTest(binary=b'123', **required_args) + assert isinstance(model.binary, BinarySchema) + assert isinstance(model.binary, BytesSchema) + assert isinstance(model.binary, bytes) + assert model == frozendict( + binary=b'123', + number=Decimal(32.5), + byte='a', + date='2021-01-01', + password='abcdefghij' + ) + + def test_multiple_of(self): + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" + ): + inst = FormatTest( + byte='3', + date=datetime.date(2000, 1, 1), + password="abcdefghijkl", + integer=31, # Value is supposed to be multiple of '2'. An error must be raised + number=65.0, + float=62.4 + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py new file mode 100644 index 00000000000..7d31b94a825 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit.py @@ -0,0 +1,170 @@ +# 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 datetime import date +import unittest + +import petstore_api +from petstore_api.model import apple +from petstore_api.model import banana +from petstore_api.model.fruit import Fruit +from petstore_api.schemas import Singleton + + +class TestFruit(unittest.TestCase): + """Fruit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFruit(self): + """Test Fruit""" + + # make an instance of Fruit, a composed schema oneOf model + # banana test + length_cm = 20.3 + color = 'yellow' + fruit = Fruit(lengthCm=length_cm, color=color) + # check its properties + self.assertEqual(fruit.lengthCm, length_cm) + self.assertEqual(fruit['lengthCm'], length_cm) + self.assertEqual(fruit.get('lengthCm'), length_cm) + self.assertEqual(getattr(fruit, 'lengthCm'), length_cm) + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + # check the dict representation + self.assertEqual( + fruit, + { + 'lengthCm': length_cm, + 'color': color + } + ) + # setting values after instance creation is not allowed + with self.assertRaises(TypeError): + fruit['color'] = 'some value' + + # Assert that we can call the builtin hasattr() function. + # hasattr should return False for non-existent attribute. + # Internally hasattr catches the AttributeError exception. + self.assertFalse(hasattr(fruit, 'invalid_variable')) + + # Assert that we can call the builtin hasattr() function. + # hasattr should return True for existent attribute. + self.assertTrue(hasattr(fruit, 'color')) + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(KeyError): + fruit['cultivar'] + # with getattr + # Per Python doc, if the named attribute does not exist, + # default is returned if provided. + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') + self.assertEqual(fruit.get('cultivar'), None) + self.assertEqual(fruit.get('cultivar', 'some value'), 'some value') + + # 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') + + # make sure that the ModelComposed class properties are correct + # model._composed_schemas stores the anyOf/allOf/oneOf info + self.assertEqual( + fruit._composed_schemas, + { + 'anyOf': [], + 'allOf': [], + 'oneOf': [ + apple.Apple, + banana.Banana, + ], + } + ) + + """ + including extra parameters does not raise an exception + because objects support additional properties by default + """ + kwargs = dict( + color=color, + lengthCm=length_cm, + additional_string='some value', + additional_date='2021-01-02', + ) + + fruit = Fruit._from_openapi_data(**kwargs) + self.assertEqual( + fruit, + kwargs + ) + + fruit = Fruit(**kwargs) + self.assertEqual( + fruit, + kwargs + ) + + # including input parameters for two oneOf instances raise an exception + with self.assertRaises(petstore_api.ApiValueError): + Fruit( + lengthCm=length_cm, + cultivar='granny smith' + ) + + # make an instance of Fruit, a composed schema oneOf model + # apple test + color = 'red' + cultivar = 'golden delicious' + fruit = Fruit(color=color, cultivar=cultivar) + # check its properties + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + # check the dict representation + self.assertEqual( + fruit, + { + 'color': color, + 'cultivar': cultivar + } + ) + + def testFruitNullValue(self): + # Since 'apple' is nullable, validate we can create an apple with the 'null' value. + fruit = apple.Apple(None) + assert isinstance(fruit, Singleton) + assert isinstance(fruit, apple.Apple) + assert fruit.is_none() is True + + # 'banana' is not nullable. + # TODO cast this into ApiTypeError? + with self.assertRaises(TypeError): + banana.Banana(None) + + # Since 'fruit' has oneOf 'apple', 'banana' and 'apple' is nullable, + # validate we can create a fruit with the 'null' value. + fruit = Fruit(None) + assert isinstance(fruit, Singleton) + assert isinstance(fruit, apple.Apple) + assert isinstance(fruit, Fruit) + assert fruit.is_none() is True + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py new file mode 100644 index 00000000000..e777e603e1a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_fruit_req.py @@ -0,0 +1,122 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model import apple_req +from petstore_api.model import banana_req +from petstore_api.model.fruit_req import FruitReq +from petstore_api.schemas import NoneSchema, Singleton + + +class TestFruitReq(unittest.TestCase): + """FruitReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFruitReq(self): + """Test FruitReq""" + + # make an instance of Fruit, a composed schema oneOf model + # banana test + length_cm = 20.3 + fruit = FruitReq(lengthCm=length_cm) + # check its properties + self.assertEqual(fruit.lengthCm, length_cm) + self.assertEqual(fruit['lengthCm'], length_cm) + self.assertEqual(getattr(fruit, 'lengthCm'), length_cm) + # check the dict representation + self.assertEqual( + fruit, + { + 'lengthCm': length_cm, + } + ) + # setting values after instance creation is not allowed + with self.assertRaises(TypeError): + fruit['lengthCm'] = 'some value' + + # setting values after instance creation is not allowed + with self.assertRaises(AttributeError): + setattr(fruit, 'lengthCm', 'some value') + + # getting a value that doesn't exist raises an exception + # with a key + with self.assertRaises(KeyError): + invalid_variable = fruit['cultivar'] + + # with getattr + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') + + with self.assertRaises(AttributeError): + getattr(fruit, 'cultivar') + + # make sure that the ModelComposed class properties are correct + # model._composed_schemas stores the anyOf/allOf/oneOf info + self.assertEqual( + fruit._composed_schemas, + { + 'anyOf': [], + 'allOf': [], + 'oneOf': [ + NoneSchema, + apple_req.AppleReq, + banana_req.BananaReq, + ], + } + ) + + # including extra parameters raises an exception + with self.assertRaises(petstore_api.ApiValueError): + 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 = FruitReq( + length_cm=length_cm, + cultivar='granny smith' + ) + + # make an instance of Fruit, a composed schema oneOf model + # apple test + cultivar = 'golden delicious' + fruit = FruitReq(cultivar=cultivar) + # check its properties + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + # check the dict representation + self.assertEqual( + fruit, + { + 'cultivar': cultivar + } + ) + + # we can pass in None + fruit = FruitReq(None) + assert isinstance(fruit, Singleton) + assert isinstance(fruit, FruitReq) + assert isinstance(fruit, NoneSchema) + assert fruit.is_none() is True + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py new file mode 100644 index 00000000000..6d27f7c9dab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_gm_fruit.py @@ -0,0 +1,135 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model import apple +from petstore_api.model import banana +from petstore_api.model.gm_fruit import GmFruit +from petstore_api.schemas import frozendict + +class TestGmFruit(unittest.TestCase): + """GmFruit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGmFruit(self): + """Test GmFruit""" + + # make an instance of GmFruit, a composed schema anyOf model + # banana test + length_cm = 20.3 + color = 'yellow' + cultivar = 'banaple' + fruit = GmFruit(lengthCm=length_cm, color=color, cultivar=cultivar) + assert isinstance(fruit, GmFruit) + assert isinstance(fruit, banana.Banana) + assert isinstance(fruit, apple.Apple) + assert isinstance(fruit, frozendict) + # check its properties + self.assertEqual(fruit.lengthCm, length_cm) + self.assertEqual(fruit['lengthCm'], length_cm) + self.assertEqual(getattr(fruit, 'lengthCm'), length_cm) + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + # check the dict representation + self.assertEqual( + fruit, + { + 'lengthCm': length_cm, + 'color': color, + 'cultivar': cultivar + } + ) + + with self.assertRaises(KeyError): + invalid_variable = fruit['origin'] + # with getattr + self.assertTrue(getattr(fruit, 'origin', 'some value'), 'some value') + + # make sure that the ModelComposed class properties are correct + # model._composed_schemas stores the anyOf/allOf/oneOf info + self.assertEqual( + fruit._composed_schemas, + { + 'anyOf': [ + apple.Apple, + banana.Banana, + ], + 'allOf': [], + 'oneOf': [], + } + ) + + # including extra parameters works + fruit = GmFruit( + color=color, + length_cm=length_cm, + cultivar=cultivar, + unknown_property='some value' + ) + + # including input parameters for both anyOf instances works + color = 'orange' + color_stored = b'orange' + fruit = GmFruit( + color=color, + cultivar=cultivar, + length_cm=length_cm + ) + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + self.assertEqual(fruit.length_cm, length_cm) + self.assertEqual(fruit['length_cm'], length_cm) + self.assertEqual(getattr(fruit, 'length_cm'), length_cm) + + # make an instance of GmFruit, a composed schema anyOf model + # apple test + color = 'red' + cultivar = 'golden delicious' + origin = 'California' + fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) + # check its properties + self.assertEqual(fruit.color, color) + self.assertEqual(fruit['color'], color) + self.assertEqual(getattr(fruit, 'color'), color) + self.assertEqual(fruit.cultivar, cultivar) + self.assertEqual(fruit['cultivar'], cultivar) + self.assertEqual(getattr(fruit, 'cultivar'), cultivar) + + self.assertEqual(fruit.origin, origin) + self.assertEqual(fruit['origin'], origin) + self.assertEqual(getattr(fruit, 'origin'), origin) + + # check the dict representation + self.assertEqual( + fruit, + { + 'color': color, + 'cultivar': cultivar, + 'origin': origin, + } + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py new file mode 100644 index 00000000000..9783829e30b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_http_signature.py @@ -0,0 +1,518 @@ +# # coding: utf-8 +# +# # flake8: noqa +# +# """ +# Run the tests. +# $ docker pull swaggerapi/petstore +# $ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +# $ pip install nose (optional) +# $ cd petstore_api-python +# $ nosetests -v +# """ +# +# from collections import namedtuple +# from datetime import datetime, timedelta +# import base64 +# import json +# import os +# import re +# import shutil +# import unittest +# from urllib.parse import urlencode, urlparse +# +# from Crypto.Hash import SHA256, SHA512 +# from Crypto.PublicKey import ECC, RSA +# from Crypto.Signature import pkcs1_15, pss, DSS +# +# 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, +# RESTResponse +# ) +# +# from petstore_api.exceptions import ( +# ApiException, +# ApiValueError, +# ApiTypeError, +# ) +# +# from .util import id_gen +# +# import urllib3 +# +# from unittest.mock import patch +# +# HOST = 'http://localhost/v2' +# +# # This test RSA private key below is published in Appendix C 'Test Values' of +# # https://www.ietf.org/id/draft-cavage-http-signatures-12.txt +# RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- +# MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF +# NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F +# UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB +# AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA +# QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK +# kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg +# f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u +# 412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc +# mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 +# kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA +# gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW +# G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI +# 7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== +# -----END RSA PRIVATE KEY-----""" +# +# +# class TimeoutWithEqual(urllib3.Timeout): +# def __init__(self, *arg, **kwargs): +# super(TimeoutWithEqual, self).__init__(*arg, **kwargs) +# +# def __eq__(self, other): +# return self._read == other._read and self._connect == other._connect and self.total == other.total +# +# class MockPoolManager(object): +# def __init__(self, tc): +# self._tc = tc +# self._reqs = [] +# +# def expect_request(self, *args, **kwargs): +# self._reqs.append((args, kwargs)) +# +# def set_signing_config(self, signing_cfg): +# self.signing_cfg = signing_cfg +# self._tc.assertIsNotNone(self.signing_cfg) +# self.pubkey = self.signing_cfg.get_public_key() +# self._tc.assertIsNotNone(self.pubkey) +# +# def request(self, *actual_request_target, **actual_request_headers_and_body): +# self._tc.assertTrue(len(self._reqs) > 0) +# expected_results = self._reqs.pop(0) +# self._tc.maxDiff = None +# expected_request_target = expected_results[0] # The expected HTTP method and URL path. +# expected_request_headers_and_body = expected_results[1] # dict that contains the expected body, headers +# self._tc.assertEqual(expected_request_target, actual_request_target) +# # actual_request_headers_and_body is a dict that contains the actual body, headers +# for k, expected in expected_request_headers_and_body.items(): +# self._tc.assertIn(k, actual_request_headers_and_body) +# if k == 'body': +# actual_body = actual_request_headers_and_body[k] +# self._tc.assertEqual(expected, actual_body) +# elif k == 'headers': +# actual_headers = actual_request_headers_and_body[k] +# for expected_header_name, expected_header_value in expected.items(): +# # Validate the generated request contains the expected header. +# self._tc.assertIn(expected_header_name, actual_headers) +# actual_header_value = actual_headers[expected_header_name] +# # Compare the actual value of the header against the expected value. +# pattern = re.compile(expected_header_value) +# m = pattern.match(actual_header_value) +# self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format( +# expected_header_value,actual_header_value)) +# if expected_header_name == 'Authorization': +# self._validate_authorization_header( +# expected_request_target, actual_headers, actual_header_value) +# elif k == 'timeout': +# self._tc.assertEqual(expected, actual_request_headers_and_body[k]) +# return urllib3.HTTPResponse(status=200, body=b'test') +# +# def _validate_authorization_header(self, request_target, actual_headers, authorization_header): +# """Validate the signature. +# """ +# # Extract (created) +# r1 = re.compile(r'created=([0-9]+)') +# m1 = r1.search(authorization_header) +# self._tc.assertIsNotNone(m1) +# created = m1.group(1) +# +# # Extract list of signed headers +# r1 = re.compile(r'headers="([^"]+)"') +# m1 = r1.search(authorization_header) +# self._tc.assertIsNotNone(m1) +# headers = m1.group(1).split(' ') +# signed_headers_list = [] +# for h in headers: +# if h == '(created)': +# signed_headers_list.append((h, created)) +# elif h == '(request-target)': +# url = request_target[1] +# target_path = urlparse(url).path +# signed_headers_list.append((h, "{0} {1}".format(request_target[0].lower(), target_path))) +# else: +# value = next((v for k, v in actual_headers.items() if k.lower() == h), None) +# self._tc.assertIsNotNone(value) +# signed_headers_list.append((h, value)) +# header_items = [ +# "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] +# string_to_sign = "\n".join(header_items) +# digest = None +# if self.signing_cfg.hash_algorithm == signing.HASH_SHA512: +# digest = SHA512.new() +# elif self.signing_cfg.hash_algorithm == signing.HASH_SHA256: +# digest = SHA256.new() +# else: +# self._tc.fail("Unsupported hash algorithm: {0}".format(self.signing_cfg.hash_algorithm)) +# digest.update(string_to_sign.encode()) +# b64_body_digest = base64.b64encode(digest.digest()).decode() +# +# # Extract the signature +# r2 = re.compile(r'signature="([^"]+)"') +# m2 = r2.search(authorization_header) +# self._tc.assertIsNotNone(m2) +# b64_signature = m2.group(1) +# signature = base64.b64decode(b64_signature) +# # Build the message +# signing_alg = self.signing_cfg.signing_algorithm +# if signing_alg is None: +# # Determine default +# if isinstance(self.pubkey, RSA.RsaKey): +# signing_alg = signing.ALGORITHM_RSASSA_PSS +# elif isinstance(self.pubkey, ECC.EccKey): +# signing_alg = signing.ALGORITHM_ECDSA_MODE_FIPS_186_3 +# else: +# self._tc.fail("Unsupported key: {0}".format(type(self.pubkey))) +# +# if signing_alg == signing.ALGORITHM_RSASSA_PKCS1v15: +# pkcs1_15.new(self.pubkey).verify(digest, signature) +# elif signing_alg == signing.ALGORITHM_RSASSA_PSS: +# pss.new(self.pubkey).verify(digest, signature) +# elif signing_alg == signing.ALGORITHM_ECDSA_MODE_FIPS_186_3: +# verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, +# encoding='der') +# verifier.verify(digest, signature) +# elif signing_alg == signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979: +# verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979, +# encoding='der') +# verifier.verify(digest, signature) +# else: +# self._tc.fail("Unsupported signing algorithm: {0}".format(signing_alg)) +# +# class PetApiTests(unittest.TestCase): +# +# @classmethod +# def setUpClass(cls): +# cls.setUpModels() +# cls.setUpFiles() +# +# @classmethod +# def tearDownClass(cls): +# file_paths = [ +# cls.rsa_key_path, +# cls.rsa4096_key_path, +# cls.ec_p521_key_path, +# ] +# for file_path in file_paths: +# os.unlink(file_path) +# +# @classmethod +# def setUpModels(cls): +# cls.category = category.Category() +# cls.category.id = id_gen() +# cls.category.name = "dog" +# cls.tag = tag.Tag() +# cls.tag.id = id_gen() +# cls.tag.name = "python-pet-tag" +# cls.pet = pet.Pet( +# name="hello kity", +# photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"] +# ) +# cls.pet.id = id_gen() +# cls.pet.status = "sold" +# cls.pet.category = cls.category +# cls.pet.tags = [cls.tag] +# +# @classmethod +# def setUpFiles(cls): +# cls.test_file_dir = os.path.join( +# os.path.dirname(__file__), "..", "testfiles") +# cls.test_file_dir = os.path.realpath(cls.test_file_dir) +# if not os.path.exists(cls.test_file_dir): +# os.mkdir(cls.test_file_dir) +# +# cls.private_key_passphrase = 'test-passphrase' +# cls.rsa_key_path = os.path.join(cls.test_file_dir, 'rsa.pem') +# cls.rsa4096_key_path = os.path.join(cls.test_file_dir, 'rsa4096.pem') +# cls.ec_p521_key_path = os.path.join(cls.test_file_dir, 'ecP521.pem') +# +# if not os.path.exists(cls.rsa_key_path): +# with open(cls.rsa_key_path, 'w') as f: +# f.write(RSA_TEST_PRIVATE_KEY) +# +# if not os.path.exists(cls.rsa4096_key_path): +# key = RSA.generate(4096) +# private_key = key.export_key( +# passphrase=cls.private_key_passphrase, +# protection='PEM' +# ) +# with open(cls.rsa4096_key_path, "wb") as f: +# f.write(private_key) +# +# if not os.path.exists(cls.ec_p521_key_path): +# key = ECC.generate(curve='P-521') +# private_key = key.export_key( +# format='PEM', +# passphrase=cls.private_key_passphrase, +# use_pkcs8=True, +# protection='PBKDF2WithHMAC-SHA1AndAES128-CBC' +# ) +# with open(cls.ec_p521_key_path, "wt") as f: +# f.write(private_key) +# +# def test_valid_http_signature(self): +# privkey_path = self.rsa_key_path +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=privkey_path, +# private_key_passphrase=self.private_key_passphrase, +# signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, +# signed_headers=[ +# signing.HEADER_REQUEST_TARGET, +# signing.HEADER_CREATED, +# signing.HEADER_HOST, +# signing.HEADER_DATE, +# signing.HEADER_DIGEST, +# 'Content-Type' +# ] +# ) +# config = Configuration(host=HOST, signing_info=signing_cfg) +# # Set the OAuth2 acces_token to None. Here we are interested in testing +# # the HTTP signature scheme. +# config.access_token = None +# +# api_client = petstore_api.ApiClient(config) +# pet_api = PetApi(api_client) +# +# mock_pool = MockPoolManager(self) +# api_client.rest_client.pool_manager = mock_pool +# +# mock_pool.set_signing_config(signing_cfg) +# mock_pool.expect_request('POST', HOST + '/pet', +# body=json.dumps(api_client.sanitize_for_serialization(self.pet)), +# headers={'Content-Type': r'application/json', +# 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' +# r'headers="\(request-target\) \(created\) host date digest content-type",' +# r'signature="[a-zA-Z0-9+/=]+"', +# 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, +# preload_content=True, timeout=None) +# +# pet_api.add_pet(self.pet) +# +# def test_valid_http_signature_with_defaults(self): +# privkey_path = self.rsa4096_key_path +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=privkey_path, +# private_key_passphrase=self.private_key_passphrase, +# ) +# config = Configuration(host=HOST, signing_info=signing_cfg) +# # Set the OAuth2 acces_token to None. Here we are interested in testing +# # the HTTP signature scheme. +# config.access_token = None +# +# api_client = petstore_api.ApiClient(config) +# pet_api = PetApi(api_client) +# +# mock_pool = MockPoolManager(self) +# api_client.rest_client.pool_manager = mock_pool +# +# mock_pool.set_signing_config(signing_cfg) +# mock_pool.expect_request('POST', HOST + '/pet', +# body=json.dumps(api_client.sanitize_for_serialization(self.pet)), +# headers={'Content-Type': r'application/json', +# 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' +# r'headers="\(created\)",' +# r'signature="[a-zA-Z0-9+/=]+"', +# 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, +# preload_content=True, timeout=None) +# +# pet_api.add_pet(self.pet) +# +# def test_valid_http_signature_rsassa_pkcs1v15(self): +# privkey_path = self.rsa4096_key_path +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=privkey_path, +# private_key_passphrase=self.private_key_passphrase, +# signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, +# signed_headers=[ +# signing.HEADER_REQUEST_TARGET, +# signing.HEADER_CREATED, +# ] +# ) +# config = Configuration(host=HOST, signing_info=signing_cfg) +# # Set the OAuth2 acces_token to None. Here we are interested in testing +# # the HTTP signature scheme. +# config.access_token = None +# +# api_client = petstore_api.ApiClient(config) +# pet_api = PetApi(api_client) +# +# mock_pool = MockPoolManager(self) +# api_client.rest_client.pool_manager = mock_pool +# +# mock_pool.set_signing_config(signing_cfg) +# mock_pool.expect_request('POST', HOST + '/pet', +# body=json.dumps(api_client.sanitize_for_serialization(self.pet)), +# headers={'Content-Type': r'application/json', +# 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' +# r'headers="\(request-target\) \(created\)",' +# r'signature="[a-zA-Z0-9+/=]+"', +# 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, +# preload_content=True, timeout=None) +# +# pet_api.add_pet(self.pet) +# +# def test_valid_http_signature_rsassa_pss(self): +# privkey_path = self.rsa4096_key_path +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=privkey_path, +# private_key_passphrase=self.private_key_passphrase, +# signing_algorithm=signing.ALGORITHM_RSASSA_PSS, +# signed_headers=[ +# signing.HEADER_REQUEST_TARGET, +# signing.HEADER_CREATED, +# ] +# ) +# config = Configuration(host=HOST, signing_info=signing_cfg) +# # Set the OAuth2 acces_token to None. Here we are interested in testing +# # the HTTP signature scheme. +# config.access_token = None +# +# api_client = petstore_api.ApiClient(config) +# pet_api = PetApi(api_client) +# +# mock_pool = MockPoolManager(self) +# api_client.rest_client.pool_manager = mock_pool +# +# mock_pool.set_signing_config(signing_cfg) +# mock_pool.expect_request('POST', HOST + '/pet', +# body=json.dumps(api_client.sanitize_for_serialization(self.pet)), +# headers={'Content-Type': r'application/json', +# 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' +# r'headers="\(request-target\) \(created\)",' +# r'signature="[a-zA-Z0-9+/=]+"', +# 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, +# preload_content=True, timeout=None) +# +# pet_api.add_pet(self.pet) +# +# def test_valid_http_signature_ec_p521(self): +# privkey_path = self.ec_p521_key_path +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=privkey_path, +# private_key_passphrase=self.private_key_passphrase, +# hash_algorithm=signing.HASH_SHA512, +# signed_headers=[ +# signing.HEADER_REQUEST_TARGET, +# signing.HEADER_CREATED, +# ] +# ) +# config = Configuration(host=HOST, signing_info=signing_cfg) +# # Set the OAuth2 acces_token to None. Here we are interested in testing +# # the HTTP signature scheme. +# config.access_token = None +# +# api_client = petstore_api.ApiClient(config) +# pet_api = PetApi(api_client) +# +# mock_pool = MockPoolManager(self) +# api_client.rest_client.pool_manager = mock_pool +# +# mock_pool.set_signing_config(signing_cfg) +# mock_pool.expect_request('POST', HOST + '/pet', +# body=json.dumps(api_client.sanitize_for_serialization(self.pet)), +# headers={'Content-Type': r'application/json', +# 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' +# r'headers="\(request-target\) \(created\)",' +# r'signature="[a-zA-Z0-9+/=]+"', +# 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, +# preload_content=True, timeout=None) +# +# pet_api.add_pet(self.pet) +# +# def test_invalid_configuration(self): +# # Signing scheme must be valid. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme='foo', +# private_key_path=self.ec_p521_key_path +# ) +# self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# # Signing scheme must be specified. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# private_key_path=self.ec_p521_key_path, +# signing_scheme=None +# ) +# self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# # Private key passphrase is missing but key is encrypted. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=self.ec_p521_key_path, +# ) +# self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# # File containing private key must exist. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path='foobar', +# ) +# self.assertTrue(re.match('Private key file does not exist', str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# # The max validity must be a positive value. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=self.ec_p521_key_path, +# signature_max_validity=timedelta(hours=-1) +# ) +# self.assertTrue(re.match('The signature max validity must be a positive value', +# str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# # Cannot include the 'Authorization' header. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=self.ec_p521_key_path, +# signed_headers=['Authorization'] +# ) +# self.assertTrue(re.match("'Authorization' header cannot be included", str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# +# # Cannot specify duplicate headers. +# with self.assertRaises(Exception) as cm: +# signing_cfg = signing.HttpSigningConfiguration( +# key_id="my-key-id", +# signing_scheme=signing.SCHEME_HS2019, +# private_key_path=self.ec_p521_key_path, +# signed_headers=['Host', 'Date', 'Host'] +# ) +# self.assertTrue(re.match('Cannot have duplicates in the signed_headers parameter', +# str(cm.exception)), +# 'Exception message: {0}'.format(str(cm.exception))) +# diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py new file mode 100644 index 00000000000..a5d92cd0833 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_integer_enum_one_value.py @@ -0,0 +1,55 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue + + +class TestIntegerEnumOneValue(unittest.TestCase): + """IntegerEnumOneValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegerEnumOneValue(self): + """Test IntegerEnumOneValue""" + + with self.assertRaises(TypeError): + """ + a value must be passed in + We cannot auto assign values because that would break composition if + received payloads included this with no inputs and we the 0 value to the data to the incoming payload + One is not allowed to mutate incoming payloads because then: + - order of composed schema ingestion matters + - one can have default value collisions + - the added data will make expected schemas not match payloads + """ + model = IntegerEnumOneValue() + + model = IntegerEnumOneValue(0) + assert model == 0, "We can also pass in the value as a positional arg" + + # one cannot pass the value with the value keyword + with self.assertRaises(TypeError): + model = IntegerEnumOneValue(value=0) + + # one can pass in the enum value + model = IntegerEnumOneValue(IntegerEnumOneValue.POSITIVE_0) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_json_encoder.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_json_encoder.py new file mode 100644 index 00000000000..45cce4c0f02 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_json_encoder.py @@ -0,0 +1,50 @@ +# 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 datetime import date +import unittest + +import petstore_api +from petstore_api import schemas +from petstore_api import api_client + + +class TestJSONEncoder(unittest.TestCase): + """Fruit unit test stubs""" + serializer = api_client.JSONEncoder() + + def test_receive_encode_str_types(self): + schema_to_value = { + schemas.StrSchema: 'hi', + schemas.DateSchema: '2021-05-09', + schemas.DateTimeSchema: '2020-01-01T00:00:00' + } + for schema, value in schema_to_value.items(): + inst = schema._from_openapi_data(value) + assert value == self.serializer.default(inst) + + def test_receive_encode_numeric_types(self): + value_to_schema = { + 1: schemas.IntSchema, + 1.0: schemas.Float32Schema, + 3.14: schemas.Float32Schema, + 4: schemas.NumberSchema, + 4.0: schemas.NumberSchema, + 7.14: schemas.NumberSchema, + } + for value, schema in value_to_schema.items(): + inst = schema._from_openapi_data(value) + pre_serialize_value = self.serializer.default(inst) + assert value == pre_serialize_value and type(value) == type(pre_serialize_value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py new file mode 100644 index 00000000000..9101280fc66 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_mammal.py @@ -0,0 +1,55 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.mammal import Mammal + + +class TestMammal(unittest.TestCase): + """Mammal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMammal(self): + """Test Mammal""" + + # tests that we can make a BasquePig by traveling through discriminator in Pig + m = Mammal(className="BasquePig") + from petstore_api.model import pig + from petstore_api.model import basque_pig + assert isinstance(m, Mammal) + assert isinstance(m, basque_pig.BasquePig) + assert isinstance(m, pig.Pig) + + # can make a Whale + m = Mammal(className="whale") + from petstore_api.model import whale + assert isinstance(m, whale.Whale) + + # can use the enum value + m = Mammal(className=whale.Whale.className.WHALE) + assert isinstance(m, whale.Whale) + + from petstore_api.model import zebra + m = Mammal(className='zebra') + assert isinstance(m, zebra.Zebra) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py new file mode 100644 index 00000000000..7aff4811327 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py @@ -0,0 +1,64 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.no_additional_properties import NoAdditionalProperties + + +class TestNoAdditionalProperties(unittest.TestCase): + """NoAdditionalProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNoAdditionalProperties(self): + """Test NoAdditionalProperties""" + + # works with only required + inst = NoAdditionalProperties(id=1) + + # works with required + optional + inst = NoAdditionalProperties(id=1, petId=2) + + # needs required + # TODO cast this to ApiTypeError? + with self.assertRaisesRegex( + TypeError, + r"missing 1 required keyword-only argument: 'id'" + ): + NoAdditionalProperties(petId=2) + + # may not be passed additional properties + # TODO cast this to ApiTypeError? + with self.assertRaisesRegex( + TypeError, + r"got an unexpected keyword argument 'invalidArg'" + ): + NoAdditionalProperties(id=2, invalidArg=2) + + # plural example + # TODO cast this to ApiTypeError? + with self.assertRaisesRegex( + TypeError, + r"got an unexpected keyword argument 'firstInvalidArg'" + ): + NoAdditionalProperties(id=2, firstInvalidArg=1, secondInvalidArg=1) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_nullable_string.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_nullable_string.py new file mode 100644 index 00000000000..2a704a70846 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_nullable_string.py @@ -0,0 +1,54 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.nullable_string import NullableString +from petstore_api.schemas import Schema, Singleton + + +class TestNullableString(unittest.TestCase): + """NullableString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNullableString(self): + """Test NullableString""" + inst = NullableString(None) + assert isinstance(inst, Singleton) + assert isinstance(inst, NullableString) + assert isinstance(inst, Schema) + assert inst.is_none() is True + + inst = NullableString('approved') + assert isinstance(inst, NullableString) + assert isinstance(inst, Schema) + assert isinstance(inst, str) + assert inst == 'approved' + + invalid_values = [1] + for invalid_value in invalid_values: + with self.assertRaisesRegex( + petstore_api.ApiTypeError, + r"Invalid type. Required value type is one of \[NoneType, str\] and passed type was Decimal at \['args\[0\]'\]" + ): + NullableString(invalid_value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py new file mode 100644 index 00000000000..5cf1dfaa9c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_number_with_validations.py @@ -0,0 +1,46 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.number_with_validations import NumberWithValidations + + +class TestNumberWithValidations(unittest.TestCase): + """NumberWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberWithValidations(self): + """Test NumberWithValidations""" + valid_values = [10.0, 15.0, 20.0] + for valid_value in valid_values: + model = NumberWithValidations(valid_value) + assert model == valid_value + + value_error_msg_pairs = ( + (9.0, r"Invalid value `9.0`, must be a value greater than or equal to `10` at \('args\[0\]',\)"), + (21.0, r"Invalid value `21.0`, must be a value less than or equal to `20` at \('args\[0\]',\)"), + ) + for invalid_value, error_msg in value_error_msg_pairs: + with self.assertRaisesRegex(petstore_api.ApiValueError, error_msg): + NumberWithValidations(invalid_value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py new file mode 100644 index 00000000000..64a6a4c898f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_model_with_ref_props.py @@ -0,0 +1,49 @@ +# 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 datetime import date, datetime +import sys +import unittest + +import petstore_api +from petstore_api.schemas import BoolClass, frozendict +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.number_with_validations import NumberWithValidations + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testObjectModelWithRefProps(self): + """Test ObjectModelWithRefProps""" + self.assertEqual(ObjectModelWithRefProps.myNumber, NumberWithValidations) + + inst = ObjectModelWithRefProps(myNumber=15.0, myString="a", myBoolean=True) + assert isinstance(inst, ObjectModelWithRefProps) + assert isinstance(inst, frozendict) + assert set(inst.keys()) == {"myNumber", "myString", "myBoolean"} + assert inst.myNumber == 15.0 + assert isinstance(inst.myNumber, NumberWithValidations) + assert inst.myString == 'a' + assert isinstance(inst.myString, ObjectModelWithRefProps.myString) + assert bool(inst.myBoolean) is True + assert isinstance(inst.myBoolean, ObjectModelWithRefProps.myBoolean) + assert isinstance(inst.myBoolean, BoolClass) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_difficultly_named_props.py new file mode 100644 index 00000000000..386304ecc67 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_difficultly_named_props.py @@ -0,0 +1,37 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps + + +class TestObjectWithDifficultlyNamedProps(unittest.TestCase): + """ObjectWithDifficultlyNamedProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectWithDifficultlyNamedProps(self): + """Test ObjectWithDifficultlyNamedProps""" + # FIXME: construct object with mandatory attributes with example values + # model = ObjectWithDifficultlyNamedProps() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_validations.py new file mode 100644 index 00000000000..3a443dfa39a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_object_with_validations.py @@ -0,0 +1,52 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.object_with_validations import ObjectWithValidations + + +class TestObjectWithValidations(unittest.TestCase): + """ObjectWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectWithValidations(self): + """Test ObjectWithValidations""" + + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Invalid value `frozendict.frozendict\({}\)`, number of properties must be greater than or equal to `2` at \('args\[0\]',\)" + ): + ObjectWithValidations({}) + + + with self.assertRaisesRegex( + petstore_api.ApiValueError, + r"Invalid value `frozendict.frozendict\({'a': 'a'}\)`, number of properties must be greater than or equal to `2` at \('args\[0\]',\)" + ): + # number of properties less than 2 fails + model = ObjectWithValidations(a='a') + + # 2 or more properties succeeds + model = ObjectWithValidations(a='a', b='b') + model = ObjectWithValidations(a='a', b='b', c='c') + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parameters.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parameters.py new file mode 100644 index 00000000000..49940bab902 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parameters.py @@ -0,0 +1,954 @@ +# 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 +""" +import unittest +import collections + +from petstore_api import api_client +from petstore_api import schemas + +ParamTestCase = collections.namedtuple('ParamTestCase', 'payload expected_serialization explode', defaults=[False]) + + +class TestParameter(unittest.TestCase): + in_type_to_parameter_cls = { + api_client.ParameterInType.PATH: api_client.PathParameter, + api_client.ParameterInType.QUERY: api_client.QueryParameter, + api_client.ParameterInType.COOKIE: api_client.CookieParameter, + api_client.ParameterInType.HEADER: api_client.HeaderParameter, + } + + def test_throws_exception_when_schema_and_content_omitted(self): + with self.assertRaises(ValueError): + api_client.QueryParameter( + name='' + ) + + def test_throws_exception_when_schema_and_content_input(self): + with self.assertRaises(ValueError): + schema = schemas.StrSchema + api_client.QueryParameter( + name='', + schema=schema, + content={'application/json': schema} + ) + + def test_succeeds_when_schema_or_content_input(self): + schema = schemas.StrSchema + api_client.QueryParameter( + name='', + schema=schema, + ) + api_client.QueryParameter( + name='', + content={'application/json': schema} + ) + + def test_succeeds_and_fails_for_style_and_in_type_combos(self): + style_to_in_type = { + api_client.ParameterStyle.MATRIX: {api_client.ParameterInType.PATH}, + api_client.ParameterStyle.LABEL: {api_client.ParameterInType.PATH}, + api_client.ParameterStyle.FORM: {api_client.ParameterInType.QUERY, api_client.ParameterInType.COOKIE}, + api_client.ParameterStyle.SIMPLE: {api_client.ParameterInType.PATH, api_client.ParameterInType.HEADER}, + api_client.ParameterStyle.SPACE_DELIMITED: {api_client.ParameterInType.QUERY}, + api_client.ParameterStyle.PIPE_DELIMITED: {api_client.ParameterInType.QUERY}, + api_client.ParameterStyle.DEEP_OBJECT: {api_client.ParameterInType.QUERY}, + } + schema = schemas.StrSchema + for style in style_to_in_type: + valid_in_types = style_to_in_type[style] + for valid_in_type in valid_in_types: + parameter_cls = self.in_type_to_parameter_cls[valid_in_type] + parameter_cls( + name='', + style=style, + schema=schema, + ) + invalid_in_types = {in_t for in_t in api_client.ParameterInType if in_t not in valid_in_types} + for invalid_in_type in invalid_in_types: + parameter_cls = self.in_type_to_parameter_cls[invalid_in_type] + with self.assertRaises(ValueError): + parameter_cls( + name='', + style=style, + schema=schema, + ) + + def test_throws_exception_when_invalid_name_input(self): + disallowed_names = {'Accept', 'Content-Type', 'Authorization'} + for disallowed_name in disallowed_names: + with self.assertRaises(ValueError): + api_client.HeaderParameter( + name=disallowed_name, + schema=schemas.StrSchema, + ) + + def test_query_style_form_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + () + ), + ParamTestCase( + 1, + (('color', '1'),) + ), + ParamTestCase( + 3.14, + (('color', '3.14'),) + ), + ParamTestCase( + 'blue', + (('color', 'blue'),) + ), + ParamTestCase( + 'hello world', + (('color', 'hello%20world'),) + ), + ParamTestCase( + '', + (('color', ''),) + ), + ParamTestCase( + True, + (('color', 'true'),) + ), + ParamTestCase( + False, + (('color', 'false'),) + ), + ParamTestCase( + [], + () + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'blue,black,brown'),) + ), + ParamTestCase( + ['blue', 'black', 'brown'], + ( + ('color', 'blue'), + ('color', 'black'), + ('color', 'brown'), + ), + explode=True + ), + ParamTestCase( + {}, + () + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R,100,G,200,B,150'),) + ), + ParamTestCase( + dict(R=100, G=200, B=150), + ( + ('R', '100'), + ('G', '200'), + ('B', '150'), + ), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.QueryParameter( + name=name, + style=api_client.ParameterStyle.FORM, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_cookie_style_form_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + () + ), + ParamTestCase( + 1, + (('color', '1'),) + ), + ParamTestCase( + 3.14, + (('color', '3.14'),) + ), + ParamTestCase( + 'blue', + (('color', 'blue'),) + ), + ParamTestCase( + 'hello world', + (('color', 'hello%20world'),) + ), + ParamTestCase( + '', + (('color', ''),) + ), + ParamTestCase( + True, + (('color', 'true'),) + ), + ParamTestCase( + False, + (('color', 'false'),) + ), + ParamTestCase( + [], + () + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'blue,black,brown'),) + ), + ParamTestCase( + ['blue', 'black', 'brown'], + ( + ('color', 'blue'), + ('color', 'black'), + ('color', 'brown'), + ), + explode=True + ), + ParamTestCase( + {}, + () + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R,100,G,200,B,150'),) + ), + ParamTestCase( + dict(R=100, G=200, B=150), + ( + ('R', '100'), + ('G', '200'), + ('B', '150'), + ), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.CookieParameter( + name=name, + style=api_client.ParameterStyle.FORM, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_style_simple_in_path_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + dict(color='') + ), + ParamTestCase( + 1, + dict(color='1') + ), + ParamTestCase( + 3.14, + dict(color='3.14') + ), + ParamTestCase( + 'blue', + dict(color='blue') + ), + ParamTestCase( + 'hello world', + dict(color='hello%20world') + ), + ParamTestCase( + '', + dict(color='') + ), + ParamTestCase( + True, + dict(color='true') + ), + ParamTestCase( + False, + dict(color='false') + ), + ParamTestCase( + [], + dict(color='') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='blue,black,brown') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='blue,black,brown'), + explode=True + ), + ParamTestCase( + {}, + dict(color='') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='R,100,G,200,B,150') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='R=100,G=200,B=150'), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.PathParameter( + name=name, + style=api_client.ParameterStyle.SIMPLE, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_style_simple_in_header_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + {} + ), + ParamTestCase( + 1, + dict(color='1') + ), + ParamTestCase( + 3.14, + dict(color='3.14') + ), + ParamTestCase( + 'blue', + dict(color='blue') + ), + ParamTestCase( + 'hello world', + dict(color='hello%20world') + ), + ParamTestCase( + '', + dict(color='') + ), + ParamTestCase( + True, + dict(color='true') + ), + ParamTestCase( + False, + dict(color='false') + ), + ParamTestCase( + [], + {} + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='blue,black,brown') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='blue,black,brown'), + explode=True + ), + ParamTestCase( + {}, + {} + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='R,100,G,200,B,150') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='R=100,G=200,B=150'), + explode=True + ), + ) + for test_case in test_cases: + print(test_case.payload) + parameter = api_client.HeaderParameter( + name=name, + style=api_client.ParameterStyle.SIMPLE, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_style_label_in_path_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + dict(color='') + ), + ParamTestCase( + 1, + dict(color='.1') + ), + ParamTestCase( + 3.14, + dict(color='.3.14') + ), + ParamTestCase( + 'blue', + dict(color='.blue') + ), + ParamTestCase( + 'hello world', + dict(color='.hello%20world') + ), + ParamTestCase( + '', + dict(color='.') + ), + ParamTestCase( + True, + dict(color='.true') + ), + ParamTestCase( + False, + dict(color='.false') + ), + ParamTestCase( + [], + dict(color='') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='.blue.black.brown') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='.blue.black.brown'), + explode=True + ), + ParamTestCase( + {}, + dict(color='') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='.R.100.G.200.B.150') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='.R=100.G=200.B=150'), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.PathParameter( + name=name, + style=api_client.ParameterStyle.LABEL, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_style_matrix_in_path_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + dict(color='') + ), + ParamTestCase( + 1, + dict(color=';color=1') + ), + ParamTestCase( + 3.14, + dict(color=';color=3.14') + ), + ParamTestCase( + 'blue', + dict(color=';color=blue') + ), + ParamTestCase( + 'hello world', + dict(color=';color=hello%20world') + ), + ParamTestCase( + '', + dict(color=';color') + ), + ParamTestCase( + True, + dict(color=';color=true') + ), + ParamTestCase( + False, + dict(color=';color=false') + ), + ParamTestCase( + [], + dict(color='') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color=';color=blue,black,brown') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color=';color=blue;color=black;color=brown'), + explode=True + ), + ParamTestCase( + {}, + dict(color='') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color=';color=R,100,G,200,B,150') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color=';R=100;G=200;B=150'), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.PathParameter( + name=name, + style=api_client.ParameterStyle.MATRIX, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_style_space_delimited_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + () + ), + ParamTestCase( + 1, + (('color', '1'),) + ), + ParamTestCase( + 3.14, + (('color', '3.14'),) + ), + ParamTestCase( + 'blue', + (('color', 'blue'),) + ), + ParamTestCase( + 'hello world', + (('color', 'hello%20world'),) + ), + ParamTestCase( + '', + (('color', ''),) + ), + ParamTestCase( + True, + (('color', 'true'),) + ), + ParamTestCase( + False, + (('color', 'false'),) + ), + ParamTestCase( + [], + () + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'blue%20black%20brown'),) + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'color=blue%20color=black%20color=brown'),), + explode=True + ), + ParamTestCase( + {}, + () + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R%20100%20G%20200%20B%20150'),) + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R=100%20G=200%20B=150'),), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.QueryParameter( + name=name, + style=api_client.ParameterStyle.SPACE_DELIMITED, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_style_pipe_delimited_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + () + ), + ParamTestCase( + 1, + (('color', '1'),) + ), + ParamTestCase( + 3.14, + (('color', '3.14'),) + ), + ParamTestCase( + 'blue', + (('color', 'blue'),) + ), + ParamTestCase( + 'hello world', + (('color', 'hello%20world'),) + ), + ParamTestCase( + '', + (('color', ''),) + ), + ParamTestCase( + True, + (('color', 'true'),) + ), + ParamTestCase( + False, + (('color', 'false'),) + ), + ParamTestCase( + [], + () + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'blue|black|brown'),) + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'color=blue|color=black|color=brown'),), + explode=True + ), + ParamTestCase( + {}, + () + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R|100|G|200|B|150'),) + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R=100|G=200|B=150'),), + explode=True + ), + ) + for test_case in test_cases: + parameter = api_client.QueryParameter( + name=name, + style=api_client.ParameterStyle.PIPE_DELIMITED, + schema=schemas.AnyTypeSchema, + explode=test_case.explode, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_path_params_no_style(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + dict(color='') + ), + ParamTestCase( + 1, + dict(color='1') + ), + ParamTestCase( + 3.14, + dict(color='3.14') + ), + ParamTestCase( + 'blue', + dict(color='blue') + ), + ParamTestCase( + 'hello world', + dict(color='hello%20world') + ), + ParamTestCase( + '', + dict(color='') + ), + ParamTestCase( + True, + dict(color='true') + ), + ParamTestCase( + False, + dict(color='false') + ), + ParamTestCase( + [], + dict(color='') + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='blue,black,brown') + ), + ParamTestCase( + {}, + dict(color='') + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='R,100,G,200,B,150') + ), + ) + for test_case in test_cases: + parameter = api_client.PathParameter( + name=name, + schema=schemas.AnyTypeSchema, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_header_params_no_style(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + {} + ), + ParamTestCase( + 1, + dict(color='1') + ), + ParamTestCase( + 3.14, + dict(color='3.14') + ), + ParamTestCase( + 'blue', + dict(color='blue') + ), + ParamTestCase( + 'hello world', + dict(color='hello%20world') + ), + ParamTestCase( + '', + dict(color='') + ), + ParamTestCase( + True, + dict(color='true') + ), + ParamTestCase( + False, + dict(color='false') + ), + ParamTestCase( + [], + {} + ), + ParamTestCase( + ['blue', 'black', 'brown'], + dict(color='blue,black,brown') + ), + ParamTestCase( + {}, + {} + ), + ParamTestCase( + dict(R=100, G=200, B=150), + dict(color='R,100,G,200,B,150') + ), + ) + for test_case in test_cases: + parameter = api_client.HeaderParameter( + name=name, + schema=schemas.AnyTypeSchema, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_query_or_cookie_params_no_style(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + () + ), + ParamTestCase( + 1, + (('color', '1'),) + ), + ParamTestCase( + 3.14, + (('color', '3.14'),) + ), + ParamTestCase( + 'blue', + (('color', 'blue'),) + ), + ParamTestCase( + 'hello world', + (('color', 'hello%20world'),) + ), + ParamTestCase( + '', + (('color', ''),) + ), + ParamTestCase( + True, + (('color', 'true'),) + ), + ParamTestCase( + False, + (('color', 'false'),) + ), + ParamTestCase( + [], + () + ), + ParamTestCase( + ['blue', 'black', 'brown'], + (('color', 'blue,black,brown'),) + ), + ParamTestCase( + {}, + () + ), + ParamTestCase( + dict(R=100, G=200, B=150), + (('color', 'R,100,G,200,B,150'),) + ), + ) + for in_type in {api_client.ParameterInType.QUERY, api_client.ParameterInType.COOKIE}: + for test_case in test_cases: + parameter_cls = self.in_type_to_parameter_cls[in_type] + parameter = parameter_cls( + name=name, + schema=schemas.AnyTypeSchema, + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_checks_content_lengths(self): + with self.assertRaises(ValueError): + api_client.QueryParameter( + name='', content={} + ) + with self.assertRaises(ValueError): + api_client.QueryParameter( + name='', + content={'application/json': schemas.AnyTypeSchema, 'text/plain': schemas.AnyTypeSchema} + ) + # valid length works + api_client.QueryParameter( + name='', + content={'application/json': schemas.AnyTypeSchema} + ) + + def test_content_json_serialization(self): + name = 'color' + test_cases = ( + ParamTestCase( + None, + {'color': 'null'} + ), + ParamTestCase( + 1, + {'color': '1'} + ), + ParamTestCase( + 3.14, + {'color': '3.14'} + ), + ParamTestCase( + 'blue', + {'color': '"blue"'} + ), + ParamTestCase( + 'hello world', + {'color': '"hello world"'} + ), + ParamTestCase( + '', + {'color': '""'} + ), + ParamTestCase( + True, + {'color': 'true'} + ), + ParamTestCase( + False, + {'color': 'false'} + ), + ParamTestCase( + [], + {'color': '[]'} + ), + ParamTestCase( + ['blue', 'black', 'brown'], + {'color': '["blue", "black", "brown"]'} + ), + ParamTestCase( + {}, + {'color': '{}'} + ), + ParamTestCase( + dict(R=100, G=200, B=150), + {'color': '{"R": 100, "G": 200, "B": 150}'} + ), + ) + for test_case in test_cases: + parameter = api_client.HeaderParameter( + name=name, + content={'application/json': schemas.AnyTypeSchema} + ) + serialization = parameter.serialize(test_case.payload) + self.assertEqual(serialization, test_case.expected_serialization) + + def test_throws_error_for_unimplemented_serialization(self): + with self.assertRaises(NotImplementedError): + parameter = api_client.HeaderParameter( + name='color', + content={'text/plain': schemas.AnyTypeSchema} + ) + parameter.serialize(None) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py new file mode 100644 index 00000000000..171310075ab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_parent_pet.py @@ -0,0 +1,42 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.grandparent_animal import GrandparentAnimal +from petstore_api.model.parent_pet import ParentPet + + +class TestParentPet(unittest.TestCase): + """ParentPet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testParentPet(self): + """Test ParentPet""" + + # 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 = ParentPet(pet_type="ParentPet") + assert isinstance(model, ParentPet) + assert isinstance(model, GrandparentAnimal) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py new file mode 100644 index 00000000000..dff97bc716a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_quadrilateral.py @@ -0,0 +1,40 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model import complex_quadrilateral +from petstore_api.model import simple_quadrilateral +from petstore_api.model.quadrilateral import Quadrilateral + + +class TestQuadrilateral(unittest.TestCase): + """Quadrilateral unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQuadrilateral(self): + """Test Quadrilateral""" + instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="ComplexQuadrilateral") + assert isinstance(instance, complex_quadrilateral.ComplexQuadrilateral) + instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="SimpleQuadrilateral") + assert isinstance(instance, simple_quadrilateral.SimpleQuadrilateral) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_request_body.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_request_body.py new file mode 100644 index 00000000000..88e9b67f691 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_request_body.py @@ -0,0 +1,147 @@ +# 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 +""" + +import collections +import json +import unittest + +from petstore_api import api_client, exceptions, schemas + +ParamTestCase = collections.namedtuple('ParamTestCase', 'payload expected_serialization') + + +class TestParameter(unittest.TestCase): + + def test_throws_exception_when_content_is_invalid_size(self): + with self.assertRaises(ValueError): + api_client.RequestBody( + content={} + ) + + def test_content_json_serialization(self): + payloads = [ + None, + 1, + 3.14, + 'blue', + 'hello world', + '', + True, + False, + [], + ['blue', 'black', 'brown'], + {}, + dict(R=100, G=200, B=150), + ] + for payload in payloads: + request_body = api_client.RequestBody( + content={'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema)} + ) + serialization = request_body.serialize(payload, 'application/json') + self.assertEqual( + serialization, + dict(body=json.dumps(payload, separators=(",", ":"), ensure_ascii=False).encode('utf-8')) + ) + + def test_content_multipart_form_data_serialization(self): + payload = dict( + some_null=None, + some_bool=True, + some_str='a', + some_int=1, + some_float=3.14, + some_list=[], + some_dict={}, + some_bytes=b'abc' + ) + request_body = api_client.RequestBody( + content={'multipart/form-data': api_client.MediaType(schema=schemas.AnyTypeSchema)} + ) + serialization = request_body.serialize(payload, 'multipart/form-data') + self.assertEqual( + serialization, + dict( + fields=( + api_client.RequestField( + name='some_null', data='null', headers={'Content-Type': 'application/json'}), + api_client.RequestField( + name='some_bool', data='true', headers={'Content-Type': 'application/json'}), + api_client.RequestField( + name='some_str', data='a', headers={'Content-Type': 'text/plain'}), + api_client.RequestField( + name='some_int', data='1', headers={'Content-Type': 'application/json'}), + api_client.RequestField( + name='some_float', data='3.14', headers={'Content-Type': 'application/json'}), + api_client.RequestField( + name='some_list', data='[]', headers={'Content-Type': 'application/json'}), + api_client.RequestField( + name='some_dict', data='{}', headers={'Content-Type': 'application/json'}), + api_client.RequestField( + name='some_bytes', data=b'abc', headers={'Content-Type': 'application/octet-stream'}) + ) + ) + ) + + def test_throws_error_for_nonexistant_content_type(self): + request_body = api_client.RequestBody( + content={'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema)} + ) + with self.assertRaises(KeyError): + request_body.serialize(None, 'abc/def') + + def test_throws_error_for_not_implemented_content_type(self): + request_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType(schema=schemas.AnyTypeSchema), + 'text/css': api_client.MediaType(schema=schemas.AnyTypeSchema) + } + ) + with self.assertRaises(NotImplementedError): + request_body.serialize(None, 'text/css') + + def test_application_x_www_form_urlencoded_serialization(self): + payload = dict( + some_null=None, + some_str='a', + some_int=1, + some_float=3.14, + some_list=[], + some_dict={}, + ) + content_type = 'application/x-www-form-urlencoded' + request_body = api_client.RequestBody( + content={content_type: api_client.MediaType(schema=schemas.AnyTypeSchema)} + ) + serialization = request_body.serialize(payload, content_type) + self.assertEqual( + serialization, + {'fields': (('some_str', 'a'), ('some_int', '1'), ('some_float', '3.14'))} + ) + + serialization = request_body.serialize({}, content_type) + self.assertEqual( + serialization, + {} + ) + + invalid_payloads = [ + dict(some_bool=True), + dict(some_bytes=b'abc'), + dict(some_list_with_data=[0]), + dict(some_dict_with_data={'a': 'b'}), + ] + for invalid_payload in invalid_payloads: + with self.assertRaises(exceptions.ApiValueError): + request_body.serialize(invalid_payload, content_type) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py new file mode 100644 index 00000000000..ce8906fdd13 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_shape.py @@ -0,0 +1,117 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.schemas import Singleton, frozendict +from petstore_api.model.shape import Shape +from petstore_api.model import quadrilateral +from petstore_api.model import complex_quadrilateral +from petstore_api.model import simple_quadrilateral +from petstore_api.model import triangle +from petstore_api.model import triangle_interface +from petstore_api.model import equilateral_triangle +from petstore_api.model import isosceles_triangle +from petstore_api.model import scalene_triangle + + +class TestShape(unittest.TestCase): + """Shape unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_recursionlimit(self): + """Test case for recursionlimit + + """ + assert sys.getrecursionlimit() == 1234 + + def testShape(self): + """Test Shape""" + + tri = Shape( + shapeType="Triangle", + triangleType="EquilateralTriangle" + ) + assert isinstance(tri, equilateral_triangle.EquilateralTriangle) + assert isinstance(tri, triangle.Triangle) + assert isinstance(tri, triangle_interface.TriangleInterface) + assert isinstance(tri, Shape) + assert isinstance(tri, frozendict) + assert isinstance(tri.shapeType, str) + assert isinstance(tri.shapeType, Singleton) + + tri = Shape( + shapeType="Triangle", + triangleType="IsoscelesTriangle" + ) + assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) + + tri = Shape( + shapeType="Triangle", + triangleType="ScaleneTriangle" + ) + assert isinstance(tri, scalene_triangle.ScaleneTriangle) + + quad = Shape( + shapeType="Quadrilateral", + quadrilateralType="ComplexQuadrilateral" + ) + assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) + + quad = Shape( + shapeType="Quadrilateral", + quadrilateralType="SimpleQuadrilateral" + ) + assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) + + # data missing + with self.assertRaisesRegex( + petstore_api.exceptions.ApiValueError, + r"Cannot deserialize input data due to missing discriminator. The discriminator " + r"property 'shapeType' is missing at path: \('args\[0\]',\)" + ): + Shape({}) + + # invalid shape_type (first discriminator). 'Circle' does not exist in the model. + err_msg = ( + r"Invalid discriminator value was passed in to Shape.shapeType Only the values " + r"\['Quadrilateral', 'Triangle'\] are allowed at \('args\[0\]', 'shapeType'\)" + ) + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg + ): + Shape(shapeType="Circle") + + # invalid quadrilateral_type (second discriminator) + err_msg = ( + r"Invalid discriminator value was passed in to Quadrilateral.quadrilateralType Only the values " + r"\['ComplexQuadrilateral', 'SimpleQuadrilateral'\] are allowed at \('args\[0\]', 'quadrilateralType'\)" + ) + with self.assertRaisesRegex( + petstore_api.ApiValueError, + err_msg + ): + Shape( + shapeType="Quadrilateral", + quadrilateralType="Triangle" + ) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py new file mode 100644 index 00000000000..efba299d9f3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_string_enum.py @@ -0,0 +1,56 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.string_enum import StringEnum +from petstore_api.schemas import Singleton, NoneClass + + +class TestStringEnum(unittest.TestCase): + """StringEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringEnum(self): + """Test StringEnum""" + inst = StringEnum(None) + assert isinstance(inst, StringEnum) + assert isinstance(inst, NoneClass) + + inst = StringEnum('approved') + assert isinstance(inst, StringEnum) + assert isinstance(inst, Singleton) + assert isinstance(inst, str) + assert inst == 'approved' + + with self.assertRaises(petstore_api.ApiValueError): + StringEnum('garbage') + + # make sure that we can access its allowed_values + assert isinstance(StringEnum.NONE, NoneClass) + assert StringEnum.PLACED == 'placed' + assert StringEnum.APPROVED == 'approved' + assert StringEnum.DELIVERED == 'delivered' + assert StringEnum.DOUBLE_QUOTE_WITH_NEWLINE == "double quote \n with newline" + assert StringEnum.MULTIPLE_LINES == "multiple\nlines" + assert StringEnum.SINGLE_QUOTED == "single quoted" + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py new file mode 100644 index 00000000000..286b5b0f9eb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_triangle.py @@ -0,0 +1,38 @@ +# 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 +""" + + +import unittest + +from petstore_api.model.equilateral_triangle import EquilateralTriangle +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.scalene_triangle import ScaleneTriangle +from petstore_api.model.triangle import Triangle +from petstore_api.model.triangle_interface import TriangleInterface +from petstore_api.schemas import frozendict + + +class TestTriangle(unittest.TestCase): + """Triangle unit test stubs""" + + def testTriangle(self): + """Test Triangle""" + tri_classes = [EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle] + for tri_class in tri_classes: + tri = Triangle(shapeType="Triangle", triangleType=tri_class.__name__) + assert isinstance(tri, tri_class) + assert isinstance(tri, Triangle) + assert isinstance(tri, TriangleInterface) + assert isinstance(tri, frozendict) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py new file mode 100644 index 00000000000..32a7f60d1ca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_validate.py @@ -0,0 +1,330 @@ +# coding: utf-8 + +from collections import defaultdict +from decimal import Decimal +import sys +import typing +from unittest.mock import patch +import unittest + +import petstore_api +from petstore_api.model.string_with_validation import StringWithValidation +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.array_holding_any_type import ArrayHoldingAnyType +from petstore_api.model.array_with_validations_in_items import ArrayWithValidationsInItems +from petstore_api.model.foo import Foo +from petstore_api.model.animal import Animal +from petstore_api.model.dog import Dog +from petstore_api.model.dog_all_of import DogAllOf +from petstore_api.model.boolean_enum import BooleanEnum +from petstore_api.model.pig import Pig +from petstore_api.model.danish_pig import DanishPig +from petstore_api.model.gm_fruit import GmFruit +from petstore_api.model.apple import Apple +from petstore_api.model.banana import Banana + +from petstore_api.schemas import ( + AnyTypeSchema, + StrSchema, + NumberSchema, + Schema, + InstantiationMetadata, + Int64Schema, + StrBase, + NumberBase, + DictBase, + ListBase, + frozendict, +) + +class TestValidateResults(unittest.TestCase): + + def test_str_validate(self): + im = InstantiationMetadata() + path_to_schemas = StringWithValidation._validate('abcdefg', _instantiation_metadata=im) + assert path_to_schemas == {('args[0]',): set([StringWithValidation, str])} + + def test_number_validate(self): + im = InstantiationMetadata() + path_to_schemas = NumberWithValidations._validate(Decimal(11), _instantiation_metadata=im) + assert path_to_schemas == {('args[0]',): set([NumberWithValidations, Decimal])} + + def test_str_enum_validate(self): + im = InstantiationMetadata() + path_to_schemas = StringEnum._validate('placed', _instantiation_metadata=im) + assert path_to_schemas == {('args[0]',): set([StringEnum])} + + def test_nullable_enum_validate(self): + im = InstantiationMetadata() + path_to_schemas = StringEnum._validate(None, _instantiation_metadata=im) + assert path_to_schemas == {('args[0]',): set([StringEnum])} + + def test_empty_list_validate(self): + im = InstantiationMetadata() + path_to_schemas = ArrayHoldingAnyType._validate((), _instantiation_metadata=im) + assert path_to_schemas == {('args[0]',): set([ArrayHoldingAnyType, tuple])} + + def test_list_validate(self): + im = InstantiationMetadata() + path_to_schemas = ArrayHoldingAnyType._validate((Decimal(1), 'a'), _instantiation_metadata=im) + assert path_to_schemas == { + ('args[0]',): set([ArrayHoldingAnyType, tuple]), + ('args[0]', 0): set([AnyTypeSchema, Decimal]), + ('args[0]', 1): set([AnyTypeSchema, str]) + } + + def test_empty_dict_validate(self): + im = InstantiationMetadata() + path_to_schemas = Foo._validate(frozendict({}), _instantiation_metadata=im) + assert path_to_schemas == {('args[0]',): set([Foo, frozendict])} + + def test_dict_validate(self): + im = InstantiationMetadata() + path_to_schemas = Foo._validate(frozendict({'bar': 'a', 'additional': Decimal(0)}), _instantiation_metadata=im) + assert path_to_schemas == { + ('args[0]',): set([Foo, frozendict]), + ('args[0]', 'bar'): set([StrSchema, str]), + ('args[0]', 'additional'): set([AnyTypeSchema, Decimal]) + } + + def test_discriminated_dict_validate(self): + im = InstantiationMetadata() + path_to_schemas = Animal._validate(frozendict(className='Dog', color='black'), _instantiation_metadata=im) + assert path_to_schemas == { + ('args[0]',): set([Animal, Dog, DogAllOf, frozendict]), + ('args[0]', 'className'): set([StrSchema, AnyTypeSchema, str]), + ('args[0]', 'color'): set([StrSchema, AnyTypeSchema, str]), + } + + def test_bool_enum_validate(self): + im = InstantiationMetadata() + path_to_schemas = BooleanEnum._validate(True, _instantiation_metadata=im) + assert path_to_schemas == { + ('args[0]',): set([BooleanEnum]) + } + + def test_oneof_composition_pig_validate(self): + im = InstantiationMetadata() + path_to_schemas = Pig._validate(frozendict(className='DanishPig'), _instantiation_metadata=im) + assert path_to_schemas == { + ('args[0]',): set([Pig, DanishPig, frozendict]), + ('args[0]', 'className'): set([DanishPig.className, AnyTypeSchema, str]), + } + + def test_anyof_composition_gm_fruit_validate(self): + im = InstantiationMetadata() + path_to_schemas = GmFruit._validate(frozendict(cultivar='GoldenDelicious', lengthCm=Decimal(10)), _instantiation_metadata=im) + assert path_to_schemas == { + ('args[0]',): set([GmFruit, Apple, Banana, frozendict]), + ('args[0]', 'cultivar'): set([Apple.cultivar, AnyTypeSchema, str]), + ('args[0]', 'lengthCm'): set([AnyTypeSchema, NumberSchema, Decimal]), + } + +class TestValidateCalls(unittest.TestCase): + def test_empty_list_validate(self): + return_value = {('args[0]',): set([ArrayHoldingAnyType, tuple])} + with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: + instance = ArrayHoldingAnyType([]) + assert mock_validate.call_count == 1 + + with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: + ArrayHoldingAnyType._from_openapi_data([]) + assert mock_validate.call_count == 1 + + def test_empty_dict_validate(self): + return_value = {('args[0]',): set([Foo, frozendict])} + with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: + instance = Foo({}) + assert mock_validate.call_count == 1 + + with patch.object(Schema, '_validate', return_value=return_value) as mock_validate: + Foo._from_openapi_data({}) + assert mock_validate.call_count == 1 + + def test_list_validate_direct_instantiation(self): + expected_call_by_index = { + 0: [ + ArrayWithValidationsInItems, + ((Decimal('7'),),), + InstantiationMetadata(path_to_item=('args[0]',)) + ], + 1: [ + ArrayWithValidationsInItems._items, + (Decimal('7'),), + InstantiationMetadata(path_to_item=('args[0]', 0)) + ] + } + call_index = 0 + result_by_call_index = { + 0: defaultdict(set, [( ('args[0]',), set([ArrayWithValidationsInItems, tuple]))] ), + 1: defaultdict(set, [( ('args[0]', 0), set([ArrayWithValidationsInItems._items, Decimal]) )] ), + } + + @classmethod + def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + nonlocal call_index + assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + result = result_by_call_index.get(call_index) + call_index += 1 + if result is None: + raise petstore_api.ApiValueError('boom') + return result + + with patch.object(Schema, '_validate', new=new_validate): + ArrayWithValidationsInItems([7]) + + def test_list_validate_direct_instantiation_cast_item(self): + # validation is skipped if items are of the correct type + expected_call_by_index = { + 0: [ + ArrayWithValidationsInItems, + ((Decimal('7'),),), + InstantiationMetadata(path_to_item=('args[0]',)) + ], + } + call_index = 0 + result_by_call_index = { + 0: defaultdict(set, [( ('args[0]',), set([ArrayWithValidationsInItems, tuple]))] ), + } + + @classmethod + def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + nonlocal call_index + assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + result = result_by_call_index.get(call_index) + call_index += 1 + if result is None: + raise petstore_api.ApiValueError('boom') + return result + + item = ArrayWithValidationsInItems._items(7) + with patch.object(Schema, '_validate', new=new_validate): + ArrayWithValidationsInItems([item]) + + def test_list_validate_from_openai_data_instantiation(self): + expected_call_by_index = { + 0: [ + ArrayWithValidationsInItems, + ((Decimal('7'),),), + InstantiationMetadata(path_to_item=('args[0]',), from_server=True) + ], + 1: [ + ArrayWithValidationsInItems._items, + (Decimal('7'),), + InstantiationMetadata(path_to_item=('args[0]', 0), from_server=True) + ] + } + call_index = 0 + result_by_call_index = { + 0: defaultdict(set, [( ('args[0]',), set([ArrayWithValidationsInItems, tuple]))] ), + 1: defaultdict(set, [( ('args[0]', 0), set([ArrayWithValidationsInItems._items, Decimal]) )] ), + } + + @classmethod + def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + nonlocal call_index + assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + result = result_by_call_index.get(call_index) + call_index += 1 + if result is None: + raise petstore_api.ApiValueError('boom') + return result + + with patch.object(Schema, '_validate', new=new_validate): + ArrayWithValidationsInItems._from_openapi_data([7]) + + def test_dict_validate_direct_instantiation(self): + expected_call_by_index = { + 0: [ + Foo, + (frozendict({'bar': 'a'}),), + InstantiationMetadata(path_to_item=('args[0]',)) + ], + 1: [ + StrSchema, + ('a',), + InstantiationMetadata(path_to_item=('args[0]', 'bar')) + ] + } + call_index = 0 + result_by_call_index = { + 0: defaultdict(set, [( ('args[0]',), set([Foo, frozendict]))] ), + 1: defaultdict(set, [( ('args[0]', 'bar'), set([StrSchema, str]) )] ), + } + + @classmethod + def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + nonlocal call_index + assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + result = result_by_call_index.get(call_index) + call_index += 1 + if result is None: + raise petstore_api.ApiValueError('boom') + return result + + with patch.object(Schema, '_validate', new=new_validate): + Foo(bar='a') + + def test_dict_validate_direct_instantiation_cast_item(self): + expected_call_by_index = { + 0: [ + Foo, + (frozendict({'bar': 'a'}),), + InstantiationMetadata(path_to_item=('args[0]',)) + ], + } + call_index = 0 + result_by_call_index = { + 0: defaultdict(set, [( ('args[0]',), set([Foo, frozendict]))] ), + } + + @classmethod + def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + nonlocal call_index + assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + result = result_by_call_index.get(call_index) + call_index += 1 + if result is None: + raise petstore_api.ApiValueError('boom') + return result + + bar = StrSchema('a') + with patch.object(Schema, '_validate', new=new_validate): + Foo(bar=bar) + + def test_dict_validate_from_openapi_data_instantiation(self): + expected_call_by_index = { + 0: [ + Foo, + (frozendict({'bar': 'a'}),), + InstantiationMetadata(path_to_item=('args[0]',), from_server=True) + ], + 1: [ + StrSchema, + ('a',), + InstantiationMetadata(path_to_item=('args[0]', 'bar'), from_server=True) + ] + } + call_index = 0 + result_by_call_index = { + 0: defaultdict(set, [( ('args[0]',), set([Foo, frozendict]))] ), + 1: defaultdict(set, [( ('args[0]', 'bar'), set([StrSchema, str]) )] ), + } + + @classmethod + def new_validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + nonlocal call_index + assert [cls, args, _instantiation_metadata] == expected_call_by_index[call_index] + result = result_by_call_index.get(call_index) + call_index += 1 + if result is None: + raise petstore_api.ApiValueError('boom') + return result + + with patch.object(Schema, '_validate', new=new_validate): + Foo._from_openapi_data({'bar': 'a'}) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_whale.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_whale.py new file mode 100644 index 00000000000..88bd8ed12d4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_whale.py @@ -0,0 +1,49 @@ +# 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.schemas import BoolClass +from petstore_api.model.whale import Whale + + +class TestWhale(unittest.TestCase): + """Whale unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Whale(self): + # test that the hasBaleen __bool__ method is working, True input + whale = Whale( + className='whale', + hasBaleen=True + ) + assert isinstance(whale.hasBaleen, BoolClass) + self.assertTrue(whale.hasBaleen) + + # test that the hasBaleen __bool__ method is working, False input + whale = Whale( + className='whale', + hasBaleen=False + ) + assert isinstance(whale.hasBaleen, BoolClass) + self.assertFalse(whale.hasBaleen) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/util.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/util.py new file mode 100644 index 00000000000..113d7dcc547 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini new file mode 100644 index 00000000000..8989fc3c4d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=petstore_api From 88f3db3a6e729d26bcd349f4c260dedd885e1f88 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 5 Jan 2022 13:05:18 -0800 Subject: [PATCH 012/113] Adds spacether sponsorship link and python-experimental item (#11237) --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 48bae346b51..e526479d127 100644 --- a/README.md +++ b/README.md @@ -853,10 +853,12 @@ OpenAPI Generator core team members are contributors who have been making signif * [@ackintosh](https://github.com/ackintosh) (2018/02) [:heart:](https://www.patreon.com/ackintosh/overview) * [@jmini](https://github.com/jmini) (2018/04) [:heart:](https://www.patreon.com/jmini) * [@etherealjoy](https://github.com/etherealjoy) (2019/06) -* [@spacether](https://github.com/spacether) (2020/05) +* [@spacether](https://github.com/spacether) (2020/05) [:heart:][spacether sponsorship] :heart: = Link to support the contributor directly +[spacether sponsorship]: https://github.com/sponsors/spacether/ + #### Template Creator **NOTE**: Embedded templates are only supported in _Mustache_ format. Support for all other formats is experimental and subject to change at any time. @@ -919,7 +921,8 @@ Here is a list of template creators: * PHP (with Data Transfer): @Articus * PowerShell: @beatcracker * PowerShell (refactored in 5.0.0): @wing328 - * Python: @spacether + * Python: @spacether [:heart:][spacether sponsorship] + * Python-Experimental: @spacether [:heart:][spacether sponsorship] * R: @ramnov * Ruby (Faraday): @meganemura @dkliban * Rust: @farcaller @@ -1068,7 +1071,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) | | PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) | | PowerShell | @wing328 (2020/05) | -| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) | +| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) [:heart:][spacether sponsorship] | | R | @Ramanth (2019/07) @saigiridhar21 (2019/07) | | Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) | | Rust | @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) | From e1902257b373f2deb9e6563b64532d9bd449dca6 Mon Sep 17 00:00:00 2001 From: jiangyuan <469391363@qq.com> Date: Thu, 6 Jan 2022 06:26:10 +0800 Subject: [PATCH 013/113] [Python] add '_spec_property_naming' param (#11226) * add '_spec_property_naming' param * add '_spec_property_naming' comment Co-authored-by: jiangyuan04 --- .../src/main/resources/python/api.mustache | 7 + .../main/resources/python/api_client.mustache | 6 +- .../petstore_api/api/another_fake_api.py | 7 + .../python/petstore_api/api/fake_api.py | 112 ++++++++++ .../api/fake_classname_tags_123_api.py | 7 + .../python/petstore_api/api/pet_api.py | 63 ++++++ .../python/petstore_api/api/store_api.py | 28 +++ .../python/petstore_api/api/user_api.py | 56 +++++ .../python/petstore_api/api_client.py | 6 +- .../petstore_api/api/another_fake_api.py | 7 + .../petstore_api/api/fake_api.py | 112 ++++++++++ .../api/fake_classname_tags_123_api.py | 7 + .../petstore_api/api/pet_api.py | 63 ++++++ .../petstore_api/api/store_api.py | 28 +++ .../petstore_api/api/user_api.py | 56 +++++ .../petstore_api/api_client.py | 6 +- .../python/x_auth_id_alias/api/usage_api.py | 28 +++ .../python/x_auth_id_alias/api_client.py | 6 +- .../python/dynamic_servers/api/usage_api.py | 14 ++ .../python/dynamic_servers/api_client.py | 6 +- .../petstore_api/api/another_fake_api.py | 7 + .../python/petstore_api/api/default_api.py | 7 + .../python/petstore_api/api/fake_api.py | 196 ++++++++++++++++++ .../api/fake_classname_tags_123_api.py | 7 + .../python/petstore_api/api/pet_api.py | 49 +++++ .../python/petstore_api/api/store_api.py | 28 +++ .../python/petstore_api/api/user_api.py | 56 +++++ .../python/petstore_api/api_client.py | 6 +- 28 files changed, 969 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index bba20b6210b..3406400b4b5 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -270,6 +270,10 @@ class {{classname}}(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -301,6 +305,9 @@ class {{classname}}(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index b083d401dd4..b4d1260eb74 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -694,7 +694,8 @@ class Endpoint(object): '_return_http_data_only', '_check_input_type', '_check_return_type', - '_content_type' + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -708,6 +709,7 @@ class Endpoint(object): '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,), + '_spec_property_naming': (bool,), '_content_type': (none_type, str) } self.openapi_types.update(extra_types) @@ -744,7 +746,7 @@ class Endpoint(object): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 1411f08cbc1..093a4ca6a33 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -119,6 +119,10 @@ class AnotherFakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -150,6 +154,9 @@ class AnotherFakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index a21d5838f41..f630549347f 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1132,6 +1132,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1163,6 +1167,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1199,6 +1206,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1230,6 +1241,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1268,6 +1282,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1299,6 +1317,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1337,6 +1358,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1368,6 +1393,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1404,6 +1432,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1435,6 +1467,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1471,6 +1506,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1502,6 +1541,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1538,6 +1580,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1569,6 +1615,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1607,6 +1656,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1638,6 +1691,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1679,6 +1735,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1710,6 +1770,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1752,6 +1815,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1783,6 +1850,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1831,6 +1901,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1862,6 +1936,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1926,6 +2003,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1957,6 +2038,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2008,6 +2092,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2039,6 +2127,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2084,6 +2175,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2115,6 +2210,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2158,6 +2256,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2189,6 +2291,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2230,6 +2335,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2261,6 +2370,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 76e35824fbe..70b4a535a81 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,10 @@ class FakeClassnameTags123Api(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -152,6 +156,9 @@ class FakeClassnameTags123Api(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 13fb1d981f4..290bf04cf1e 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -584,6 +584,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -615,6 +619,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -655,6 +662,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -686,6 +697,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -726,6 +740,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -757,6 +775,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -797,6 +818,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -828,6 +853,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -868,6 +896,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -899,6 +931,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -938,6 +973,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -969,6 +1008,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1010,6 +1052,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1041,6 +1087,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1083,6 +1132,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1114,6 +1167,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1156,6 +1212,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1187,6 +1247,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index 934c5525999..a1172b1f10e 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -265,6 +265,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -296,6 +300,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -333,6 +340,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -364,6 +375,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -402,6 +416,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -433,6 +451,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -472,6 +493,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -503,6 +528,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 78cc2f4a8b6..6eabc2a0a01 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -452,6 +452,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -483,6 +487,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -522,6 +529,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -553,6 +564,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -592,6 +606,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -623,6 +641,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -663,6 +684,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -694,6 +719,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -733,6 +761,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -764,6 +796,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -805,6 +840,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -836,6 +875,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -874,6 +916,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -905,6 +951,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -945,6 +994,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -976,6 +1029,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 7b4eea830ea..e750f965b22 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -673,7 +673,8 @@ class Endpoint(object): '_return_http_data_only', '_check_input_type', '_check_return_type', - '_content_type' + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -687,6 +688,7 @@ class Endpoint(object): '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,), + '_spec_property_naming': (bool,), '_content_type': (none_type, str) } self.openapi_types.update(extra_types) @@ -723,7 +725,7 @@ class Endpoint(object): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 1411f08cbc1..093a4ca6a33 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -119,6 +119,10 @@ class AnotherFakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -150,6 +154,9 @@ class AnotherFakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index a21d5838f41..f630549347f 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -1132,6 +1132,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1163,6 +1167,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1199,6 +1206,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1230,6 +1241,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1268,6 +1282,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1299,6 +1317,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1337,6 +1358,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1368,6 +1393,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1404,6 +1432,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1435,6 +1467,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1471,6 +1506,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1502,6 +1541,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1538,6 +1580,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1569,6 +1615,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1607,6 +1656,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1638,6 +1691,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1679,6 +1735,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1710,6 +1770,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1752,6 +1815,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1783,6 +1850,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1831,6 +1901,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1862,6 +1936,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1926,6 +2003,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1957,6 +2038,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2008,6 +2092,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2039,6 +2127,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2084,6 +2175,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2115,6 +2210,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2158,6 +2256,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2189,6 +2291,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2230,6 +2335,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2261,6 +2370,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py index 76e35824fbe..70b4a535a81 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,10 @@ class FakeClassnameTags123Api(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -152,6 +156,9 @@ class FakeClassnameTags123Api(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 13fb1d981f4..290bf04cf1e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -584,6 +584,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -615,6 +619,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -655,6 +662,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -686,6 +697,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -726,6 +740,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -757,6 +775,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -797,6 +818,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -828,6 +853,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -868,6 +896,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -899,6 +931,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -938,6 +973,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -969,6 +1008,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1010,6 +1052,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1041,6 +1087,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1083,6 +1132,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1114,6 +1167,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1156,6 +1212,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1187,6 +1247,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index 934c5525999..a1172b1f10e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -265,6 +265,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -296,6 +300,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -333,6 +340,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -364,6 +375,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -402,6 +416,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -433,6 +451,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -472,6 +493,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -503,6 +528,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 78cc2f4a8b6..6eabc2a0a01 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -452,6 +452,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -483,6 +487,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -522,6 +529,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -553,6 +564,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -592,6 +606,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -623,6 +641,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -663,6 +684,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -694,6 +719,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -733,6 +761,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -764,6 +796,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -805,6 +840,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -836,6 +875,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -874,6 +916,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -905,6 +951,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -945,6 +994,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -976,6 +1029,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index 7b4eea830ea..e750f965b22 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -673,7 +673,8 @@ class Endpoint(object): '_return_http_data_only', '_check_input_type', '_check_return_type', - '_content_type' + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -687,6 +688,7 @@ class Endpoint(object): '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,), + '_spec_property_naming': (bool,), '_content_type': (none_type, str) } self.openapi_types.update(extra_types) @@ -723,7 +725,7 @@ class Endpoint(object): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index b636697b0c4..9f3775456e0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -243,6 +243,10 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -274,6 +278,9 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -309,6 +316,10 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -340,6 +351,9 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -375,6 +389,10 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -406,6 +424,9 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -441,6 +462,10 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -472,6 +497,9 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index 0da46122279..d7137238a17 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -673,7 +673,8 @@ class Endpoint(object): '_return_http_data_only', '_check_input_type', '_check_return_type', - '_content_type' + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -687,6 +688,7 @@ class Endpoint(object): '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,), + '_spec_property_naming': (bool,), '_content_type': (none_type, str) } self.openapi_types.update(extra_types) @@ -723,7 +725,7 @@ class Endpoint(object): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index ec975f752c6..f71f533ceec 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -198,6 +198,10 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -229,6 +233,9 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -264,6 +271,10 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -295,6 +306,9 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index a7d12d3e3c1..470cc1aac89 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -673,7 +673,8 @@ class Endpoint(object): '_return_http_data_only', '_check_input_type', '_check_return_type', - '_content_type' + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -687,6 +688,7 @@ class Endpoint(object): '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,), + '_spec_property_naming': (bool,), '_content_type': (none_type, str) } self.openapi_types.update(extra_types) @@ -723,7 +725,7 @@ class Endpoint(object): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 52d1fc410d3..503decf303f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -119,6 +119,10 @@ class AnotherFakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -150,6 +154,9 @@ class AnotherFakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 26a35b8e65f..8ba49f05e76 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -107,6 +107,10 @@ class DefaultApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -138,6 +142,9 @@ class DefaultApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index dd2db14c8ad..9ebd02954cf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1720,6 +1720,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1751,6 +1755,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1787,6 +1794,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1818,6 +1829,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1853,6 +1867,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1884,6 +1902,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1920,6 +1941,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -1951,6 +1976,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -1987,6 +2015,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2018,6 +2050,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2055,6 +2090,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2086,6 +2125,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2123,6 +2165,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2154,6 +2200,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2188,6 +2237,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2219,6 +2272,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2257,6 +2313,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2288,6 +2348,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2326,6 +2389,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2357,6 +2424,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2393,6 +2463,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2424,6 +2498,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2459,6 +2536,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2490,6 +2571,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2525,6 +2609,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2556,6 +2644,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2592,6 +2683,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2623,6 +2718,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2659,6 +2757,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2690,6 +2792,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2728,6 +2833,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2759,6 +2868,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2800,6 +2912,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2831,6 +2947,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2873,6 +2992,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2904,6 +3027,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -2960,6 +3086,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -2991,6 +3121,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3042,6 +3175,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3073,6 +3210,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3118,6 +3258,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3149,6 +3293,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3192,6 +3339,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3223,6 +3374,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3264,6 +3418,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3295,6 +3453,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3345,6 +3506,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3376,6 +3541,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3421,6 +3589,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3452,6 +3624,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3489,6 +3664,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3520,6 +3699,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3560,6 +3742,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3591,6 +3777,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -3628,6 +3817,10 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -3659,6 +3852,9 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 0284c348b36..a6c187b0251 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,10 @@ class FakeClassnameTags123Api(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -152,6 +156,9 @@ class FakeClassnameTags123Api(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index d555b6995ad..2f87475abf7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -472,6 +472,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -503,6 +507,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -543,6 +550,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -574,6 +585,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -614,6 +628,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -645,6 +663,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -685,6 +706,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -716,6 +741,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -756,6 +784,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -787,6 +819,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -826,6 +861,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -857,6 +896,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -898,6 +940,10 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -929,6 +975,9 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index c1cb69094fe..f5f1d16cbee 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -267,6 +267,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -298,6 +302,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -335,6 +342,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -366,6 +377,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -404,6 +418,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -435,6 +453,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -474,6 +495,10 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -505,6 +530,9 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index da2217633ff..81bcdeb6d86 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -460,6 +460,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -491,6 +495,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -530,6 +537,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -561,6 +572,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -600,6 +614,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -631,6 +649,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -671,6 +692,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -702,6 +727,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -741,6 +769,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -772,6 +804,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -813,6 +848,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -844,6 +883,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -882,6 +924,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -913,6 +959,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') @@ -953,6 +1002,10 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. @@ -984,6 +1037,9 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 86cddf1a7b2..9fbac41d73a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -680,7 +680,8 @@ class Endpoint(object): '_return_http_data_only', '_check_input_type', '_check_return_type', - '_content_type' + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -694,6 +695,7 @@ class Endpoint(object): '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,), + '_spec_property_naming': (bool,), '_content_type': (none_type, str) } self.openapi_types.update(extra_types) @@ -730,7 +732,7 @@ class Endpoint(object): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) From ef882a4e6c6066007952de3bd7013f9940dc0de7 Mon Sep 17 00:00:00 2001 From: Andreas Allacher Date: Fri, 7 Jan 2022 02:07:09 +0100 Subject: [PATCH 014/113] Issue 11152: Allow guzzlehttp/psr7 ^1.7 or ^2.0 (#11240) --- .../openapi-generator/src/main/resources/php/composer.mustache | 2 +- samples/client/petstore/php/OpenAPIClient-php/composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/composer.mustache b/modules/openapi-generator/src/main/resources/php/composer.mustache index 6a69cead65d..e8c6f3bf10c 100644 --- a/modules/openapi-generator/src/main/resources/php/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php/composer.mustache @@ -29,7 +29,7 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0" + "guzzlehttp/psr7": "^1.7 || ^2.0" }, "require-dev": { "phpunit/phpunit": "^8.0 || ^9.0", diff --git a/samples/client/petstore/php/OpenAPIClient-php/composer.json b/samples/client/petstore/php/OpenAPIClient-php/composer.json index d884b222adb..2318059097f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/composer.json +++ b/samples/client/petstore/php/OpenAPIClient-php/composer.json @@ -23,7 +23,7 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0" + "guzzlehttp/psr7": "^1.7 || ^2.0" }, "require-dev": { "phpunit/phpunit": "^8.0 || ^9.0", From 13430247866cdb06ddedfb03ef02eebb1726fe78 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Thu, 6 Jan 2022 17:45:49 -0800 Subject: [PATCH 015/113] Adds fix for broken python test (#11247) * Adds fix for broken python test * Removes space * Fixes another test too --- samples/client/petstore/python/test/test_fake_api.py | 1 + .../test/test_fake_api.py | 1 + 2 files changed, 2 insertions(+) diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index c8345a8760a..d17375a994d 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -126,6 +126,7 @@ class TestFakeApi(unittest.TestCase): _preload_content=True, _request_timeout=None, _return_http_data_only=True, + _spec_property_naming=False, async_req=False, header_number=1.234, path_integer=34, diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index c8345a8760a..d17375a994d 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -126,6 +126,7 @@ class TestFakeApi(unittest.TestCase): _preload_content=True, _request_timeout=None, _return_http_data_only=True, + _spec_property_naming=False, async_req=False, header_number=1.234, path_integer=34, From febf49662a4d4fda5dbeed4888a1840db801177d Mon Sep 17 00:00:00 2001 From: Akira MATSUDA Date: Mon, 10 Jan 2022 00:47:03 +0900 Subject: [PATCH 016/113] Make moduleObject.mustache confirms to JSONEncodable. (#11202) * Make moduleObject.mustache confirms to JSONEncodable. * Regenerate samples * Don't confirm JSONEncodable when using Vapor. * Use CodableHelper.jsonEncoder * Encode `Data` using `encodeToJSON()` * Update sample * Don't extend JSONEncodable when using Vapor. * Add JSONEncodable in moduleEnum, moduleInlineEnumDeclaration, and modelOneOf * Update sample * Remove line break. * Update sample * Revert "Update sample" This reverts commit 6ec206b506a5402a225184bd8e80f5e654f426f8. * Don't confirm JSONEncodable when enum confirms RawRepresentable. * Update sample * Add space before { * Update sample * Don't confirm JSONEncodable when enum confirms RawRepresentable. --- .../main/resources/swift5/Extensions.mustache | 10 +++++ .../main/resources/swift5/modelEnum.mustache | 2 +- .../modelInlineEnumDeclaration.mustache | 2 +- .../resources/swift5/modelObject.mustache | 4 +- .../main/resources/swift5/modelOneOf.mustache | 2 +- .../src/test/resources/jsoncodable.yaml | 44 +++++++++++++++++++ .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesAnyType.swift | 2 +- .../Models/AdditionalPropertiesArray.swift | 2 +- .../Models/AdditionalPropertiesBoolean.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Models/AdditionalPropertiesInteger.swift | 2 +- .../Models/AdditionalPropertiesNumber.swift | 2 +- .../Models/AdditionalPropertiesObject.swift | 2 +- .../Models/AdditionalPropertiesString.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../Classes/OpenAPIs/Models/BigCat.swift | 2 +- .../Classes/OpenAPIs/Models/BigCatAllOf.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Models/XmlItem.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Classes/OpenAPIs/Models/Apple.swift | 2 +- .../Classes/OpenAPIs/Models/Banana.swift | 2 +- .../Classes/OpenAPIs/Models/Fruit.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Sources/PetstoreClient/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/CatAllOf.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/DogAllOf.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 2 +- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 2 +- .../Models/OuterComposite.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 2 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 10 +++++ .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- 521 files changed, 709 insertions(+), 505 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/jsoncodable.yaml diff --git a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache index eb3fd11eb8e..9411b9f9483 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache @@ -65,6 +65,16 @@ extension Date: JSONEncodable { func encodeToJSON() -> Any { return CodableHelper.dateFormatter.string(from: self) } +} + +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } }{{/useVapor}}{{#generateModelAdditionalProperties}} extension String: CodingKey { diff --git a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache index 2b28d7c0081..060a14ce74c 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache @@ -1,4 +1,4 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}, JSONEncodable{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} diff --git a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache index 445f5687388..27f1e51a979 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache @@ -1,4 +1,4 @@ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isContainer}}{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}, JSONEncodable{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/isContainer}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache index 713bc305495..a82cc1e8953 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache @@ -1,5 +1,5 @@ -{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { -{{/objcCompatible}}{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable { +{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable, JSONEncodable{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { +{{/objcCompatible}}{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable, JSONEncodable { {{/objcCompatible}} {{#allVars}} diff --git a/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache index 1c16a3955bc..277f6f26ab4 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache @@ -1,4 +1,4 @@ -public enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { +public enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable, JSONEncodable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { {{#oneOf}} case type{{.}}({{.}}) {{/oneOf}} diff --git a/modules/openapi-generator/src/test/resources/jsoncodable.yaml b/modules/openapi-generator/src/test/resources/jsoncodable.yaml new file mode 100644 index 00000000000..324b29c5c49 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/jsoncodable.yaml @@ -0,0 +1,44 @@ +openapi: 3.0.0 +info: + title: test + version: '1.0' +servers: + - url: 'http://localhost:3000' +paths: + /postModel: + post: + summary: Create New User + operationId: post-user + responses: + '200': + description: User Created + content: + application/json: + schema: + $ref: '#/components/schemas/User' + examples: {} + '400': + description: Missing Required Information + description: Create a new user. + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Request' + parameters: [] +components: + schemas: + User: + title: User + type: object + description: '' + x-examples: {} + properties: + integerValue: + type: integer + Request: + title: Request + type: object + properties: + user1: + $ref: '#/components/schemas/User' \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift index 07dd0c38a1f..71141047347 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesAnyType: Codable, Hashable { +public struct AdditionalPropertiesAnyType: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift index 43a6d66cb59..e6b88a3f1d2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesArray: Codable, Hashable { +public struct AdditionalPropertiesArray: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift index a2a20a926a1..a8b5930bdf2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesBoolean: Codable, Hashable { +public struct AdditionalPropertiesBoolean: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index eb6669c105a..674eec97cc4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapNumber: [String: Double]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift index 0ccd9115bfd..a6661e776dd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesInteger: Codable, Hashable { +public struct AdditionalPropertiesInteger: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift index 06987825557..676c6e7838d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesNumber: Codable, Hashable { +public struct AdditionalPropertiesNumber: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift index 848a0983a3f..7480c9a65b5 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesObject: Codable, Hashable { +public struct AdditionalPropertiesObject: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift index 7b5bd40f70f..3f35bbf770c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesString: Codable, Hashable { +public struct AdditionalPropertiesString: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift index 4ca3454f9bd..6a01769ede3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct BigCat: Codable, Hashable { +public struct BigCat: Codable, JSONEncodable, Hashable { public enum Kind: String, Codable, CaseIterable { case lions = "lions" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift index 8c6a92c8b48..24dcc39dfe2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct BigCatAllOf: Codable, Hashable { +public struct BigCatAllOf: Codable, JSONEncodable, Hashable { public enum Kind: String, Codable, CaseIterable { case lions = "lions" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index e880b792bbe..80ac2aeaf8b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 5dccf04e1e1..2892d53a3b6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33ce..a4ba4255e0c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: Int? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index f3a1bc92289..abd848e5836 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 23343c3c393..1a37683324d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift index ae43cd28692..84b13d99b5f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct XmlItem: Codable, Hashable { +public struct XmlItem: Codable, JSONEncodable, Hashable { public var attributeString: String? public var attributeNumber: Double? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ff77211ec29..d272a225436 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Describes the result of uploading an image resource */ -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 0036cc7a857..d92169c4bc5 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** A category for a pet */ -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ccd3bea0249..3471c82ef95 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -12,7 +12,7 @@ import AnyCodable /** An order for a pets from the pet store */ @available(*, deprecated, message: "This schema is deprecated.") -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 047967197a7..345cbbfa49f 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** A pet for sale in the pet store */ -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 555a33e6a18..c50903998f1 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** A tag for a pet */ -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 4d8eeffdbf8..f0b4a0d362a 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** A User who is purchasing from the pet store */ -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e41babad70f..6c945fc2047 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable, CaseIterableDefaultsLast { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 72eaac6069a..58c1b4665dd 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index fcae4e7e937..42728d2a308 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 57c1c4f866e..daaada5d4e8 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable, CaseIterableDefaultsLast { case placed = "placed" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a0e8a03c82b..04512ffe4ba 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable, CaseIterableDefaultsLast { case available = "available" diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 255ab49db7b..c2bbbb3af6b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 731b7b76eb6..da4e9163325 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct AdditionalPropertiesClass: Codable, Hashable { +internal struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { internal var mapString: [String: String]? internal var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index b160f8c835d..0ce2b123708 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Animal: Codable, Hashable { +internal struct Animal: Codable, JSONEncodable, Hashable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c62ce400c81..529c0085997 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct ApiResponse: Codable, Hashable { +internal struct ApiResponse: Codable, JSONEncodable, Hashable { internal var code: Int? internal var type: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 2fa5da894c4..671efcb4efe 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +internal struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { internal var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 4ad2ff35d21..82f41544ff1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct ArrayOfNumberOnly: Codable, Hashable { +internal struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { internal var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index e3464b693ec..79399389451 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct ArrayTest: Codable, Hashable { +internal struct ArrayTest: Codable, JSONEncodable, Hashable { internal var arrayOfString: [String]? internal var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 042f77b8ab8..d564608fe85 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Capitalization: Codable, Hashable { +internal struct Capitalization: Codable, JSONEncodable, Hashable { internal var smallCamel: String? internal var capitalCamel: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 4828c445c1b..63bff8570b8 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Cat: Codable, Hashable { +internal struct Cat: Codable, JSONEncodable, Hashable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 343d71d6873..9c7e6d829f2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct CatAllOf: Codable, Hashable { +internal struct CatAllOf: Codable, JSONEncodable, Hashable { internal var declawed: Bool? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index df67d9bd6f1..2edac90e1bc 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Category: Codable, Hashable { +internal struct Category: Codable, JSONEncodable, Hashable { internal var id: Int64? internal var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index d679cfe582a..966c60af5ab 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable, Hashable { +internal struct ClassModel: Codable, JSONEncodable, Hashable { internal var _class: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 2e50c580b65..1722e5aa961 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Client: Codable, Hashable { +internal struct Client: Codable, JSONEncodable, Hashable { internal var client: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index cdf48f3a786..b8ab3168267 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Dog: Codable, Hashable { +internal struct Dog: Codable, JSONEncodable, Hashable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index f2e801a399e..ace1ac3eab4 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct DogAllOf: Codable, Hashable { +internal struct DogAllOf: Codable, JSONEncodable, Hashable { internal var breed: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 950a66d752a..cf7484732ca 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct EnumArrays: Codable, Hashable { +internal struct EnumArrays: Codable, JSONEncodable, Hashable { internal enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 77419816570..e82207bd88b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct EnumTest: Codable, Hashable { +internal struct EnumTest: Codable, JSONEncodable, Hashable { internal enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 14b22772e3f..b39148dbd2f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -internal struct File: Codable, Hashable { +internal struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ internal var sourceURI: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e0f8e9990a5..2b5d09df619 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct FileSchemaTestClass: Codable, Hashable { +internal struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { internal var file: File? internal var files: [File]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 6f8b00eddf8..87dd9fb1c4d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct FormatTest: Codable, Hashable { +internal struct FormatTest: Codable, JSONEncodable, Hashable { internal var integer: Int? internal var int32: Int? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 0ddedc17958..d446fea284f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct HasOnlyReadOnly: Codable, Hashable { +internal struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { internal var bar: String? internal var foo: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 0e7903fd06a..4b88251418c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct List: Codable, Hashable { +internal struct List: Codable, JSONEncodable, Hashable { internal var _123list: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 748bc6781a5..32e525f8131 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct MapTest: Codable, Hashable { +internal struct MapTest: Codable, JSONEncodable, Hashable { internal enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 68ef87daf00..e2f30699895 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { internal var uuid: UUID? internal var dateTime: Date? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index dad6079ddb2..f7de4ac565e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -internal struct Model200Response: Codable, Hashable { +internal struct Model200Response: Codable, JSONEncodable, Hashable { internal var name: Int? internal var _class: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 59807f76209..c5f81444e45 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -internal struct Name: Codable, Hashable { +internal struct Name: Codable, JSONEncodable, Hashable { internal var name: Int internal var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 36cf8d164bd..11ae4447f99 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct NumberOnly: Codable, Hashable { +internal struct NumberOnly: Codable, JSONEncodable, Hashable { internal var justNumber: Double? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 45046f9a00f..72bdd4d71b4 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Order: Codable, Hashable { +internal struct Order: Codable, JSONEncodable, Hashable { internal enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 082cdebd26c..225f0c77787 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct OuterComposite: Codable, Hashable { +internal struct OuterComposite: Codable, JSONEncodable, Hashable { internal var myNumber: Double? internal var myString: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ca9db44f248..bb526c4dba2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Pet: Codable, Hashable { +internal struct Pet: Codable, JSONEncodable, Hashable { internal enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index e8961d9d8a8..9a37d814952 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct ReadOnlyFirst: Codable, Hashable { +internal struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { internal var bar: String? internal var baz: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7a2e2da47f8..f3a0c0a5564 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -internal struct Return: Codable, Hashable { +internal struct Return: Codable, JSONEncodable, Hashable { internal var _return: Int? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 2c3d25c5bbb..0ff74e0c2db 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct SpecialModelName: Codable, Hashable { +internal struct SpecialModelName: Codable, JSONEncodable, Hashable { internal var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 4b76e50cece..9cba9f30094 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct StringBooleanMap: Codable, Hashable { +internal struct StringBooleanMap: Codable, JSONEncodable, Hashable { internal enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 810603ff0b5..b765ab745f2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct Tag: Codable, Hashable { +internal struct Tag: Codable, JSONEncodable, Hashable { internal var id: Int64? internal var name: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 4a71a601e1b..9d14f7189f2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct TypeHolderDefault: Codable, Hashable { +internal struct TypeHolderDefault: Codable, JSONEncodable, Hashable { internal var stringItem: String = "what" internal var numberItem: Double diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 71cdf9ee1ea..82b087cf7d9 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct TypeHolderExample: Codable, Hashable { +internal struct TypeHolderExample: Codable, JSONEncodable, Hashable { internal var stringItem: String internal var numberItem: Double diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 57017c341e7..3430a514b91 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -internal struct User: Codable, Hashable { +internal struct User: Codable, JSONEncodable, Hashable { internal var id: Int64? internal var username: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1421cb642ee..7719c8969ea 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class AdditionalPropertiesClass: NSObject, Codable { +@objc public class AdditionalPropertiesClass: NSObject, Codable, JSONEncodable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index d60621e7bf6..da38f5b0da4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Animal: NSObject, Codable { +@objc public class Animal: NSObject, Codable, JSONEncodable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 1b42b26535c..37145a77416 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class ApiResponse: NSObject, Codable { +@objc public class ApiResponse: NSObject, Codable, JSONEncodable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 08aca8598d0..060c953f61a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { +@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable, JSONEncodable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e8114a8f45e..6c038d5f130 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class ArrayOfNumberOnly: NSObject, Codable { +@objc public class ArrayOfNumberOnly: NSObject, Codable, JSONEncodable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index be0dea61b91..e2d31205744 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class ArrayTest: NSObject, Codable { +@objc public class ArrayTest: NSObject, Codable, JSONEncodable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 6f137adc91f..2bb646fafaf 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Capitalization: NSObject, Codable { +@objc public class Capitalization: NSObject, Codable, JSONEncodable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 60eccac9412..3b2bcc29f69 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Cat: NSObject, Codable { +@objc public class Cat: NSObject, Codable, JSONEncodable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index cce886558e8..44bfb91f2d2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class CatAllOf: NSObject, Codable { +@objc public class CatAllOf: NSObject, Codable, JSONEncodable { public var declawed: Bool? public var declawedNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index c8e542ad6b5..193628d78fb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Category: NSObject, Codable { +@objc public class Category: NSObject, Codable, JSONEncodable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 6bc90a989bd..05ad9f6e929 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -@objc public class ClassModel: NSObject, Codable { +@objc public class ClassModel: NSObject, Codable, JSONEncodable { public var _class: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index a3585de4f0d..16accb0036f 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Client: NSObject, Codable { +@objc public class Client: NSObject, Codable, JSONEncodable { public var client: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 2b060c8ad38..8e3e5825e7c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Dog: NSObject, Codable { +@objc public class Dog: NSObject, Codable, JSONEncodable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index d92db038ca4..92476d0c42a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class DogAllOf: NSObject, Codable { +@objc public class DogAllOf: NSObject, Codable, JSONEncodable { public var breed: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1269cb72e27..937f2d445af 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class EnumArrays: NSObject, Codable { +@objc public class EnumArrays: NSObject, Codable, JSONEncodable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 066d266386b..aff4dfcee01 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class EnumTest: NSObject, Codable { +@objc public class EnumTest: NSObject, Codable, JSONEncodable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index b175f6370d2..fb8b728d3be 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -@objc public class File: NSObject, Codable { +@objc public class File: NSObject, Codable, JSONEncodable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 24a6e66432b..d29b62fe76d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class FileSchemaTestClass: NSObject, Codable { +@objc public class FileSchemaTestClass: NSObject, Codable, JSONEncodable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 413656ff25e..d4ba9d436bb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class FormatTest: NSObject, Codable { +@objc public class FormatTest: NSObject, Codable, JSONEncodable { public var integer: Int? public var integerNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index eac4a144616..ba7da0978e1 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class HasOnlyReadOnly: NSObject, Codable { +@objc public class HasOnlyReadOnly: NSObject, Codable, JSONEncodable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index f48559c0c45..bb1d3f7347a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class List: NSObject, Codable { +@objc public class List: NSObject, Codable, JSONEncodable { public var _123list: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 68a3e128cc2..401cfdc61bf 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class MapTest: NSObject, Codable { +@objc public class MapTest: NSObject, Codable, JSONEncodable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 1594ac4a26a..c98d6c09be6 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { +@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable, JSONEncodable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index dfae9880b13..6469aa6217a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -@objc public class Model200Response: NSObject, Codable { +@objc public class Model200Response: NSObject, Codable, JSONEncodable { public var name: Int? public var nameNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index e1fed77c4a9..3f96e8c58f5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -@objc public class Name: NSObject, Codable { +@objc public class Name: NSObject, Codable, JSONEncodable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index b828f6d3b47..646a33e63ae 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class NumberOnly: NSObject, Codable { +@objc public class NumberOnly: NSObject, Codable, JSONEncodable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 27237e43da7..ccdd4da20c3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Order: NSObject, Codable { +@objc public class Order: NSObject, Codable, JSONEncodable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index bbc4536d428..9300269b2a4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class OuterComposite: NSObject, Codable { +@objc public class OuterComposite: NSObject, Codable, JSONEncodable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index d4d38218ecd..abd31c6042b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Pet: NSObject, Codable { +@objc public class Pet: NSObject, Codable, JSONEncodable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 8aef5456332..056dfa5e970 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class ReadOnlyFirst: NSObject, Codable { +@objc public class ReadOnlyFirst: NSObject, Codable, JSONEncodable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index f497fdc7e09..49942cb402b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -@objc public class Return: NSObject, Codable { +@objc public class Return: NSObject, Codable, JSONEncodable { public var _return: Int? public var _returnNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 8a5860ae0b9..a75d92608fa 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class SpecialModelName: NSObject, Codable { +@objc public class SpecialModelName: NSObject, Codable, JSONEncodable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 4708c93daa0..29d7afe6a68 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class StringBooleanMap: NSObject, Codable { +@objc public class StringBooleanMap: NSObject, Codable, JSONEncodable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 6150ef4895f..5c7181fff98 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class Tag: NSObject, Codable { +@objc public class Tag: NSObject, Codable, JSONEncodable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 27408db6f27..7606991fa33 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class TypeHolderDefault: NSObject, Codable { +@objc public class TypeHolderDefault: NSObject, Codable, JSONEncodable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 61c7c8b4fb4..9f272d040fb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class TypeHolderExample: NSObject, Codable { +@objc public class TypeHolderExample: NSObject, Codable, JSONEncodable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 3c71f76aab0..b2444a4c7af 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -@objc public class User: NSObject, Codable { +@objc public class User: NSObject, Codable, JSONEncodable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift index ee0b5786ef1..897f9223084 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Apple: Codable, Hashable { +public struct Apple: Codable, JSONEncodable, Hashable { public var kind: String? diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift index 1ad6e976a7e..9173607e0b5 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Banana: Codable, Hashable { +public struct Banana: Codable, JSONEncodable, Hashable { public var count: Double? diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift index c249774d2a2..76f10ba92e7 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public enum Fruit: Codable, Hashable { +public enum Fruit: Codable, JSONEncodable, Hashable { case typeApple(Apple) case typeBanana(Banana) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index cc93d4c30d3..152de64ee6e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -66,6 +66,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 34f35d9b4c9..fa46ae0b457 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public private(set) var mapString: [String: String]? public private(set) var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 14bb2bd2fe0..0cff33a9e4d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index acaac402ef4..05b7a1702f2 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public private(set) var code: Int? public private(set) var type: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index d8ef19116b8..d386237437c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public private(set) var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 949077533e9..53892ad173b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public private(set) var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 6135c1556a2..0df050c0c7f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public private(set) var arrayOfString: [String]? public private(set) var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 6353bd4d8a8..ce9ccf6e82d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public private(set) var smallCamel: String? public private(set) var capitalCamel: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 834c51d9152..bd99d8d4388 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index b227089dc4f..26d078c63b0 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public private(set) var declawed: Bool? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 1413c58141e..1b25bb68206 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public private(set) var id: Int64? public private(set) var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 73b8414f342..d2bf98371fb 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public private(set) var _class: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 364b58f1c4e..073a19f5138 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public private(set) var client: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 849fbfed745..7765adb807e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 527edd845c4..00536fafe47 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public private(set) var breed: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1a79ffe95b1..de3154323f3 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index c097933904b..6d471e606dc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift index c5ebbaf2f4f..8e9d198ac24 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public private(set) var sourceURI: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index c04b1dccf76..a66a9b98daf 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public private(set) var file: File? public private(set) var files: [File]? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 65bb0ca0842..3bc18bc2979 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public private(set) var integer: Int? public private(set) var int32: Int? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index e8216047d6e..638236127d1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public private(set) var bar: String? public private(set) var foo: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 1269b40251d..0f84dfd4264 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public private(set) var _123list: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 19f258d2929..665fe0315a8 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2dd49ab0212..b0342881fd0 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public private(set) var uuid: UUID? public private(set) var dateTime: Date? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 9080e5c382f..a76505ff962 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public private(set) var name: Int? public private(set) var _class: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index cf7c0094910..afa3c0c1f85 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public private(set) var name: Int public private(set) var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 36be35a0533..74a00b38442 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public private(set) var justNumber: Double? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index bda67408a9d..2a13d969388 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index d8e7469f99a..2e191a0964c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public private(set) var myNumber: Double? public private(set) var myString: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 5ba4da07a5c..51c76357284 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 6b80302150a..b0ad79f0a72 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public private(set) var bar: String? public private(set) var baz: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index ca4883d9251..99b9adfda10 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public private(set) var _return: Int? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 66b8f4d69ff..a8d327a5d90 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public private(set) var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 11a5a854895..989685c535e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 2af3e2f0698..804f73c2ca6 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public private(set) var id: Int64? public private(set) var name: String? diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 125a63b0ed3..80da349b93c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public private(set) var stringItem: String = "what" public private(set) var numberItem: Double diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 3aa1851a585..eba6a29c27c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public private(set) var stringItem: String public private(set) var numberItem: Double diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 4af156b9bac..370047ceea5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public private(set) var id: Int64? public private(set) var username: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 16e69e560bd..a0419d54f15 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 23402143f71..d5ab7e422f2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afc2b51f8f3..9429b341fa9 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 126c35c85a6..548b82c049e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 570ea5f64bd..0b074d6d070 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return (200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 621afb93561..623c4c7fd2c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable, Hashable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index cdd4f5335b9..a6882d6517f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable, Hashable { +public struct Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index c365505ab9d..1890fcf9fde 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable, Hashable { +public struct ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 226f7456181..eabae42d3bf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 39831127871..fa93d7c6c74 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable, Hashable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8865d76bef2..c99f82be9b9 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable, Hashable { +public struct ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 71cd93bce5f..f8a3f64e2ee 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable, Hashable { +public struct Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 457e04bd475..253bbd7c04c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable, Hashable { +public struct Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8caebb1c206..681bcada15f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable, Hashable { +public struct CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 6a72957b687..f75fe8ac331 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable, Hashable { +public struct ClassModel: Codable, JSONEncodable, Hashable { public var `class`: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 60dbc5dc5c1..21a539ba010 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable, Hashable { +public struct Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 658732a7f36..dc3bb465a5f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable, Hashable { +public struct Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 82b0dedf35b..627bb997c5e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable, Hashable { +public struct DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1d8ce99539c..e06009060c5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable, Hashable { +public struct EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 8c8bca49774..3a9edb08ea7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable, Hashable { +public struct EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 05dd5b1a825..1378b4f9b20 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable, Hashable { +public struct File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 3ca66a31359..f9a39d2e58e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable, Hashable { +public struct FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index a7a4b39e720..0a329955482 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable, Hashable { +public struct FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 54ed8a723c6..9e2fe8cc87f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable, Hashable { +public struct HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 67e3048469f..b9a06034e01 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable, Hashable { +public struct List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 1e728fcdf58..c4792800425 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable, Hashable { +public struct MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c79ca459217..c15921ae6c7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7d15d45c21a..b1b3712eac3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable, Hashable { +public struct Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var `class`: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8698915e5ef..e8a19ee3d99 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable, Hashable { +public struct Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 87ceb64bb97..10fd059c856 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable, Hashable { +public struct NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index e2eeced4c57..bf7da6a3f86 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable, Hashable { +public struct Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index edeaccaeaa6..99568c8facf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable, Hashable { +public struct OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 57ba3f577c8..05cf40bedd3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable, Hashable { +public struct ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index bda0c791d83..4886c9a8ac2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable, Hashable { +public struct Return: Codable, JSONEncodable, Hashable { public var `return`: Int? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index bfe9723f888..543f1fa5ad4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable, Hashable { +public struct SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 2edf881a8f0..9c40477ece7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable, Hashable { +public struct StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e58eecd960f..9a7d7e6c8e6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable, Hashable { +public struct TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 6c22fdbae7a..dd67ca7851d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable, Hashable { +public struct TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7afe359ae40..e55b50dc4f7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable, Hashable { +public struct User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index e0ae7a60472..bbe32fd2015 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -15,7 +15,7 @@ public typealias AdditionalPropertiesClass = PetstoreClientAPI.AdditionalPropert extension PetstoreClientAPI { -public final class AdditionalPropertiesClass: Codable, Hashable { +public final class AdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift index 48bce08faa0..d61432435c6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -15,7 +15,7 @@ public typealias Animal = PetstoreClientAPI.Animal extension PetstoreClientAPI { -public final class Animal: Codable, Hashable { +public final class Animal: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index 3ba139fd803..a42b0caadde 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -15,7 +15,7 @@ public typealias ApiResponse = PetstoreClientAPI.ApiResponse extension PetstoreClientAPI { -public final class ApiResponse: Codable, Hashable { +public final class ApiResponse: Codable, JSONEncodable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 14f26778b17..a7860c6b8aa 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,7 +15,7 @@ public typealias ArrayOfArrayOfNumberOnly = PetstoreClientAPI.ArrayOfArrayOfNumb extension PetstoreClientAPI { -public final class ArrayOfArrayOfNumberOnly: Codable, Hashable { +public final class ArrayOfArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index 8eb085e6b55..2c5a2dc4890 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -15,7 +15,7 @@ public typealias ArrayOfNumberOnly = PetstoreClientAPI.ArrayOfNumberOnly extension PetstoreClientAPI { -public final class ArrayOfNumberOnly: Codable, Hashable { +public final class ArrayOfNumberOnly: Codable, JSONEncodable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index aade19d76db..94b6a87508a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -15,7 +15,7 @@ public typealias ArrayTest = PetstoreClientAPI.ArrayTest extension PetstoreClientAPI { -public final class ArrayTest: Codable, Hashable { +public final class ArrayTest: Codable, JSONEncodable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift index 22f31556b1d..a0a2e2b7ed2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -15,7 +15,7 @@ public typealias Capitalization = PetstoreClientAPI.Capitalization extension PetstoreClientAPI { -public final class Capitalization: Codable, Hashable { +public final class Capitalization: Codable, JSONEncodable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift index d7388043fef..006b34e4510 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -15,7 +15,7 @@ public typealias Cat = PetstoreClientAPI.Cat extension PetstoreClientAPI { -public final class Cat: Codable, Hashable { +public final class Cat: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift index 9a37243f5d1..b92fe697f1c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift @@ -15,7 +15,7 @@ public typealias CatAllOf = PetstoreClientAPI.CatAllOf extension PetstoreClientAPI { -public final class CatAllOf: Codable, Hashable { +public final class CatAllOf: Codable, JSONEncodable, Hashable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift index 743b83ae821..90eec24e2a6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift @@ -15,7 +15,7 @@ public typealias Category = PetstoreClientAPI.Category extension PetstoreClientAPI { -public final class Category: Codable, Hashable { +public final class Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift index a089549ef8d..411d00c8849 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -16,7 +16,7 @@ public typealias ClassModel = PetstoreClientAPI.ClassModel extension PetstoreClientAPI { /** Model for testing model with \"_class\" property */ -public final class ClassModel: Codable, Hashable { +public final class ClassModel: Codable, JSONEncodable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift index 9ddec91144b..c41a2876504 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift @@ -15,7 +15,7 @@ public typealias Client = PetstoreClientAPI.Client extension PetstoreClientAPI { -public final class Client: Codable, Hashable { +public final class Client: Codable, JSONEncodable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift index e4c05c90cb4..a8f98eecb28 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -15,7 +15,7 @@ public typealias Dog = PetstoreClientAPI.Dog extension PetstoreClientAPI { -public final class Dog: Codable, Hashable { +public final class Dog: Codable, JSONEncodable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift index 0ea9da741ca..c8de40cab7b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift @@ -15,7 +15,7 @@ public typealias DogAllOf = PetstoreClientAPI.DogAllOf extension PetstoreClientAPI { -public final class DogAllOf: Codable, Hashable { +public final class DogAllOf: Codable, JSONEncodable, Hashable { public var breed: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index a796ffc79c6..c9c9ab8756c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -15,7 +15,7 @@ public typealias EnumArrays = PetstoreClientAPI.EnumArrays extension PetstoreClientAPI { -public final class EnumArrays: Codable, Hashable { +public final class EnumArrays: Codable, JSONEncodable, Hashable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift index ad77e814461..b0a4756d3e8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -15,7 +15,7 @@ public typealias EnumTest = PetstoreClientAPI.EnumTest extension PetstoreClientAPI { -public final class EnumTest: Codable, Hashable { +public final class EnumTest: Codable, JSONEncodable, Hashable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift index 74ca2caa49d..d10c0e0a4b5 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift @@ -16,7 +16,7 @@ public typealias File = PetstoreClientAPI.File extension PetstoreClientAPI { /** Must be named `File` for test. */ -public final class File: Codable, Hashable { +public final class File: Codable, JSONEncodable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 13048f3fb44..550858bd70e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -15,7 +15,7 @@ public typealias FileSchemaTestClass = PetstoreClientAPI.FileSchemaTestClass extension PetstoreClientAPI { -public final class FileSchemaTestClass: Codable, Hashable { +public final class FileSchemaTestClass: Codable, JSONEncodable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 24057510679..9b54a4d7342 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -15,7 +15,7 @@ public typealias FormatTest = PetstoreClientAPI.FormatTest extension PetstoreClientAPI { -public final class FormatTest: Codable, Hashable { +public final class FormatTest: Codable, JSONEncodable, Hashable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index 56c0865e0dc..7c991e9e7c4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -15,7 +15,7 @@ public typealias HasOnlyReadOnly = PetstoreClientAPI.HasOnlyReadOnly extension PetstoreClientAPI { -public final class HasOnlyReadOnly: Codable, Hashable { +public final class HasOnlyReadOnly: Codable, JSONEncodable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift index bf620d4aa16..7f77dd2d5f0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift @@ -15,7 +15,7 @@ public typealias List = PetstoreClientAPI.List extension PetstoreClientAPI { -public final class List: Codable, Hashable { +public final class List: Codable, JSONEncodable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift index c94fa116b11..90feda030db 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -15,7 +15,7 @@ public typealias MapTest = PetstoreClientAPI.MapTest extension PetstoreClientAPI { -public final class MapTest: Codable, Hashable { +public final class MapTest: Codable, JSONEncodable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 9980d557872..f6e53c35028 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -15,7 +15,7 @@ public typealias MixedPropertiesAndAdditionalPropertiesClass = PetstoreClientAPI extension PetstoreClientAPI { -public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { +public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift index 21981f46098..917b539da00 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -16,7 +16,7 @@ public typealias Model200Response = PetstoreClientAPI.Model200Response extension PetstoreClientAPI { /** Model for testing model name starting with number */ -public final class Model200Response: Codable, Hashable { +public final class Model200Response: Codable, JSONEncodable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift index c7c6374fcd7..fa3e1bc692f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift @@ -16,7 +16,7 @@ public typealias Name = PetstoreClientAPI.Name extension PetstoreClientAPI { /** Model for testing model name same as property name */ -public final class Name: Codable, Hashable { +public final class Name: Codable, JSONEncodable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index 1cbf7fc2235..9412892a223 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -15,7 +15,7 @@ public typealias NumberOnly = PetstoreClientAPI.NumberOnly extension PetstoreClientAPI { -public final class NumberOnly: Codable, Hashable { +public final class NumberOnly: Codable, JSONEncodable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift index ca252a55cbc..6a9c4ec8937 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift @@ -15,7 +15,7 @@ public typealias Order = PetstoreClientAPI.Order extension PetstoreClientAPI { -public final class Order: Codable, Hashable { +public final class Order: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index ac2e2c17b63..cc9598c3fa1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -15,7 +15,7 @@ public typealias OuterComposite = PetstoreClientAPI.OuterComposite extension PetstoreClientAPI { -public final class OuterComposite: Codable, Hashable { +public final class OuterComposite: Codable, JSONEncodable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift index c764a418dea..ee791a3947a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -15,7 +15,7 @@ public typealias Pet = PetstoreClientAPI.Pet extension PetstoreClientAPI { -public final class Pet: Codable, Hashable { +public final class Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 1487fd0b22c..80fb29f9d9d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -15,7 +15,7 @@ public typealias ReadOnlyFirst = PetstoreClientAPI.ReadOnlyFirst extension PetstoreClientAPI { -public final class ReadOnlyFirst: Codable, Hashable { +public final class ReadOnlyFirst: Codable, JSONEncodable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift index 63a54182784..233b3d401e0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift @@ -16,7 +16,7 @@ public typealias Return = PetstoreClientAPI.Return extension PetstoreClientAPI { /** Model for testing reserved words */ -public final class Return: Codable, Hashable { +public final class Return: Codable, JSONEncodable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index d9b2471b63c..ac7c5f87a76 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -15,7 +15,7 @@ public typealias SpecialModelName = PetstoreClientAPI.SpecialModelName extension PetstoreClientAPI { -public final class SpecialModelName: Codable, Hashable { +public final class SpecialModelName: Codable, JSONEncodable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index e9b64b3e361..495a09ba807 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -15,7 +15,7 @@ public typealias StringBooleanMap = PetstoreClientAPI.StringBooleanMap extension PetstoreClientAPI { -public final class StringBooleanMap: Codable, Hashable { +public final class StringBooleanMap: Codable, JSONEncodable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift index e9bbb0b75e4..fbb689857fc 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -15,7 +15,7 @@ public typealias Tag = PetstoreClientAPI.Tag extension PetstoreClientAPI { -public final class Tag: Codable, Hashable { +public final class Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index b1bad05f594..39bc3abd9a9 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -15,7 +15,7 @@ public typealias TypeHolderDefault = PetstoreClientAPI.TypeHolderDefault extension PetstoreClientAPI { -public final class TypeHolderDefault: Codable, Hashable { +public final class TypeHolderDefault: Codable, JSONEncodable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index 604354fd3f0..6f955d93f3c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -15,7 +15,7 @@ public typealias TypeHolderExample = PetstoreClientAPI.TypeHolderExample extension PetstoreClientAPI { -public final class TypeHolderExample: Codable, Hashable { +public final class TypeHolderExample: Codable, JSONEncodable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift index 438f702a5a3..e0616cdca59 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift @@ -15,7 +15,7 @@ public typealias User = PetstoreClientAPI.User extension PetstoreClientAPI { -public final class User: Codable, Hashable { +public final class User: Codable, JSONEncodable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e2b73073804..8a06e2524e5 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -65,6 +65,16 @@ extension Date: JSONEncodable { } } +extension JSONEncodable where Self: Encodable { + func encodeToJSON() -> Any { + let encoder = CodableHelper.jsonEncoder + guard let data = try? encoder.encode(self) else { + fatalError("Could not encode to json: \(self)") + } + return data.encodeToJSON() + } +} + extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index e760b200563..6292a8a5403 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct AdditionalPropertiesClass: Codable { +public struct AdditionalPropertiesClass: Codable, JSONEncodable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index fb1a2df615d..06c768bb6bc 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Animal: Codable { +public struct Animal: Codable, JSONEncodable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4ee097de054..15dcb8747c4 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ApiResponse: Codable { +public struct ApiResponse: Codable, JSONEncodable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6f3ceb17753..1ae8a36fefe 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfArrayOfNumberOnly: Codable { +public struct ArrayOfArrayOfNumberOnly: Codable, JSONEncodable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index eb9892beb2b..90167ba90ef 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayOfNumberOnly: Codable { +public struct ArrayOfNumberOnly: Codable, JSONEncodable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 76aad66ec82..e24014ff7b7 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ArrayTest: Codable { +public struct ArrayTest: Codable, JSONEncodable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d06bb38d2d1..dd8c7ad0a6b 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Capitalization: Codable { +public struct Capitalization: Codable, JSONEncodable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7a394aca88d..80d27fa1a2f 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Cat: Codable { +public struct Cat: Codable, JSONEncodable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 679eda93b89..80814e4a9cc 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct CatAllOf: Codable { +public struct CatAllOf: Codable, JSONEncodable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 89016ca353d..75b68ec01e2 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Category: Codable, Hashable { +public struct Category: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index bc4e56c01ae..a3017674950 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable, JSONEncodable { public var _class: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index f1c50e5b8b9..9dda2b6224a 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Client: Codable { +public struct Client: Codable, JSONEncodable { public var client: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 55c387c28ae..f9fd593859b 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Dog: Codable { +public struct Dog: Codable, JSONEncodable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index b86ba8ccf8f..16cbfcd3e70 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct DogAllOf: Codable { +public struct DogAllOf: Codable, JSONEncodable { public var breed: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index edd583c8a29..3c847126473 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumArrays: Codable { +public struct EnumArrays: Codable, JSONEncodable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 4ae75032cfc..c0894dbd97a 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct EnumTest: Codable { +public struct EnumTest: Codable, JSONEncodable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/File.swift index d6513e0df74..72273d1ca65 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable, JSONEncodable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index d707e2ff2e2..adf7f317dd9 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FileSchemaTestClass: Codable { +public struct FileSchemaTestClass: Codable, JSONEncodable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index cbf0050081e..c2883d93dce 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct FormatTest: Codable { +public struct FormatTest: Codable, JSONEncodable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 9185cd673a8..46ca8c52847 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct HasOnlyReadOnly: Codable { +public struct HasOnlyReadOnly: Codable, JSONEncodable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 6568fe28f34..1cd923efb5d 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct List: Codable { +public struct List: Codable, JSONEncodable { public var _123list: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index eb9634803b3..4dbb2aef1e2 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MapTest: Codable { +public struct MapTest: Codable, JSONEncodable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 4d171a58c80..56070f31c64 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, JSONEncodable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 24a07e862b8..6f6a801aef8 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable, JSONEncodable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index e38ffc2eebd..dec47015e2f 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable, JSONEncodable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 555b1beda1d..b570fda3d19 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct NumberOnly: Codable { +public struct NumberOnly: Codable, JSONEncodable { public var justNumber: Double? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index be133bc42ad..45694b3beef 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Order: Codable { +public struct Order: Codable, JSONEncodable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 6e555ae9e1e..1a59760d19c 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct OuterComposite: Codable { +public struct OuterComposite: Codable, JSONEncodable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bceec7ccb53..f93b402b0fd 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Pet: Codable, Hashable { +public struct Pet: Codable, JSONEncodable, Hashable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b4cd35ad296..34d46afc574 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct ReadOnlyFirst: Codable { +public struct ReadOnlyFirst: Codable, JSONEncodable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index f12d1c17fdc..29b11b873b7 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -11,7 +11,7 @@ import AnyCodable #endif /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable, JSONEncodable { public var _return: Int? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index f797e406453..378debbd7cf 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct SpecialModelName: Codable { +public struct SpecialModelName: Codable, JSONEncodable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 1ef2bd41c79..e973ed2a662 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct StringBooleanMap: Codable { +public struct StringBooleanMap: Codable, JSONEncodable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 07b826264f3..f2dea74b09d 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct Tag: Codable, Hashable { +public struct Tag: Codable, JSONEncodable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index dcf87b413ab..340d4ddc019 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderDefault: Codable { +public struct TypeHolderDefault: Codable, JSONEncodable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 634f2d55168..4c96232af41 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct TypeHolderExample: Codable { +public struct TypeHolderExample: Codable, JSONEncodable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/User.swift index bad75dea179..54dede9e823 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public struct User: Codable { +public struct User: Codable, JSONEncodable { public var id: Int64? public var username: String? From e7ca67071e391ae2c2cb08e34ae040a8d1053c12 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 9 Jan 2022 11:19:57 -0500 Subject: [PATCH 017/113] [python] Fix 10773 - Use base_name for file uploads in form data (#11182) * Use base_name for file uploads in form data * Added missed sample changes --- .../src/main/resources/python/api_client.mustache | 4 ++-- samples/client/petstore/python/petstore_api/api_client.py | 4 ++-- .../petstore_api/api_client.py | 4 ++-- .../x-auth-id-alias/python/x_auth_id_alias/api_client.py | 4 ++-- .../dynamic-servers/python/dynamic_servers/api_client.py | 4 ++-- .../client/petstore/python/petstore_api/api_client.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index b4d1260eb74..39f33aee0b3 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -774,11 +774,11 @@ class Endpoint(object): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index e750f965b22..664cf1c917b 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -753,11 +753,11 @@ class Endpoint(object): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index e750f965b22..664cf1c917b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -753,11 +753,11 @@ class Endpoint(object): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index d7137238a17..e77be7a5319 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -753,11 +753,11 @@ class Endpoint(object): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index 470cc1aac89..e38f7442f7b 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -753,11 +753,11 @@ class Endpoint(object): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 9fbac41d73a..f29efaa1ce1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -760,11 +760,11 @@ class Endpoint(object): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) From 478219744e71b1faf6e6d5dee7c15a24605429f1 Mon Sep 17 00:00:00 2001 From: carmenquan Date: Sun, 9 Jan 2022 08:22:11 -0800 Subject: [PATCH 018/113] Making PyPi markdown friendly requires additional property (#11093) * updating python markdown property * adding to samples --- .../src/main/resources/python-legacy/setup.mustache | 3 ++- samples/client/petstore/python-asyncio/setup.py | 1 + samples/client/petstore/python-legacy/setup.py | 1 + samples/client/petstore/python-tornado/setup.py | 1 + samples/openapi3/client/petstore/python-legacy/setup.py | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache b/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache index 71f0e122b93..efb15b97e7a 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/setup.mustache @@ -36,7 +36,8 @@ setup( packages=find_packages(exclude=["test", "tests"]), include_package_data=True, {{#licenseInfo}}license="{{.}}", - {{/licenseInfo}}long_description="""\ + {{/licenseInfo}}long_description_content_type='text/markdown', + long_description="""\ {{appDescription}} # noqa: E501 """ ) diff --git a/samples/client/petstore/python-asyncio/setup.py b/samples/client/petstore/python-asyncio/setup.py index b9fc72e727f..974fea3373f 100644 --- a/samples/client/petstore/python-asyncio/setup.py +++ b/samples/client/petstore/python-asyncio/setup.py @@ -36,6 +36,7 @@ setup( packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", + long_description_content_type='text/markdown', long_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: \" \\ # noqa: E501 """ diff --git a/samples/client/petstore/python-legacy/setup.py b/samples/client/petstore/python-legacy/setup.py index 217134e7947..58abfa11b8d 100644 --- a/samples/client/petstore/python-legacy/setup.py +++ b/samples/client/petstore/python-legacy/setup.py @@ -35,6 +35,7 @@ setup( packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", + long_description_content_type='text/markdown', long_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: \" \\ # noqa: E501 """ diff --git a/samples/client/petstore/python-tornado/setup.py b/samples/client/petstore/python-tornado/setup.py index c6e7ddc51bf..db9d6f38025 100644 --- a/samples/client/petstore/python-tornado/setup.py +++ b/samples/client/petstore/python-tornado/setup.py @@ -36,6 +36,7 @@ setup( packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", + long_description_content_type='text/markdown', long_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: \" \\ # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python-legacy/setup.py b/samples/openapi3/client/petstore/python-legacy/setup.py index 217134e7947..58abfa11b8d 100755 --- a/samples/openapi3/client/petstore/python-legacy/setup.py +++ b/samples/openapi3/client/petstore/python-legacy/setup.py @@ -35,6 +35,7 @@ setup( packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", + long_description_content_type='text/markdown', long_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: \" \\ # noqa: E501 """ From d813d04f4601b5bf96534f99b5233e93fb1ad79c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sun, 9 Jan 2022 14:10:47 -0800 Subject: [PATCH 019/113] Improves generator docs, adds metadata section (#11262) * Refactors generator md creation, adds generateMdMetadata * Removes extra space * Adds docs updates * Fixes table definition for metadata * Docs update * Docs update * Updates title, removes sidebar_label because it was not doing anything on pages like https://openapi-generator.tech/docs/generators/android * Docs updated --- docs/generators/ada-server.md | 12 +- docs/generators/ada.md | 12 +- docs/generators/android.md | 12 +- docs/generators/apache2.md | 12 +- docs/generators/apex.md | 12 +- docs/generators/asciidoc.md | 12 +- docs/generators/aspnetcore.md | 12 +- docs/generators/avro-schema.md | 12 +- docs/generators/bash.md | 12 +- docs/generators/c.md | 12 +- docs/generators/clojure.md | 12 +- docs/generators/cpp-pistache-server.md | 12 +- docs/generators/cpp-qt-client.md | 12 +- docs/generators/cpp-qt-qhttpengine-server.md | 12 +- docs/generators/cpp-restbed-server.md | 12 +- docs/generators/cpp-restsdk.md | 12 +- docs/generators/cpp-tiny.md | 12 +- docs/generators/cpp-tizen.md | 12 +- docs/generators/cpp-ue4.md | 12 +- docs/generators/crystal.md | 12 +- docs/generators/csharp-dotnet2.md | 12 +- docs/generators/csharp-nancyfx.md | 12 +- docs/generators/csharp-netcore-functions.md | 12 +- docs/generators/csharp-netcore.md | 12 +- docs/generators/csharp.md | 12 +- docs/generators/cwiki.md | 12 +- docs/generators/dart-dio-next.md | 12 +- docs/generators/dart-dio.md | 12 +- docs/generators/dart-jaguar.md | 12 +- docs/generators/dart.md | 12 +- docs/generators/dynamic-html.md | 12 +- docs/generators/eiffel.md | 12 +- docs/generators/elixir.md | 12 +- docs/generators/elm.md | 12 +- docs/generators/erlang-client.md | 12 +- docs/generators/erlang-proper.md | 12 +- docs/generators/erlang-server.md | 12 +- docs/generators/flash-deprecated.md | 12 +- docs/generators/fsharp-functions.md | 12 +- docs/generators/fsharp-giraffe-server.md | 12 +- docs/generators/go-deprecated.md | 12 +- docs/generators/go-echo-server.md | 12 +- docs/generators/go-gin-server.md | 12 +- docs/generators/go-server.md | 12 +- docs/generators/go.md | 12 +- .../graphql-nodejs-express-server.md | 12 +- docs/generators/graphql-schema.md | 12 +- docs/generators/groovy.md | 12 +- docs/generators/haskell-http-client.md | 12 +- docs/generators/haskell-yesod.md | 12 +- docs/generators/haskell.md | 12 +- docs/generators/html.md | 12 +- docs/generators/html2.md | 12 +- docs/generators/java-inflector.md | 12 +- docs/generators/java-micronaut-client.md | 12 +- docs/generators/java-msf4j.md | 12 +- docs/generators/java-pkmst.md | 12 +- docs/generators/java-play-framework.md | 12 +- docs/generators/java-undertow-server.md | 12 +- docs/generators/java-vertx-web.md | 12 +- docs/generators/java-vertx.md | 12 +- docs/generators/java.md | 12 +- docs/generators/javascript-apollo.md | 12 +- docs/generators/javascript-closure-angular.md | 12 +- docs/generators/javascript-flowtyped.md | 12 +- docs/generators/javascript.md | 12 +- docs/generators/jaxrs-cxf-cdi.md | 12 +- docs/generators/jaxrs-cxf-client.md | 12 +- docs/generators/jaxrs-cxf-extended.md | 12 +- docs/generators/jaxrs-cxf.md | 12 +- docs/generators/jaxrs-jersey.md | 12 +- docs/generators/jaxrs-resteasy-eap.md | 12 +- docs/generators/jaxrs-resteasy.md | 12 +- docs/generators/jaxrs-spec.md | 12 +- docs/generators/jmeter.md | 12 +- docs/generators/k6.md | 12 +- docs/generators/kotlin-server-deprecated.md | 12 +- docs/generators/kotlin-server.md | 12 +- docs/generators/kotlin-spring.md | 12 +- docs/generators/kotlin-vertx.md | 12 +- docs/generators/kotlin.md | 12 +- docs/generators/ktorm-schema.md | 12 +- docs/generators/lua.md | 12 +- docs/generators/markdown.md | 12 +- docs/generators/mysql-schema.md | 12 +- docs/generators/nim.md | 12 +- docs/generators/nodejs-express-server.md | 12 +- docs/generators/objc.md | 12 +- docs/generators/ocaml.md | 12 +- docs/generators/openapi-yaml.md | 12 +- docs/generators/openapi.md | 12 +- docs/generators/perl.md | 12 +- docs/generators/php-dt.md | 12 +- docs/generators/php-laravel.md | 12 +- docs/generators/php-lumen.md | 12 +- docs/generators/php-mezzio-ph.md | 12 +- docs/generators/php-silex-deprecated.md | 12 +- docs/generators/php-slim-deprecated.md | 12 +- docs/generators/php-slim4.md | 12 +- docs/generators/php-symfony.md | 12 +- docs/generators/php.md | 12 +- docs/generators/plantuml.md | 12 +- docs/generators/powershell.md | 12 +- docs/generators/protobuf-schema.md | 12 +- docs/generators/python-aiohttp.md | 12 +- docs/generators/python-blueplanet.md | 12 +- docs/generators/python-experimental.md | 12 +- docs/generators/python-fastapi.md | 12 +- docs/generators/python-flask.md | 12 +- docs/generators/python-legacy.md | 12 +- docs/generators/python.md | 12 +- docs/generators/r.md | 12 +- docs/generators/ruby-on-rails.md | 12 +- docs/generators/ruby-sinatra.md | 12 +- docs/generators/ruby.md | 12 +- docs/generators/rust-server.md | 12 +- docs/generators/rust.md | 12 +- docs/generators/scala-akka-http-server.md | 12 +- docs/generators/scala-akka.md | 12 +- docs/generators/scala-finch.md | 12 +- docs/generators/scala-gatling.md | 12 +- .../generators/scala-httpclient-deprecated.md | 12 +- docs/generators/scala-lagom-server.md | 12 +- docs/generators/scala-play-server.md | 12 +- docs/generators/scala-sttp.md | 12 +- docs/generators/scalatra.md | 12 +- docs/generators/scalaz.md | 12 +- docs/generators/spring.md | 12 +- docs/generators/swift4-deprecated.md | 12 +- docs/generators/swift5.md | 12 +- docs/generators/typescript-angular.md | 12 +- .../typescript-angularjs-deprecated.md | 12 +- docs/generators/typescript-aurelia.md | 12 +- docs/generators/typescript-axios.md | 12 +- docs/generators/typescript-fetch.md | 12 +- docs/generators/typescript-inversify.md | 12 +- docs/generators/typescript-jquery.md | 12 +- docs/generators/typescript-nestjs.md | 12 +- docs/generators/typescript-node.md | 12 +- docs/generators/typescript-redux-query.md | 12 +- docs/generators/typescript-rxjs.md | 12 +- docs/generators/typescript.md | 12 +- docs/generators/wsdl-schema.md | 12 +- .../openapitools/codegen/cmd/ConfigHelp.java | 224 +++++++++++------- .../PythonExperimentalClientCodegen.java | 2 +- 145 files changed, 1567 insertions(+), 375 deletions(-) diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index f88751432cb..ae41a6fb725 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for ada-server -sidebar_label: ada-server +title: Documentation for the ada-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ada-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates an Ada server implementation (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/ada.md b/docs/generators/ada.md index 3c08371fe24..ba6a764ac31 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -1,8 +1,16 @@ --- -title: Config Options for ada -sidebar_label: ada +title: Documentation for the ada Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ada | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Ada client implementation (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/android.md b/docs/generators/android.md index 12e99f75cf3..53bde3fa486 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -1,8 +1,16 @@ --- -title: Config Options for android -sidebar_label: android +title: Documentation for the android Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | android | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Android client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 0db25b032cd..c31d64f4986 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -1,8 +1,16 @@ --- -title: Config Options for apache2 -sidebar_label: apache2 +title: Documentation for the apache2 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | apache2 | pass this to the generate command after -g | +| generator type | CONFIG | | +| helpTxt | Generates an Apache2 Config file with the permissions | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/apex.md b/docs/generators/apex.md index 89dfd44654d..5610d51d22e 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -1,8 +1,16 @@ --- -title: Config Options for apex -sidebar_label: apex +title: Documentation for the apex Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | apex | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Apex API client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index 80f949644c8..a3b4795a2c8 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -1,8 +1,16 @@ --- -title: Config Options for asciidoc -sidebar_label: asciidoc +title: Documentation for the asciidoc Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | asciidoc | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates asciidoc markup based documentation. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 6e07567bcc1..cebbaf9a870 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -1,8 +1,16 @@ --- -title: Config Options for aspnetcore -sidebar_label: aspnetcore +title: Documentation for the aspnetcore Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | aspnetcore | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates an ASP.NET Core Web API server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index cbb7dd6e3f0..506aca5d85b 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -1,8 +1,16 @@ --- -title: Config Options for avro-schema -sidebar_label: avro-schema +title: Documentation for the avro-schema Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | avro-schema | pass this to the generate command after -g | +| generator type | SCHEMA | | +| helpTxt | Generates a Avro model (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/bash.md b/docs/generators/bash.md index 590f535c54f..524c9534fa5 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -1,8 +1,16 @@ --- -title: Config Options for bash -sidebar_label: bash +title: Documentation for the bash Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | bash | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Bash client script based on cURL. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/c.md b/docs/generators/c.md index c6e5c35372f..3eb885a9a11 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -1,8 +1,16 @@ --- -title: Config Options for c -sidebar_label: c +title: Documentation for the c Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | c | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a C (libcurl) client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index cf7b0c3bc03..2f5fadc54c9 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -1,8 +1,16 @@ --- -title: Config Options for clojure -sidebar_label: clojure +title: Documentation for the clojure Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | clojure | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Clojure client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index 0e4046ec566..d58a5f17572 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-pistache-server -sidebar_label: cpp-pistache-server +title: Documentation for the cpp-pistache-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-pistache-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a C++ API server (based on Pistache) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 4bb53da53f3..8ad0c33d85c 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-qt-client -sidebar_label: cpp-qt-client +title: Documentation for the cpp-qt-client Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-qt-client | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Qt C++ client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index 6126b80c254..99dbeca8759 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-qt-qhttpengine-server -sidebar_label: cpp-qt-qhttpengine-server +title: Documentation for the cpp-qt-qhttpengine-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-qt-qhttpengine-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Qt C++ Server using the QHTTPEngine HTTP Library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-restbed-server.md b/docs/generators/cpp-restbed-server.md index 4683a9be64b..193e11cc92d 100644 --- a/docs/generators/cpp-restbed-server.md +++ b/docs/generators/cpp-restbed-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-restbed-server -sidebar_label: cpp-restbed-server +title: Documentation for the cpp-restbed-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-restbed-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a C++ API Server with Restbed (https://github.com/Corvusoft/restbed). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index 4fc97b939ae..480178fdf62 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-restsdk -sidebar_label: cpp-restsdk +title: Documentation for the cpp-restsdk Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-restsdk | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a C++ API client with C++ REST SDK (https://github.com/Microsoft/cpprestsdk). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index 4da8351e58a..006561e38f7 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-tiny -sidebar_label: cpp-tiny +title: Documentation for the cpp-tiny Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-tiny | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a C++ Arduino REST API client. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index 7f5b106c048..4f40b91b7d3 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-tizen -sidebar_label: cpp-tizen +title: Documentation for the cpp-tizen Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-tizen | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Samsung Tizen C++ client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index be06301a99d..a2961af1612 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -1,8 +1,16 @@ --- -title: Config Options for cpp-ue4 -sidebar_label: cpp-ue4 +title: Documentation for the cpp-ue4 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cpp-ue4 | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Unreal Engine 4 C++ Module (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index b79135246bb..eaacb566be9 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -1,8 +1,16 @@ --- -title: Config Options for crystal -sidebar_label: crystal +title: Documentation for the crystal Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | crystal | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Crystal client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md index fa97c717000..b1d47b73ac6 100644 --- a/docs/generators/csharp-dotnet2.md +++ b/docs/generators/csharp-dotnet2.md @@ -1,8 +1,16 @@ --- -title: Config Options for csharp-dotnet2 -sidebar_label: csharp-dotnet2 +title: Documentation for the csharp-dotnet2 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | csharp-dotnet2 | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a C# .Net 2.0 client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx.md index f08b5157930..b8b5928ed63 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx.md @@ -1,8 +1,16 @@ --- -title: Config Options for csharp-nancyfx -sidebar_label: csharp-nancyfx +title: Documentation for the csharp-nancyfx Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | csharp-nancyfx | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a C# NancyFX Web API server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md index 50ec49b34a1..6d856577317 100644 --- a/docs/generators/csharp-netcore-functions.md +++ b/docs/generators/csharp-netcore-functions.md @@ -1,8 +1,16 @@ --- -title: Config Options for csharp-netcore-functions -sidebar_label: csharp-netcore-functions +title: Documentation for the csharp-netcore-functions Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | csharp-netcore-functions | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a csharp server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index bb138ef414d..33b124200fb 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -1,8 +1,16 @@ --- -title: Config Options for csharp-netcore -sidebar_label: csharp-netcore +title: Documentation for the csharp-netcore Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | csharp-netcore | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a C# client library (.NET Standard, .NET Core). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index b572a6c3710..c925eecc8e7 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -1,8 +1,16 @@ --- -title: Config Options for csharp -sidebar_label: csharp +title: Documentation for the csharp Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | csharp | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a CSharp client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index d10f1d303ef..13a6eb489e3 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -1,8 +1,16 @@ --- -title: Config Options for cwiki -sidebar_label: cwiki +title: Documentation for the cwiki Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | cwiki | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates confluence wiki markup. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index 869645f7da8..07b20e71d1a 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -1,8 +1,16 @@ --- -title: Config Options for dart-dio-next -sidebar_label: dart-dio-next +title: Documentation for the dart-dio-next Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | dart-dio-next | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Dart Dio client library with null-safety. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index e3b6ac95639..77aeaab2538 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -1,8 +1,16 @@ --- -title: Config Options for dart-dio -sidebar_label: dart-dio +title: Documentation for the dart-dio Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | dart-dio | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Dart Dio client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 769fa166dab..1cbdd8bad48 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -1,8 +1,16 @@ --- -title: Config Options for dart-jaguar -sidebar_label: dart-jaguar +title: Documentation for the dart-jaguar Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | dart-jaguar | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Dart Jaguar client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 73f113808b4..7793319b30f 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -1,8 +1,16 @@ --- -title: Config Options for dart -sidebar_label: dart +title: Documentation for the dart Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | dart | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Dart 2.x client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index 771cecc8b15..ff0c25132f5 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -1,8 +1,16 @@ --- -title: Config Options for dynamic-html -sidebar_label: dynamic-html +title: Documentation for the dynamic-html Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | dynamic-html | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates a dynamic HTML site. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/eiffel.md b/docs/generators/eiffel.md index b2f38750eba..151654c6f14 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -1,8 +1,16 @@ --- -title: Config Options for eiffel -sidebar_label: eiffel +title: Documentation for the eiffel Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | eiffel | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Eiffel client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index 543f116ddb2..2a6d9d93e4c 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -1,8 +1,16 @@ --- -title: Config Options for elixir -sidebar_label: elixir +title: Documentation for the elixir Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | elixir | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an elixir client library (alpha). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/elm.md b/docs/generators/elm.md index 73b67667616..79ff7df2e32 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -1,8 +1,16 @@ --- -title: Config Options for elm -sidebar_label: elm +title: Documentation for the elm Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | elm | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Elm client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/erlang-client.md b/docs/generators/erlang-client.md index ebbd5e53ec6..3436fc2faad 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -1,8 +1,16 @@ --- -title: Config Options for erlang-client -sidebar_label: erlang-client +title: Documentation for the erlang-client Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | erlang-client | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Erlang client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 4db9d763c9b..0a50ff9c285 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -1,8 +1,16 @@ --- -title: Config Options for erlang-proper -sidebar_label: erlang-proper +title: Documentation for the erlang-proper Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | erlang-proper | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Erlang library with PropEr generators (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/erlang-server.md b/docs/generators/erlang-server.md index 385100fac8e..c6bbba108b4 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for erlang-server -sidebar_label: erlang-server +title: Documentation for the erlang-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | erlang-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates an Erlang server library (beta) using OpenAPI Generator (https://openapi-generator.tech). By default, it will also generate service classes, which can be disabled with the `-Dnoservice` environment variable. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/flash-deprecated.md b/docs/generators/flash-deprecated.md index 5330b928fa4..b82898633d4 100644 --- a/docs/generators/flash-deprecated.md +++ b/docs/generators/flash-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for flash-deprecated -sidebar_label: flash-deprecated +title: Documentation for the flash-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | flash-deprecated | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Flash (ActionScript) client library (beta). IMPORTANT: this generator has been deprecated in v5.x | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index de363c1ca6b..534dbbc445f 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -1,8 +1,16 @@ --- -title: Config Options for fsharp-functions -sidebar_label: fsharp-functions +title: Documentation for the fsharp-functions Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | fsharp-functions | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a fsharp-functions server (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/fsharp-giraffe-server.md b/docs/generators/fsharp-giraffe-server.md index f374168aa71..fe1c0c180b4 100644 --- a/docs/generators/fsharp-giraffe-server.md +++ b/docs/generators/fsharp-giraffe-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for fsharp-giraffe-server -sidebar_label: fsharp-giraffe-server +title: Documentation for the fsharp-giraffe-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | fsharp-giraffe-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a F# Giraffe server (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/go-deprecated.md b/docs/generators/go-deprecated.md index 4faa3a8b636..cb19432610d 100644 --- a/docs/generators/go-deprecated.md +++ b/docs/generators/go-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for go-deprecated -sidebar_label: go-deprecated +title: Documentation for the go-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | go-deprecated | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/go-echo-server.md b/docs/generators/go-echo-server.md index 53c726fb85e..9ad9e61c952 100644 --- a/docs/generators/go-echo-server.md +++ b/docs/generators/go-echo-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for go-echo-server -sidebar_label: go-echo-server +title: Documentation for the go-echo-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | go-echo-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a go-echo server. (Beta) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/go-gin-server.md b/docs/generators/go-gin-server.md index 0c1d324191d..85c1e5efbc4 100644 --- a/docs/generators/go-gin-server.md +++ b/docs/generators/go-gin-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for go-gin-server -sidebar_label: go-gin-server +title: Documentation for the go-gin-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | go-gin-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Go server library with the gin framework using OpenAPI-Generator.By default, it will also generate service classes. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index 440b3461b0f..f3f0a91da94 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for go-server -sidebar_label: go-server +title: Documentation for the go-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | go-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Go server library using OpenAPI-Generator. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/go.md b/docs/generators/go.md index a2318c003f3..1bb81764435 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -1,8 +1,16 @@ --- -title: Config Options for go -sidebar_label: go +title: Documentation for the go Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | go | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Go client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index ab641eba44b..a1f1248d285 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for graphql-nodejs-express-server -sidebar_label: graphql-nodejs-express-server +title: Documentation for the graphql-nodejs-express-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | graphql-nodejs-express-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a GraphQL Node.js Express server (beta) including it's types, queries, mutations, (resolvers) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/graphql-schema.md b/docs/generators/graphql-schema.md index 27f6b8ab9eb..ecdedafb3da 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -1,8 +1,16 @@ --- -title: Config Options for graphql-schema -sidebar_label: graphql-schema +title: Documentation for the graphql-schema Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | graphql-schema | pass this to the generate command after -g | +| generator type | SCHEMA | | +| helpTxt | Generates GraphQL schema files (beta) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 96df596870d..18c943c2860 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -1,8 +1,16 @@ --- -title: Config Options for groovy -sidebar_label: groovy +title: Documentation for the groovy Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | groovy | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Groovy API client. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index f287982ab71..4515d4ad850 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -1,8 +1,16 @@ --- -title: Config Options for haskell-http-client -sidebar_label: haskell-http-client +title: Documentation for the haskell-http-client Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | haskell-http-client | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Haskell http-client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index e4f8bd5a362..7993d7988b2 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -1,8 +1,16 @@ --- -title: Config Options for haskell-yesod -sidebar_label: haskell-yesod +title: Documentation for the haskell-yesod Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | haskell-yesod | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a haskell-yesod server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 75dfe15ca50..28e69825493 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -1,8 +1,16 @@ --- -title: Config Options for haskell -sidebar_label: haskell +title: Documentation for the haskell Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | haskell | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Haskell server and client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/html.md b/docs/generators/html.md index 0ece134692a..d597f69ce9e 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -1,8 +1,16 @@ --- -title: Config Options for html -sidebar_label: html +title: Documentation for the html Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | html | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates a static HTML file. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/html2.md b/docs/generators/html2.md index 40dc30a42e4..0e99b15a11e 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -1,8 +1,16 @@ --- -title: Config Options for html2 -sidebar_label: html2 +title: Documentation for the html2 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | html2 | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates a static HTML file. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 309bc1a3dbb..48b4070382e 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-inflector -sidebar_label: java-inflector +title: Documentation for the java-inflector Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-inflector | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java Inflector Server application. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 98ce5396a97..898f2ee2f33 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-micronaut-client -sidebar_label: java-micronaut-client +title: Documentation for the java-micronaut-client Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-micronaut-client | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Java Micronaut Client. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index d3a7aa4bd21..fd0b6ec7c27 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-msf4j -sidebar_label: java-msf4j +title: Documentation for the java-msf4j Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-msf4j | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java Micro Service based on WSO2 Microservices Framework for Java (MSF4J) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 1f7b1f7e262..9731d407c37 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-pkmst -sidebar_label: java-pkmst +title: Documentation for the java-pkmst Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-pkmst | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PKMST SpringBoot Server application using the SpringFox integration. Also enables EurekaServerClient / Zipkin / Spring-Boot admin | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 851e0c567a1..8137dc2f7a6 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-play-framework -sidebar_label: java-play-framework +title: Documentation for the java-play-framework Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-play-framework | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java Play Framework Server application. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index f240e949090..340ae31025b 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-undertow-server -sidebar_label: java-undertow-server +title: Documentation for the java-undertow-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-undertow-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java Undertow Server application (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 01135987760..5d4946c67d4 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-vertx-web -sidebar_label: java-vertx-web +title: Documentation for the java-vertx-web Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-vertx-web | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java Vert.x-Web Server (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 435c1a12266..82660a9c9ea 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -1,8 +1,16 @@ --- -title: Config Options for java-vertx -sidebar_label: java-vertx +title: Documentation for the java-vertx Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-vertx | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a java-Vert.X Server library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/java.md b/docs/generators/java.md index cdab88d701e..90aa5d73f66 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -1,8 +1,16 @@ --- -title: Config Options for java -sidebar_label: java +title: Documentation for the java Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 260fc980945..3129864fb33 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -1,8 +1,16 @@ --- -title: Config Options for javascript-apollo -sidebar_label: javascript-apollo +title: Documentation for the javascript-apollo Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | javascript-apollo | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a JavaScript client library (beta) using Apollo RESTDatasource. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 891b35cb933..b9da1dc8f55 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -1,8 +1,16 @@ --- -title: Config Options for javascript-closure-angular -sidebar_label: javascript-closure-angular +title: Documentation for the javascript-closure-angular Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | javascript-closure-angular | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index a6fcea0533c..76b81c5aa82 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -1,8 +1,16 @@ --- -title: Config Options for javascript-flowtyped -sidebar_label: javascript-flowtyped +title: Documentation for the javascript-flowtyped Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | javascript-flowtyped | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Javascript client library (beta) using Flow types and Fetch API. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index 962b9ffc40e..2381c5108f3 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -1,8 +1,16 @@ --- -title: Config Options for javascript -sidebar_label: javascript +title: Documentation for the javascript Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | javascript | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a JavaScript client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index c46ec4c9631..1564b252520 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-cxf-cdi -sidebar_label: jaxrs-cxf-cdi +title: Documentation for the jaxrs-cxf-cdi Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-cxf-cdi | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an Apache CXF runtime and a Java EE runtime with CDI enabled. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index ad1c6090036..b7fcd7f4942 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-cxf-client -sidebar_label: jaxrs-cxf-client +title: Documentation for the jaxrs-cxf-client Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-cxf-client | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Java JAXRS Client based on Apache CXF framework. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 0eef8cacd4e..c44b15f100b 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-cxf-extended -sidebar_label: jaxrs-cxf-extended +title: Documentation for the jaxrs-cxf-extended Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-cxf-extended | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Extends jaxrs-cxf with options to generate a functional mock server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 80b178858a3..f3cb09d4176 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-cxf -sidebar_label: jaxrs-cxf +title: Documentation for the jaxrs-cxf Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-cxf | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java JAXRS Server application based on Apache CXF framework. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 15584410d1f..086f079c059 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-jersey -sidebar_label: jaxrs-jersey +title: Documentation for the jaxrs-jersey Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-jersey | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java JAXRS Server application based on Jersey framework. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 247353cbb32..3670d584186 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-resteasy-eap -sidebar_label: jaxrs-resteasy-eap +title: Documentation for the jaxrs-resteasy-eap Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-resteasy-eap | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java JAXRS-Resteasy Server application. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index ff9fab072fd..bf56de2f235 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-resteasy -sidebar_label: jaxrs-resteasy +title: Documentation for the jaxrs-resteasy Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-resteasy | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java JAXRS-Resteasy Server application. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index a29e8a93178..84d8b47d501 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -1,8 +1,16 @@ --- -title: Config Options for jaxrs-spec -sidebar_label: jaxrs-spec +title: Documentation for the jaxrs-spec Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jaxrs-spec | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 71584a1e793..e47e7fef177 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -1,8 +1,16 @@ --- -title: Config Options for jmeter -sidebar_label: jmeter +title: Documentation for the jmeter Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | jmeter | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a JMeter .jmx file. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/k6.md b/docs/generators/k6.md index 529527a890c..a23aec49d2d 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -1,8 +1,16 @@ --- -title: Config Options for k6 -sidebar_label: k6 +title: Documentation for the k6 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | k6 | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a k6 script (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md index 7e53620aa6e..79e12009c63 100644 --- a/docs/generators/kotlin-server-deprecated.md +++ b/docs/generators/kotlin-server-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for kotlin-server-deprecated -sidebar_label: kotlin-server-deprecated +title: Documentation for the kotlin-server-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | kotlin-server-deprecated | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Kotlin server (Ktor v1.1.3). IMPORTANT: this generator has been deprecated. Please migrate to `kotlin-server` which supports Ktor v1.5.2+. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 0c0228d8a8c..95dce36a027 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for kotlin-server -sidebar_label: kotlin-server +title: Documentation for the kotlin-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | kotlin-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Kotlin server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 5cd67ff64aa..d09124f4a7f 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -1,8 +1,16 @@ --- -title: Config Options for kotlin-spring -sidebar_label: kotlin-spring +title: Documentation for the kotlin-spring Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | kotlin-spring | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Kotlin Spring application. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 02d608e5274..174d19f1669 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -1,8 +1,16 @@ --- -title: Config Options for kotlin-vertx -sidebar_label: kotlin-vertx +title: Documentation for the kotlin-vertx Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | kotlin-vertx | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a kotlin-vertx server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 786ff7013eb..31f9601161d 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -1,8 +1,16 @@ --- -title: Config Options for kotlin -sidebar_label: kotlin +title: Documentation for the kotlin Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | kotlin | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Kotlin client. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/ktorm-schema.md b/docs/generators/ktorm-schema.md index 7a45b88b69a..163fce14c15 100644 --- a/docs/generators/ktorm-schema.md +++ b/docs/generators/ktorm-schema.md @@ -1,8 +1,16 @@ --- -title: Config Options for ktorm-schema -sidebar_label: ktorm-schema +title: Documentation for the ktorm-schema Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ktorm-schema | pass this to the generate command after -g | +| generator type | SCHEMA | | +| helpTxt | Generates a kotlin-ktorm schema (beta) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/lua.md b/docs/generators/lua.md index 6f9f4a80eaf..3f4e6e34c6c 100644 --- a/docs/generators/lua.md +++ b/docs/generators/lua.md @@ -1,8 +1,16 @@ --- -title: Config Options for lua -sidebar_label: lua +title: Documentation for the lua Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | lua | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Lua client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 4d87a35f964..87e922f1b9d 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -1,8 +1,16 @@ --- -title: Config Options for markdown -sidebar_label: markdown +title: Documentation for the markdown Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | markdown | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates a markdown documentation. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 8526ade4f06..3499563f5a8 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -1,8 +1,16 @@ --- -title: Config Options for mysql-schema -sidebar_label: mysql-schema +title: Documentation for the mysql-schema Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | mysql-schema | pass this to the generate command after -g | +| generator type | SCHEMA | | +| helpTxt | Generates a MySQL schema based on the model or schema defined in the OpenAPI specification (v2, v3). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 3d90efad159..77a6d5e9046 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -1,8 +1,16 @@ --- -title: Config Options for nim -sidebar_label: nim +title: Documentation for the nim Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | nim | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a nim client (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index 9fffa3c28b7..f2bca510334 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for nodejs-express-server -sidebar_label: nodejs-express-server +title: Documentation for the nodejs-express-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | nodejs-express-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a NodeJS Express server (alpha). IMPORTANT: this generator may subject to breaking changes without further notice). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/objc.md b/docs/generators/objc.md index ad51253f978..fa4c1350801 100644 --- a/docs/generators/objc.md +++ b/docs/generators/objc.md @@ -1,8 +1,16 @@ --- -title: Config Options for objc -sidebar_label: objc +title: Documentation for the objc Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | objc | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an Objective-C client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index 597f07b8411..a453f108792 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -1,8 +1,16 @@ --- -title: Config Options for ocaml -sidebar_label: ocaml +title: Documentation for the ocaml Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ocaml | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates an OCaml client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index 4476c790000..db86e36ac3d 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -1,8 +1,16 @@ --- -title: Config Options for openapi-yaml -sidebar_label: openapi-yaml +title: Documentation for the openapi-yaml Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | openapi-yaml | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Creates a static openapi.yaml file (OpenAPI spec v3). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index 53ea3bf812c..754d65ebc26 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -1,8 +1,16 @@ --- -title: Config Options for openapi -sidebar_label: openapi +title: Documentation for the openapi Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | openapi | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Creates a static openapi.json file (OpenAPI spec v3.0). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/perl.md b/docs/generators/perl.md index 910abd78432..5d9c89a3a10 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -1,8 +1,16 @@ --- -title: Config Options for perl -sidebar_label: perl +title: Documentation for the perl Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | perl | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Perl client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index a4a6eac2b73..293940f6ca0 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-dt -sidebar_label: php-dt +title: Documentation for the php-dt Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-dt | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a PHP client relying on Data Transfer ( https://github.com/Articus/DataTransfer ) and compliant with PSR-7, PSR-11, PSR-17 and PSR-18. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index 09e61d56c13..bd374554c82 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-laravel -sidebar_label: php-laravel +title: Documentation for the php-laravel Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-laravel | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PHP laravel server library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 562b26a589d..1b91b92fd9a 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-lumen -sidebar_label: php-lumen +title: Documentation for the php-lumen Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-lumen | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PHP Lumen server library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 7abb3408bca..71268386534 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-mezzio-ph -sidebar_label: php-mezzio-ph +title: Documentation for the php-mezzio-ph Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-mezzio-ph | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates PHP server stub using Mezzio ( https://docs.mezzio.dev/mezzio/ ) and Path Handler ( https://github.com/Articus/PathHandler ). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index 9b4d5b39b63..e9af8da6621 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-silex-deprecated -sidebar_label: php-silex-deprecated +title: Documentation for the php-silex-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-silex-deprecated | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PHP Silex server library. IMPORTANT NOTE: this generator is no longer actively maintained. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index 15c4d36ba80..5e88e4e684a 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-slim-deprecated -sidebar_label: php-slim-deprecated +title: Documentation for the php-slim-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-slim-deprecated | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PHP Slim Framework server library. IMPORTANT NOTE: this generator (Slim 3.x) is no longer actively maintained so please use 'php-slim4' generator instead. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index ca1bd3b6a10..ae8676e2d9a 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-slim4 -sidebar_label: php-slim4 +title: Documentation for the php-slim4 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-slim4 | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PHP Slim 4 Framework server library(with Mock server). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 0a231dbd2e4..8ed3be46e39 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -1,8 +1,16 @@ --- -title: Config Options for php-symfony -sidebar_label: php-symfony +title: Documentation for the php-symfony Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-symfony | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a PHP Symfony server bundle. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/php.md b/docs/generators/php.md index c84e12c36f6..b9a93234cb2 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -1,8 +1,16 @@ --- -title: Config Options for php -sidebar_label: php +title: Documentation for the php Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a PHP client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index 7a37ad0d187..b2c4c230c0b 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -1,8 +1,16 @@ --- -title: Config Options for plantuml -sidebar_label: plantuml +title: Documentation for the plantuml Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | plantuml | pass this to the generate command after -g | +| generator type | DOCUMENTATION | | +| helpTxt | Generates a plantuml documentation. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index c822e241889..36d7ba9e54d 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -1,8 +1,16 @@ --- -title: Config Options for powershell -sidebar_label: powershell +title: Documentation for the powershell Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | powershell | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a PowerShell API client (beta) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index a7d1f1d095b..2f350f1a1b0 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -1,8 +1,16 @@ --- -title: Config Options for protobuf-schema -sidebar_label: protobuf-schema +title: Documentation for the protobuf-schema Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | protobuf-schema | pass this to the generate command after -g | +| generator type | SCHEMA | | +| helpTxt | Generates gRPC and protocol buffer schema files (beta) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 14ffd174221..fdfdf70f306 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -1,8 +1,16 @@ --- -title: Config Options for python-aiohttp -sidebar_label: python-aiohttp +title: Documentation for the python-aiohttp Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python-aiohttp | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 049e3424ebb..f8f6d4f6307 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -1,8 +1,16 @@ --- -title: Config Options for python-blueplanet -sidebar_label: python-blueplanet +title: Documentation for the python-blueplanet Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python-blueplanet | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index e61a03a4e60..e026fdf032a 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -1,8 +1,16 @@ --- -title: Config Options for python-experimental -sidebar_label: python-experimental +title: Documentation for the python-experimental Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python-experimental | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index 4e321ff9e59..bb88a406076 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -1,8 +1,16 @@ --- -title: Config Options for python-fastapi -sidebar_label: python-fastapi +title: Documentation for the python-fastapi Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python-fastapi | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Python FastAPI server (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index a0a5f44b20a..b53c86fded1 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -1,8 +1,16 @@ --- -title: Config Options for python-flask -sidebar_label: python-flask +title: Documentation for the python-flask Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python-flask | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python-legacy.md b/docs/generators/python-legacy.md index a341d478882..14821d0ae1c 100644 --- a/docs/generators/python-legacy.md +++ b/docs/generators/python-legacy.md @@ -1,8 +1,16 @@ --- -title: Config Options for python-legacy -sidebar_label: python-legacy +title: Documentation for the python-legacy Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python-legacy | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Python client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/python.md b/docs/generators/python.md index fe60f0e511c..607c71a2604 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -1,8 +1,16 @@ --- -title: Config Options for python -sidebar_label: python +title: Documentation for the python Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | python | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Python client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/r.md b/docs/generators/r.md index 69613835612..d2ee1ea6836 100644 --- a/docs/generators/r.md +++ b/docs/generators/r.md @@ -1,8 +1,16 @@ --- -title: Config Options for r -sidebar_label: r +title: Documentation for the r Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | r | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a R client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index 5c25cf1451b..f0be7a29e13 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -1,8 +1,16 @@ --- -title: Config Options for ruby-on-rails -sidebar_label: ruby-on-rails +title: Documentation for the ruby-on-rails Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ruby-on-rails | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Ruby on Rails (v5) server library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index 58043cfafc5..f58b4b948b1 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -1,8 +1,16 @@ --- -title: Config Options for ruby-sinatra -sidebar_label: ruby-sinatra +title: Documentation for the ruby-sinatra Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ruby-sinatra | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Ruby Sinatra server library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 6937905b9e3..56c094bbd9f 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -1,8 +1,16 @@ --- -title: Config Options for ruby -sidebar_label: ruby +title: Documentation for the ruby Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | ruby | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Ruby client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md index 1d13b032104..7822aa5417c 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for rust-server -sidebar_label: rust-server +title: Documentation for the rust-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | rust-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Rust client/server library (beta) using the openapi-generator project. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/rust.md b/docs/generators/rust.md index dc57794b8d0..44b63aee0ec 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -1,8 +1,16 @@ --- -title: Config Options for rust -sidebar_label: rust +title: Documentation for the rust Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | rust | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Rust client library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 3d27821c231..9c35ef92e7d 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-akka-http-server -sidebar_label: scala-akka-http-server +title: Documentation for the scala-akka-http-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-akka-http-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a scala-akka-http server (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index 1cc19c6216d..cf8b6909aca 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-akka -sidebar_label: scala-akka +title: Documentation for the scala-akka Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-akka | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Scala client library (beta) base on Akka/Spray. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-finch.md b/docs/generators/scala-finch.md index 5d2bdded42a..9796e5d50fd 100644 --- a/docs/generators/scala-finch.md +++ b/docs/generators/scala-finch.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-finch -sidebar_label: scala-finch +title: Documentation for the scala-finch Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-finch | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Scala server application with Finch. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 6daaef5d657..19cd4528952 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-gatling -sidebar_label: scala-gatling +title: Documentation for the scala-gatling Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-gatling | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a gatling simulation library (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index 4bd12dca955..af714b42ed2 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-httpclient-deprecated -sidebar_label: scala-httpclient-deprecated +title: Documentation for the scala-httpclient-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-httpclient-deprecated | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Scala client library (beta). IMPORTANT: This generator is no longer actively maintained and will be deprecated. PLease use 'scala-akka' generator instead. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index ed197a23e5e..aba88bb57ee 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-lagom-server -sidebar_label: scala-lagom-server +title: Documentation for the scala-lagom-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-lagom-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Lagom API server (Beta) in scala | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index aeab7fd2538..845b9a233b8 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-play-server -sidebar_label: scala-play-server +title: Documentation for the scala-play-server Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-play-server | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Scala server application (beta) with Play Framework. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index 9425f8f5c97..1befd28b70e 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -1,8 +1,16 @@ --- -title: Config Options for scala-sttp -sidebar_label: scala-sttp +title: Documentation for the scala-sttp Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scala-sttp | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Scala client library (beta) based on Sttp. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index 9159c798f23..56bef75b6cc 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -1,8 +1,16 @@ --- -title: Config Options for scalatra -sidebar_label: scalatra +title: Documentation for the scalatra Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scalatra | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Scala server application with Scalatra. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 18520f5e3b3..7c356c9f8e2 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -1,8 +1,16 @@ --- -title: Config Options for scalaz -sidebar_label: scalaz +title: Documentation for the scalaz Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | scalaz | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Scalaz client library (beta) that uses http4s | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 34e4a6a266c..7623c432a75 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -1,8 +1,16 @@ --- -title: Config Options for spring -sidebar_label: spring +title: Documentation for the spring Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | spring | pass this to the generate command after -g | +| generator type | SERVER | | +| helpTxt | Generates a Java SpringBoot Server application using the SpringFox integration. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md index cf1e1f65df4..7743ddf5a45 100644 --- a/docs/generators/swift4-deprecated.md +++ b/docs/generators/swift4-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for swift4-deprecated -sidebar_label: swift4-deprecated +title: Documentation for the swift4-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | swift4-deprecated | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.) | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 95f50fca7fc..cb5ea31e124 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -1,8 +1,16 @@ --- -title: Config Options for swift5 -sidebar_label: swift5 +title: Documentation for the swift5 Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | swift5 | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a Swift 5.x client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 9421c54646e..accefab18e0 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-angular -sidebar_label: typescript-angular +title: Documentation for the typescript-angular Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-angular | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript Angular (6.x - 13.x) client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index c094849a078..bcacd72ecb8 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-angularjs-deprecated -sidebar_label: typescript-angularjs-deprecated +title: Documentation for the typescript-angularjs-deprecated Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-angularjs-deprecated | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript AngularJS client library. This generator has been deprecated and will be removed in the future release. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 23b71ae41a3..0632ee05eb0 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-aurelia -sidebar_label: typescript-aurelia +title: Documentation for the typescript-aurelia Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-aurelia | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript client library for the Aurelia framework (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index d489756bacb..00bd32f9535 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-axios -sidebar_label: typescript-axios +title: Documentation for the typescript-axios Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-axios | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript client library using axios. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 3fe83380da4..b272b0bb2bf 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-fetch -sidebar_label: typescript-fetch +title: Documentation for the typescript-fetch Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-fetch | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript client library using Fetch API (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 21e44eac43f..5834880e4a4 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-inversify -sidebar_label: typescript-inversify +title: Documentation for the typescript-inversify Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-inversify | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates Typescript services using Inversify IOC | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 030fdd2e572..e9469f20589 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-jquery -sidebar_label: typescript-jquery +title: Documentation for the typescript-jquery Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-jquery | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript jquery client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index a3f0b52a05d..0619d801227 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-nestjs -sidebar_label: typescript-nestjs +title: Documentation for the typescript-nestjs Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-nestjs | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript Nestjs 6.x client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index 5de27045312..b2afd57352d 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-node -sidebar_label: typescript-node +title: Documentation for the typescript-node Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-node | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript NodeJS client library. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index f2266c09703..022f22d8c5e 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-redux-query -sidebar_label: typescript-redux-query +title: Documentation for the typescript-redux-query Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-redux-query | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript client library using redux-query API (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 40921ae7f58..52ed0e12ef0 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript-rxjs -sidebar_label: typescript-rxjs +title: Documentation for the typescript-rxjs Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript-rxjs | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript client library using Rxjs API. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index 9c6eea23c03..3aae708a3bd 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -1,8 +1,16 @@ --- -title: Config Options for typescript -sidebar_label: typescript +title: Documentation for the typescript Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | typescript | pass this to the generate command after -g | +| generator type | CLIENT | | +| helpTxt | Generates a TypeScript client library using Fetch API (beta). | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index a2af1139862..47c95920be5 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -1,8 +1,16 @@ --- -title: Config Options for wsdl-schema -sidebar_label: wsdl-schema +title: Documentation for the wsdl-schema Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | wsdl-schema | pass this to the generate command after -g | +| generator type | SCHEMA | | +| helpTxt | Generates WSDL files. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 8193e20e3f4..3c61526cddc 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -70,6 +70,9 @@ public class ConfigHelp extends OpenApiGeneratorCommand { @Option(name = {"--import-mappings"}, title = "import mappings", description = "displays the default import mappings (types and aliases, and what imports they will pull into the template)") private Boolean importMappings; + @Option(name = {"--metadata"}, title = "metadata", description = "displays the generator metadata like the help txt for the generator and generator type etc") + private Boolean metadata; + @Option(name = {"--language-specific-primitive"}, title = "language specific primitives", description = "displays the language specific primitives (types which require no additional imports, or which may conflict with user defined model names)") private Boolean languageSpecificPrimitives; @@ -104,6 +107,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand { languageSpecificPrimitives = Boolean.TRUE; importMappings = Boolean.TRUE; featureSets = Boolean.TRUE; + metadata = Boolean.TRUE; } try { @@ -153,26 +157,8 @@ public class ConfigHelp extends OpenApiGeneratorCommand { } } - private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { - if (Boolean.TRUE.equals(markdownHeader)) { - sb.append("---").append(newline); - sb.append("title: Config Options for ").append(generatorName).append(newline); - sb.append("sidebar_label: ").append(generatorName).append(newline); - sb.append("---").append(newline); - sb.append(newline); - sb.append("These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details."); - sb.append(newline); - } else { - sb.append(newline); - sb.append("## CONFIG OPTIONS"); - - if (Boolean.TRUE.equals(namedHeader)) { - sb.append(" for ").append(generatorName).append("").append(newline); - } - } - + private void generateMdConfigOptions(StringBuilder sb, CodegenConfig config) { sb.append(newline); - sb.append("| Option | Description | Values | Default |").append(newline); sb.append("| ------ | ----------- | ------ | ------- |").append(newline); @@ -210,90 +196,152 @@ public class ConfigHelp extends OpenApiGeneratorCommand { // default sb.append(escapeHtml4(langCliOption.getDefault())).append("|").append(newline); }); + } + private void generateMdImportMappings(StringBuilder sb, CodegenConfig config) { + sb.append(newline).append("## IMPORT MAPPING").append(newline).append(newline); + + sb.append("| Type/Alias | Imports |").append(newline); + sb.append("| ---------- | ------- |").append(newline); + + config.importMapping() + .entrySet() + .stream() + .sorted(Map.Entry.comparingByKey()) + .forEachOrdered(kvp -> { + sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); + sb.append(newline); + }); + + sb.append(newline); + } + + private void generateMdInstantiationTypes(StringBuilder sb, CodegenConfig config) { + sb.append(newline).append("## INSTANTIATION TYPES").append(newline).append(newline); + + sb.append("| Type/Alias | Instantiated By |").append(newline); + sb.append("| ---------- | --------------- |").append(newline); + + config.instantiationTypes() + .entrySet() + .stream() + .sorted(Map.Entry.comparingByKey()) + .forEachOrdered(kvp -> { + sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); + sb.append(newline); + }); + + sb.append(newline); + } + + private void generateMdLanguageSpecificPrimitives(StringBuilder sb, CodegenConfig config) { + sb.append(newline).append("## LANGUAGE PRIMITIVES").append(newline).append(newline); + + sb.append("

    ").append(newline); + config.languageSpecificPrimitives() + .stream() + .sorted(String::compareTo) + .forEach(s -> sb.append("
  • ").append(escapeHtml4(s)).append("
  • ").append(newline)); + sb.append("
").append(newline); + } + + private void generateMdReservedWords(StringBuilder sb, CodegenConfig config) { + sb.append(newline).append("## RESERVED WORDS").append(newline).append(newline); + + sb.append("
    ").append(newline); + config.reservedWords() + .stream() + .sorted(String::compareTo) + .forEach(s -> sb.append("
  • ").append(escapeHtml4(s)).append("
  • ").append(newline)); + sb.append("
").append(newline); + } + + private void generateMdFeatureSets(StringBuilder sb, CodegenConfig config) { + sb.append(newline).append("## FEATURE SET").append(newline).append(newline); + + List flattened = config.getGeneratorMetadata().getFeatureSet().flatten(); + flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory)); + + AtomicReference lastCategory = new AtomicReference<>(); + flattened.forEach(featureSet -> { + if (!featureSet.getFeatureCategory().equals(lastCategory.get())) { + lastCategory.set(featureSet.getFeatureCategory()); + + String[] header = StringUtils.splitByCharacterTypeCamelCase(featureSet.getFeatureCategory()); + sb.append(newline).append("### ").append(StringUtils.join(header, " ")).append(newline); + + sb.append("| Name | Supported | Defined By |").append(newline); + sb.append("| ---- | --------- | ---------- |").append(newline); + } + + // Appends a ✓ or ✗ for support + sb.append("|").append(featureSet.getFeatureName()) + .append("|").append(featureSet.isSupported() ? "✓" : "✗") + .append("|").append(StringUtils.join(featureSet.getSource(), ",")) + .append(newline); + }); + } + + private void generateMdConfigOptionsHeader(StringBuilder sb, CodegenConfig config) { + if (Boolean.TRUE.equals(markdownHeader)) { + sb.append("## CONFIG OPTIONS").append(newline); + sb.append("These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details."); + sb.append(newline); + } else { + sb.append(newline); + sb.append("## CONFIG OPTIONS"); + + if (Boolean.TRUE.equals(namedHeader)) { + sb.append(" for ").append(generatorName).append("").append(newline); + } + } + } + + private void generateMdMetadata(StringBuilder sb, CodegenConfig config) { + sb.append("## METADATA").append(newline).append(newline); + + sb.append("| Property | Value | Notes |").append(newline); + sb.append("| -------- | ----- | ----- |").append(newline); + sb.append("| generator name | "+config.getName()+" | pass this to the generate command after -g |").append(newline); + sb.append("| generator type | "+config.getTag()+" | |").append(newline); + sb.append("| helpTxt | "+config.getHelp()+" | |").append(newline); + + sb.append(newline); + } + + private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { + if (Boolean.TRUE.equals(markdownHeader)) { + sb.append("---").append(newline); + sb.append("title: Documentation for the " + generatorName + " Generator").append(newline); + sb.append("---").append(newline); + sb.append(newline); + } + + if (Boolean.TRUE.equals(metadata)) { + generateMdMetadata(sb, config); + } + + generateMdConfigOptionsHeader(sb, config); + generateMdConfigOptions(sb, config); if (Boolean.TRUE.equals(importMappings)) { - sb.append(newline).append("## IMPORT MAPPING").append(newline).append(newline); - - sb.append("| Type/Alias | Imports |").append(newline); - sb.append("| ---------- | ------- |").append(newline); - - config.importMapping() - .entrySet() - .stream() - .sorted(Map.Entry.comparingByKey()) - .forEachOrdered(kvp -> { - sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); - sb.append(newline); - }); - - sb.append(newline); + generateMdImportMappings(sb, config); } if (Boolean.TRUE.equals(instantiationTypes)) { - sb.append(newline).append("## INSTANTIATION TYPES").append(newline).append(newline); - - sb.append("| Type/Alias | Instantiated By |").append(newline); - sb.append("| ---------- | --------------- |").append(newline); - - config.instantiationTypes() - .entrySet() - .stream() - .sorted(Map.Entry.comparingByKey()) - .forEachOrdered(kvp -> { - sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); - sb.append(newline); - }); - - sb.append(newline); + generateMdInstantiationTypes(sb, config); } if (Boolean.TRUE.equals(languageSpecificPrimitives)) { - sb.append(newline).append("## LANGUAGE PRIMITIVES").append(newline).append(newline); - - sb.append("
    ").append(newline); - config.languageSpecificPrimitives() - .stream() - .sorted(String::compareTo) - .forEach(s -> sb.append("
  • ").append(escapeHtml4(s)).append("
  • ").append(newline)); - sb.append("
").append(newline); + generateMdLanguageSpecificPrimitives(sb, config); } if (Boolean.TRUE.equals(reservedWords)) { - sb.append(newline).append("## RESERVED WORDS").append(newline).append(newline); - - sb.append("
    ").append(newline); - config.reservedWords() - .stream() - .sorted(String::compareTo) - .forEach(s -> sb.append("
  • ").append(escapeHtml4(s)).append("
  • ").append(newline)); - sb.append("
").append(newline); + generateMdReservedWords(sb, config); } if (Boolean.TRUE.equals(featureSets)) { - sb.append(newline).append("## FEATURE SET").append(newline).append(newline); - - List flattened = config.getGeneratorMetadata().getFeatureSet().flatten(); - flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory)); - - AtomicReference lastCategory = new AtomicReference<>(); - flattened.forEach(featureSet -> { - if (!featureSet.getFeatureCategory().equals(lastCategory.get())) { - lastCategory.set(featureSet.getFeatureCategory()); - - String[] header = StringUtils.splitByCharacterTypeCamelCase(featureSet.getFeatureCategory()); - sb.append(newline).append("### ").append(StringUtils.join(header, " ")).append(newline); - - sb.append("| Name | Supported | Defined By |").append(newline); - sb.append("| ---- | --------- | ---------- |").append(newline); - } - - // Appends a ✓ or ✗ for support - sb.append("|").append(featureSet.getFeatureName()) - .append("|").append(featureSet.isSupported() ? "✓" : "✗") - .append("|").append(StringUtils.join(featureSet.getSource(), ",")) - .append(newline); - }); + generateMdFeatureSets(sb, config); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 187ae357e02..cc985490ae9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -499,7 +499,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { @Override public String getHelp() { String newLine = System.getProperty("line.separator"); - return String.join(newLine, + return String.join("
", "Generates a Python client library", "", "Features in this generator:", From a4325ec5205b68298fcc66b9e85927aa64d840ff Mon Sep 17 00:00:00 2001 From: Sorin Florea <30589784+sorin-florea@users.noreply.github.com> Date: Mon, 10 Jan 2022 15:23:28 +0200 Subject: [PATCH 020/113] ISSUE-11242: Fix Java native path param encoding (#11257) --- .../Java/libraries/native/ApiClient.mustache | 2 +- .../codegen/java/JavaClientCodegenTest.java | 32 +++++++++++++++- .../src/test/resources/3_0/issue11242.yaml | 37 +++++++++++++++++++ .../org/openapitools/client/ApiClient.java | 2 +- .../org/openapitools/client/ApiClient.java | 2 +- 5 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue11242.yaml diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 97714723810..03fe2a46841 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -76,7 +76,7 @@ public class ApiClient { * @return URL-encoded representation of the input string. */ public static String urlEncode(String s) { - return URLEncoder.encode(s, UTF_8); + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } /** diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 2e25fa70a24..1d326861f0a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -1170,7 +1170,7 @@ public class JavaClientCodegenTest { "formParams.add(\"file\", file);" ); } - + /** * See https://github.com/OpenAPITools/openapi-generator/issues/8352 */ @@ -1228,4 +1228,34 @@ public class JavaClientCodegenTest { final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); TestUtils.assertFileContains(defaultApi, "value instanceof Map"); } + + /** + * See https://github.com/OpenAPITools/openapi-generator/issues/11242 + */ + @Test + public void testNativeClientWhiteSpacePathParamEncoding() throws IOException { + Map properties = new HashMap<>(); + properties.put(JavaClientCodegen.JAVA8_MODE, true); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/issue11242.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + Assert.assertEquals(files.size(), 34); + validateJavaSourceFiles(files); + + TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), + "public static String urlEncode(String s) { return URLEncoder.encode(s, UTF_8).replaceAll(\"\\\\+\", \"%20\"); }"); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue11242.yaml b/modules/openapi-generator/src/test/resources/3_0/issue11242.yaml new file mode 100644 index 00000000000..ee27ec7f33b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue11242.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.3 +info: + title: Issue 11242 - Path Param encoding + description: "White space encoding in path parameters" + version: "1.0.0" +servers: + - url: localhost:8080 +paths: + /api/{someParam}: + parameters: + - in: path + name: someParam + schema: + type: string + required: true + description: Some parameter. + get: + operationId: GetSomeParam + summary: View some param + responses: + '200': + description: Some return value + content: + application/json: + schema: + $ref: '#/components/schemas/SomeReturnValue' + example: + someParam: someValue +components: + schemas: + SomeReturnValue: + type: object + required: + - someParam + properties: + someParam: + type: string diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java index 9d108d594e4..f39fd0a344b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java @@ -81,7 +81,7 @@ public class ApiClient { * @return URL-encoded representation of the input string. */ public static String urlEncode(String s) { - return URLEncoder.encode(s, UTF_8); + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index 9d108d594e4..f39fd0a344b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -81,7 +81,7 @@ public class ApiClient { * @return URL-encoded representation of the input string. */ public static String urlEncode(String s) { - return URLEncoder.encode(s, UTF_8); + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } /** From dd3bba8c9442f2ee40d6ea8f0872ab0be43714b9 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 10 Jan 2022 08:59:20 -0800 Subject: [PATCH 021/113] Has generators set default template engine (#11245) * Adds default template engine to generators * Fixes sample batch generation --- bin/configs/python-experimental.yaml | 1 - .../codegen/config/WorkflowSettings.java | 2 +- .../org/openapitools/codegen/CodegenConfig.java | 2 ++ .../openapitools/codegen/DefaultCodegen.java | 5 +++++ .../codegen/config/CodegenConfigurator.java | 17 +++++++++++++---- .../PythonExperimentalClientCodegen.java | 5 +++++ 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml index 1a8ea6e002c..dd204f44938 100644 --- a/bin/configs/python-experimental.yaml +++ b/bin/configs/python-experimental.yaml @@ -2,7 +2,6 @@ generatorName: python-experimental outputDir: samples/openapi3/client/petstore/python-experimental inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/python-experimental -templatingEngineName: handlebars additionalProperties: packageName: petstore_api recursionLimit: "1234" 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 e2feddb9822..64e426fa68a 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 @@ -46,7 +46,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 boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false; - public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; + public static final String DEFAULT_TEMPLATING_ENGINE_NAME = null; // this is set by the generator public static final Map DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>()); private String inputSpec; 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 5dc77787e60..17b9b978259 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 @@ -304,4 +304,6 @@ public interface CodegenConfig { void setRemoveEnumValuePrefix(boolean removeEnumValuePrefix); Schema unaliasSchema(Schema schema, Map usedImportMappings); + + public String defaultTemplatingEngine(); } 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 1af3ddbba39..1a9d09441c0 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 @@ -7356,4 +7356,9 @@ public class DefaultCodegen implements CodegenConfig { } return xOf; } + + @Override + public String defaultTemplatingEngine() { + return "mustache"; + } } 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 b5bd0b23c33..9eb6f558ef7 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 @@ -91,11 +91,18 @@ public class CodegenConfigurator { WorkflowSettings workflowSettings = settings.getWorkflowSettings(); List userDefinedTemplateSettings = settings.getFiles(); + CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName()); + String templatingEngineName = workflowSettings.getTemplatingEngineName(); + if (isEmpty(templatingEngineName)) { + // if templatingEngineName is empty check the config for a default + templatingEngineName = config.defaultTemplatingEngine(); + } + // We copy "cached" properties into configurator so it is appropriately configured with all settings in external files. // FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings. configurator.generatorName = generatorSettings.getGeneratorName(); configurator.inputSpec = workflowSettings.getInputSpec(); - configurator.templatingEngineName = workflowSettings.getTemplatingEngineName(); + configurator.templatingEngineName = templatingEngineName; if (workflowSettings.getGlobalProperties() != null) { configurator.globalProperties.putAll(workflowSettings.getGlobalProperties()); } @@ -482,15 +489,17 @@ public class CodegenConfigurator { Validate.notEmpty(generatorName, "generator name must be specified"); Validate.notEmpty(inputSpec, "input spec must be specified"); + GeneratorSettings generatorSettings = generatorSettingsBuilder.build(); + CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName()); if (isEmpty(templatingEngineName)) { - // Built-in templates are mustache, but allow users to use a simplified handlebars engine for their custom templates. - workflowSettingsBuilder.withTemplatingEngineName("mustache"); + // if templatingEngineName is empty check the config for a default + String defaultTemplatingEngine = config.defaultTemplatingEngine(); + workflowSettingsBuilder.withTemplatingEngineName(defaultTemplatingEngine); } else { workflowSettingsBuilder.withTemplatingEngineName(templatingEngineName); } // at this point, all "additionalProperties" are set, and are now immutable per GeneratorSettings instance. - GeneratorSettings generatorSettings = generatorSettingsBuilder.build(); WorkflowSettings workflowSettings = workflowSettingsBuilder.build(); if (workflowSettings.isVerbose()) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index cc985490ae9..6d1aebdac02 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -2075,4 +2075,9 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { } return co; } + + @Override + public String defaultTemplatingEngine() { + return "handlebars"; + } } From 0eca6291275394dab1bff79c9b4b6737202a9be9 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 10 Jan 2022 12:13:35 -0800 Subject: [PATCH 022/113] Adds generatorLanguage to all generators (#11268) * Adds generatorLanguage to all generators * Adds all generator languages and info to docs * Docs updated --- docs/generators/ada-server.md | 1 + docs/generators/ada.md | 1 + docs/generators/android.md | 1 + docs/generators/apache2.md | 1 + docs/generators/apex.md | 1 + docs/generators/asciidoc.md | 1 + docs/generators/aspnetcore.md | 1 + docs/generators/avro-schema.md | 1 + docs/generators/bash.md | 1 + docs/generators/c.md | 1 + docs/generators/clojure.md | 1 + docs/generators/cpp-pistache-server.md | 1 + docs/generators/cpp-qt-client.md | 1 + docs/generators/cpp-qt-qhttpengine-server.md | 1 + docs/generators/cpp-restbed-server.md | 1 + docs/generators/cpp-restsdk.md | 1 + docs/generators/cpp-tiny.md | 1 + docs/generators/cpp-tizen.md | 1 + docs/generators/cpp-ue4.md | 1 + docs/generators/crystal.md | 1 + docs/generators/csharp-dotnet2.md | 1 + docs/generators/csharp-nancyfx.md | 1 + docs/generators/csharp-netcore-functions.md | 1 + docs/generators/csharp-netcore.md | 1 + docs/generators/csharp.md | 1 + docs/generators/dart-dio-next.md | 1 + docs/generators/dart-dio.md | 1 + docs/generators/dart-jaguar.md | 1 + docs/generators/dart.md | 1 + docs/generators/eiffel.md | 1 + docs/generators/elixir.md | 1 + docs/generators/elm.md | 1 + docs/generators/erlang-client.md | 1 + docs/generators/erlang-proper.md | 1 + docs/generators/erlang-server.md | 1 + docs/generators/flash-deprecated.md | 1 + docs/generators/fsharp-functions.md | 1 + docs/generators/fsharp-giraffe-server.md | 1 + docs/generators/go-deprecated.md | 1 + docs/generators/go-echo-server.md | 1 + docs/generators/go-gin-server.md | 1 + docs/generators/go-server.md | 1 + docs/generators/go.md | 1 + .../graphql-nodejs-express-server.md | 1 + docs/generators/graphql-schema.md | 1 + docs/generators/groovy.md | 1 + docs/generators/haskell-http-client.md | 1 + docs/generators/haskell-yesod.md | 1 + docs/generators/haskell.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/javascript-apollo.md | 1 + docs/generators/javascript-closure-angular.md | 1 + docs/generators/javascript-flowtyped.md | 1 + docs/generators/javascript.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/jmeter.md | 1 + docs/generators/k6.md | 1 + docs/generators/kotlin-server-deprecated.md | 1 + docs/generators/kotlin-server.md | 1 + docs/generators/kotlin-spring.md | 1 + docs/generators/kotlin-vertx.md | 1 + docs/generators/kotlin.md | 1 + docs/generators/ktorm-schema.md | 1 + docs/generators/lua.md | 1 + docs/generators/mysql-schema.md | 1 + docs/generators/nim.md | 1 + docs/generators/nodejs-express-server.md | 1 + docs/generators/objc.md | 1 + docs/generators/ocaml.md | 1 + docs/generators/perl.md | 1 + docs/generators/php-dt.md | 1 + docs/generators/php-laravel.md | 1 + docs/generators/php-lumen.md | 1 + docs/generators/php-mezzio-ph.md | 1 + docs/generators/php-silex-deprecated.md | 1 + docs/generators/php-slim-deprecated.md | 1 + docs/generators/php-slim4.md | 1 + docs/generators/php-symfony.md | 1 + docs/generators/php.md | 1 + docs/generators/powershell.md | 1 + docs/generators/protobuf-schema.md | 1 + docs/generators/python-aiohttp.md | 1 + docs/generators/python-blueplanet.md | 1 + docs/generators/python-experimental.md | 1 + docs/generators/python-fastapi.md | 1 + docs/generators/python-flask.md | 1 + docs/generators/python-legacy.md | 1 + docs/generators/python.md | 1 + docs/generators/r.md | 1 + docs/generators/ruby-on-rails.md | 1 + docs/generators/ruby-sinatra.md | 1 + docs/generators/ruby.md | 1 + docs/generators/rust-server.md | 1 + docs/generators/rust.md | 1 + docs/generators/scala-akka-http-server.md | 1 + docs/generators/scala-akka.md | 1 + docs/generators/scala-finch.md | 1 + docs/generators/scala-gatling.md | 1 + .../generators/scala-httpclient-deprecated.md | 1 + docs/generators/scala-lagom-server.md | 1 + docs/generators/scala-play-server.md | 1 + docs/generators/scala-sttp.md | 1 + docs/generators/scalatra.md | 1 + docs/generators/scalaz.md | 1 + docs/generators/spring.md | 1 + docs/generators/swift4-deprecated.md | 1 + docs/generators/swift5.md | 1 + docs/generators/typescript-angular.md | 1 + .../typescript-angularjs-deprecated.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-nestjs.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + docs/generators/typescript.md | 1 + docs/generators/wsdl-schema.md | 1 + .../openapitools/codegen/cmd/ConfigHelp.java | 3 ++ .../openapitools/codegen/CodegenConfig.java | 2 + .../openapitools/codegen/DefaultCodegen.java | 3 ++ .../codegen/GeneratorLanguage.java | 48 +++++++++++++++++++ .../codegen/languages/AbstractAdaCodegen.java | 3 ++ .../languages/AbstractCSharpCodegen.java | 3 ++ .../codegen/languages/AbstractCppCodegen.java | 10 ++-- .../languages/AbstractDartCodegen.java | 3 ++ .../languages/AbstractEiffelCodegen.java | 2 + .../languages/AbstractFSharpCodegen.java | 3 ++ .../codegen/languages/AbstractGoCodegen.java | 3 ++ .../languages/AbstractKotlinCodegen.java | 3 ++ .../codegen/languages/AbstractPhpCodegen.java | 3 ++ .../languages/AbstractPythonCodegen.java | 3 ++ .../languages/AbstractRubyCodegen.java | 4 ++ .../languages/AbstractScalaCodegen.java | 2 + .../AbstractTypeScriptClientCodegen.java | 3 ++ .../codegen/languages/ApexClientCodegen.java | 4 +- .../codegen/languages/BashClientCodegen.java | 2 + .../languages/CLibcurlClientCodegen.java | 3 ++ .../languages/ClojureClientCodegen.java | 3 ++ .../languages/ConfluenceWikiCodegen.java | 3 ++ .../languages/CrystalClientCodegen.java | 3 ++ .../languages/ElixirClientCodegen.java | 3 ++ .../codegen/languages/ElmClientCodegen.java | 3 ++ .../languages/ErlangClientCodegen.java | 3 ++ .../languages/ErlangProperCodegen.java | 3 ++ .../languages/ErlangServerCodegen.java | 3 ++ .../codegen/languages/FlashClientCodegen.java | 3 ++ .../GraphQLNodeJSExpressServerCodegen.java | 3 ++ .../languages/GraphQLSchemaCodegen.java | 8 ++-- .../languages/GroovyClientCodegen.java | 8 ++-- .../languages/HaskellHttpClientCodegen.java | 3 ++ .../languages/HaskellServantCodegen.java | 3 ++ .../languages/HaskellYesodServerCodegen.java | 3 ++ .../JavascriptApolloClientCodegen.java | 3 ++ .../languages/JavascriptClientCodegen.java | 3 ++ ...JavascriptClosureAngularClientCodegen.java | 3 ++ .../JavascriptFlowtypedClientCodegen.java | 2 + .../codegen/languages/K6ClientCodegen.java | 13 ++--- .../codegen/languages/KtormSchemaCodegen.java | 2 + .../codegen/languages/LuaClientCodegen.java | 3 ++ .../MarkdownDocumentationCodegen.java | 10 ++-- .../codegen/languages/MysqlSchemaCodegen.java | 3 ++ .../codegen/languages/NimClientCodegen.java | 3 ++ .../languages/NodeJSExpressServerCodegen.java | 3 ++ .../codegen/languages/OCamlClientCodegen.java | 3 ++ .../codegen/languages/ObjcClientCodegen.java | 2 + .../codegen/languages/OpenAPIGenerator.java | 3 ++ .../languages/OpenAPIYamlGenerator.java | 2 + .../codegen/languages/PerlClientCodegen.java | 3 ++ .../languages/PhpSilexServerCodegen.java | 2 + .../PlantumlDocumentationCodegen.java | 3 ++ .../languages/PowerShellClientCodegen.java | 3 ++ .../languages/ProtobufSchemaCodegen.java | 3 ++ .../codegen/languages/RClientCodegen.java | 2 + .../codegen/languages/RustClientCodegen.java | 3 ++ .../codegen/languages/RustServerCodegen.java | 3 ++ .../languages/ScalaFinchServerCodegen.java | 2 + .../codegen/languages/StaticDocCodegen.java | 3 ++ .../languages/StaticHtml2Generator.java | 3 ++ .../languages/StaticHtmlGenerator.java | 2 + .../codegen/languages/Swift4Codegen.java | 3 ++ .../languages/Swift5ClientCodegen.java | 3 ++ .../languages/TypeScriptClientCodegen.java | 3 ++ .../codegen/languages/WsdlSchemaCodegen.java | 3 ++ 201 files changed, 371 insertions(+), 31 deletions(-) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index ae41a6fb725..bda2ebc4d61 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -8,6 +8,7 @@ title: Documentation for the ada-server Generator | -------- | ----- | ----- | | generator name | ada-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Ada | | | helpTxt | Generates an Ada server implementation (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/ada.md b/docs/generators/ada.md index ba6a764ac31..c7fc549290a 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -8,6 +8,7 @@ title: Documentation for the ada Generator | -------- | ----- | ----- | | generator name | ada | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Ada | | | helpTxt | Generates an Ada client implementation (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/android.md b/docs/generators/android.md index 53bde3fa486..78336829f03 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -8,6 +8,7 @@ title: Documentation for the android Generator | -------- | ----- | ----- | | generator name | android | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Java | | | helpTxt | Generates an Android client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index c31d64f4986..9f5cfa8ed6c 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -8,6 +8,7 @@ title: Documentation for the apache2 Generator | -------- | ----- | ----- | | generator name | apache2 | pass this to the generate command after -g | | generator type | CONFIG | | +| generator language | Java | | | helpTxt | Generates an Apache2 Config file with the permissions | | ## CONFIG OPTIONS diff --git a/docs/generators/apex.md b/docs/generators/apex.md index 5610d51d22e..7fc192390fa 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -8,6 +8,7 @@ title: Documentation for the apex Generator | -------- | ----- | ----- | | generator name | apex | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Apex | | | helpTxt | Generates an Apex API client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index a3b4795a2c8..815a5eea266 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -8,6 +8,7 @@ title: Documentation for the asciidoc Generator | -------- | ----- | ----- | | generator name | asciidoc | pass this to the generate command after -g | | generator type | DOCUMENTATION | | +| generator language | Java | | | helpTxt | Generates asciidoc markup based documentation. | | ## CONFIG OPTIONS diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index cebbaf9a870..f97033ac35a 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -8,6 +8,7 @@ title: Documentation for the aspnetcore Generator | -------- | ----- | ----- | | generator name | aspnetcore | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | C# | | | helpTxt | Generates an ASP.NET Core Web API server. | | ## CONFIG OPTIONS diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index 506aca5d85b..ce8261b0701 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -8,6 +8,7 @@ title: Documentation for the avro-schema Generator | -------- | ----- | ----- | | generator name | avro-schema | pass this to the generate command after -g | | generator type | SCHEMA | | +| generator language | Java | | | helpTxt | Generates a Avro model (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/bash.md b/docs/generators/bash.md index 524c9534fa5..3356189af73 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -8,6 +8,7 @@ title: Documentation for the bash Generator | -------- | ----- | ----- | | generator name | bash | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Bash | | | helpTxt | Generates a Bash client script based on cURL. | | ## CONFIG OPTIONS diff --git a/docs/generators/c.md b/docs/generators/c.md index 3eb885a9a11..d7006f36cc9 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -8,6 +8,7 @@ title: Documentation for the c Generator | -------- | ----- | ----- | | generator name | c | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C | | | helpTxt | Generates a C (libcurl) client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index 2f5fadc54c9..7cc512620ed 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -8,6 +8,7 @@ title: Documentation for the clojure Generator | -------- | ----- | ----- | | generator name | clojure | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Clojure | | | helpTxt | Generates a Clojure client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index d58a5f17572..f9c171feeeb 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-pistache-server Generator | -------- | ----- | ----- | | generator name | cpp-pistache-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | C++ | | | helpTxt | Generates a C++ API server (based on Pistache) | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 8ad0c33d85c..f26b827b8d4 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-qt-client Generator | -------- | ----- | ----- | | generator name | cpp-qt-client | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C++ | | | helpTxt | Generates a Qt C++ client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index 99dbeca8759..42d3f4c7e04 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-qt-qhttpengine-server Generator | -------- | ----- | ----- | | generator name | cpp-qt-qhttpengine-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | C++ | | | helpTxt | Generates a Qt C++ Server using the QHTTPEngine HTTP Library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-restbed-server.md b/docs/generators/cpp-restbed-server.md index 193e11cc92d..065ead399b7 100644 --- a/docs/generators/cpp-restbed-server.md +++ b/docs/generators/cpp-restbed-server.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-restbed-server Generator | -------- | ----- | ----- | | generator name | cpp-restbed-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | C++ | | | helpTxt | Generates a C++ API Server with Restbed (https://github.com/Corvusoft/restbed). | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index 480178fdf62..fa04e41dcd7 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-restsdk Generator | -------- | ----- | ----- | | generator name | cpp-restsdk | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C++ | | | helpTxt | Generates a C++ API client with C++ REST SDK (https://github.com/Microsoft/cpprestsdk). | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index 006561e38f7..e669c1ad7c4 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-tiny Generator | -------- | ----- | ----- | | generator name | cpp-tiny | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C++ | | | helpTxt | Generates a C++ Arduino REST API client. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index 4f40b91b7d3..0528620b776 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-tizen Generator | -------- | ----- | ----- | | generator name | cpp-tizen | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C++ | | | helpTxt | Generates a Samsung Tizen C++ client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index a2961af1612..56eb1c96799 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -8,6 +8,7 @@ title: Documentation for the cpp-ue4 Generator | -------- | ----- | ----- | | generator name | cpp-ue4 | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C++ | | | helpTxt | Generates a Unreal Engine 4 C++ Module (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index eaacb566be9..d44e727ddbb 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -8,6 +8,7 @@ title: Documentation for the crystal Generator | -------- | ----- | ----- | | generator name | crystal | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Crystal | | | helpTxt | Generates a Crystal client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md index b1d47b73ac6..22fbde9e287 100644 --- a/docs/generators/csharp-dotnet2.md +++ b/docs/generators/csharp-dotnet2.md @@ -8,6 +8,7 @@ title: Documentation for the csharp-dotnet2 Generator | -------- | ----- | ----- | | generator name | csharp-dotnet2 | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C# | | | helpTxt | Generates a C# .Net 2.0 client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx.md index b8b5928ed63..c20541a52f9 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx.md @@ -8,6 +8,7 @@ title: Documentation for the csharp-nancyfx Generator | -------- | ----- | ----- | | generator name | csharp-nancyfx | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | C# | | | helpTxt | Generates a C# NancyFX Web API server. | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md index 6d856577317..888ada38128 100644 --- a/docs/generators/csharp-netcore-functions.md +++ b/docs/generators/csharp-netcore-functions.md @@ -8,6 +8,7 @@ title: Documentation for the csharp-netcore-functions Generator | -------- | ----- | ----- | | generator name | csharp-netcore-functions | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | C# | | | helpTxt | Generates a csharp server. | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 33b124200fb..57d4e3ac2b6 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -8,6 +8,7 @@ title: Documentation for the csharp-netcore Generator | -------- | ----- | ----- | | generator name | csharp-netcore | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C# | | | helpTxt | Generates a C# client library (.NET Standard, .NET Core). | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index c925eecc8e7..2a61a6fa326 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -8,6 +8,7 @@ title: Documentation for the csharp Generator | -------- | ----- | ----- | | generator name | csharp | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | C# | | | helpTxt | Generates a CSharp client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index 07b20e71d1a..157fb47af53 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -8,6 +8,7 @@ title: Documentation for the dart-dio-next Generator | -------- | ----- | ----- | | generator name | dart-dio-next | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Dart | | | helpTxt | Generates a Dart Dio client library with null-safety. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 77aeaab2538..2ef52cbffe4 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -8,6 +8,7 @@ title: Documentation for the dart-dio Generator | -------- | ----- | ----- | | generator name | dart-dio | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Dart | | | helpTxt | Generates a Dart Dio client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 1cbdd8bad48..7bae4db6903 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -8,6 +8,7 @@ title: Documentation for the dart-jaguar Generator | -------- | ----- | ----- | | generator name | dart-jaguar | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Dart | | | helpTxt | Generates a Dart Jaguar client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 7793319b30f..0193acff4a9 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -8,6 +8,7 @@ title: Documentation for the dart Generator | -------- | ----- | ----- | | generator name | dart | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Dart | | | helpTxt | Generates a Dart 2.x client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/eiffel.md b/docs/generators/eiffel.md index 151654c6f14..b9406ac1f60 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -8,6 +8,7 @@ title: Documentation for the eiffel Generator | -------- | ----- | ----- | | generator name | eiffel | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Eiffel | | | helpTxt | Generates a Eiffel client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index 2a6d9d93e4c..74447410848 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -8,6 +8,7 @@ title: Documentation for the elixir Generator | -------- | ----- | ----- | | generator name | elixir | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Elixir | | | helpTxt | Generates an elixir client library (alpha). | | ## CONFIG OPTIONS diff --git a/docs/generators/elm.md b/docs/generators/elm.md index 79ff7df2e32..c26c96f85eb 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -8,6 +8,7 @@ title: Documentation for the elm Generator | -------- | ----- | ----- | | generator name | elm | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Elm | | | helpTxt | Generates an Elm client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/erlang-client.md b/docs/generators/erlang-client.md index 3436fc2faad..afa0291fd21 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -8,6 +8,7 @@ title: Documentation for the erlang-client Generator | -------- | ----- | ----- | | generator name | erlang-client | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Erlang | | | helpTxt | Generates an Erlang client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 0a50ff9c285..48571920cfd 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -8,6 +8,7 @@ title: Documentation for the erlang-proper Generator | -------- | ----- | ----- | | generator name | erlang-proper | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Erlang | | | helpTxt | Generates an Erlang library with PropEr generators (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/erlang-server.md b/docs/generators/erlang-server.md index c6bbba108b4..15a38755f5a 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -8,6 +8,7 @@ title: Documentation for the erlang-server Generator | -------- | ----- | ----- | | generator name | erlang-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Erlang | | | helpTxt | Generates an Erlang server library (beta) using OpenAPI Generator (https://openapi-generator.tech). By default, it will also generate service classes, which can be disabled with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/flash-deprecated.md b/docs/generators/flash-deprecated.md index b82898633d4..b5669b0e2ea 100644 --- a/docs/generators/flash-deprecated.md +++ b/docs/generators/flash-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the flash-deprecated Generator | -------- | ----- | ----- | | generator name | flash-deprecated | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Flash | | | helpTxt | Generates a Flash (ActionScript) client library (beta). IMPORTANT: this generator has been deprecated in v5.x | | ## CONFIG OPTIONS diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index 534dbbc445f..5d148d8fe2f 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -8,6 +8,7 @@ title: Documentation for the fsharp-functions Generator | -------- | ----- | ----- | | generator name | fsharp-functions | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | F# | | | helpTxt | Generates a fsharp-functions server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/fsharp-giraffe-server.md b/docs/generators/fsharp-giraffe-server.md index fe1c0c180b4..176603a3135 100644 --- a/docs/generators/fsharp-giraffe-server.md +++ b/docs/generators/fsharp-giraffe-server.md @@ -8,6 +8,7 @@ title: Documentation for the fsharp-giraffe-server Generator | -------- | ----- | ----- | | generator name | fsharp-giraffe-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | F# | | | helpTxt | Generates a F# Giraffe server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/go-deprecated.md b/docs/generators/go-deprecated.md index cb19432610d..fa44c2c81ad 100644 --- a/docs/generators/go-deprecated.md +++ b/docs/generators/go-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the go-deprecated Generator | -------- | ----- | ----- | | generator name | go-deprecated | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Go | | | helpTxt | Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead. | | ## CONFIG OPTIONS diff --git a/docs/generators/go-echo-server.md b/docs/generators/go-echo-server.md index 9ad9e61c952..9f4a8e2e236 100644 --- a/docs/generators/go-echo-server.md +++ b/docs/generators/go-echo-server.md @@ -8,6 +8,7 @@ title: Documentation for the go-echo-server Generator | -------- | ----- | ----- | | generator name | go-echo-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Go | | | helpTxt | Generates a go-echo server. (Beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/go-gin-server.md b/docs/generators/go-gin-server.md index 85c1e5efbc4..86f6b26bdd8 100644 --- a/docs/generators/go-gin-server.md +++ b/docs/generators/go-gin-server.md @@ -8,6 +8,7 @@ title: Documentation for the go-gin-server Generator | -------- | ----- | ----- | | generator name | go-gin-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Go | | | helpTxt | Generates a Go server library with the gin framework using OpenAPI-Generator.By default, it will also generate service classes. | | ## CONFIG OPTIONS diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index f3f0a91da94..310a212a504 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -8,6 +8,7 @@ title: Documentation for the go-server Generator | -------- | ----- | ----- | | generator name | go-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Go | | | helpTxt | Generates a Go server library using OpenAPI-Generator. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/go.md b/docs/generators/go.md index 1bb81764435..4a005d47ac0 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -8,6 +8,7 @@ title: Documentation for the go Generator | -------- | ----- | ----- | | generator name | go | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Go | | | helpTxt | Generates a Go client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index a1f1248d285..8d323b1b7bc 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -8,6 +8,7 @@ title: Documentation for the graphql-nodejs-express-server Generator | -------- | ----- | ----- | | generator name | graphql-nodejs-express-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Javascript | | | helpTxt | Generates a GraphQL Node.js Express server (beta) including it's types, queries, mutations, (resolvers) | | ## CONFIG OPTIONS diff --git a/docs/generators/graphql-schema.md b/docs/generators/graphql-schema.md index ecdedafb3da..a5c60cf1a15 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -8,6 +8,7 @@ title: Documentation for the graphql-schema Generator | -------- | ----- | ----- | | generator name | graphql-schema | pass this to the generate command after -g | | generator type | SCHEMA | | +| generator language | GraphQL | | | helpTxt | Generates GraphQL schema files (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 18c943c2860..a7d42bb7c05 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -8,6 +8,7 @@ title: Documentation for the groovy Generator | -------- | ----- | ----- | | generator name | groovy | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Groovy | | | helpTxt | Generates a Groovy API client. | | ## CONFIG OPTIONS diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 4515d4ad850..8ffbcdb5cfd 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -8,6 +8,7 @@ title: Documentation for the haskell-http-client Generator | -------- | ----- | ----- | | generator name | haskell-http-client | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Haskell | | | helpTxt | Generates a Haskell http-client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index 7993d7988b2..3b472c8a28b 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -8,6 +8,7 @@ title: Documentation for the haskell-yesod Generator | -------- | ----- | ----- | | generator name | haskell-yesod | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Haskell | | | helpTxt | Generates a haskell-yesod server. | | ## CONFIG OPTIONS diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 28e69825493..b2ebcdaa699 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -8,6 +8,7 @@ title: Documentation for the haskell Generator | -------- | ----- | ----- | | generator name | haskell | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Haskell | | | helpTxt | Generates a Haskell server and client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 48b4070382e..d397419112f 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -8,6 +8,7 @@ title: Documentation for the java-inflector Generator | -------- | ----- | ----- | | generator name | java-inflector | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java Inflector Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 898f2ee2f33..75c961bcf92 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -8,6 +8,7 @@ title: Documentation for the java-micronaut-client Generator | -------- | ----- | ----- | | generator name | java-micronaut-client | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Java | | | helpTxt | Generates a Java Micronaut Client. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index fd0b6ec7c27..7b92e9cad42 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -8,6 +8,7 @@ title: Documentation for the java-msf4j Generator | -------- | ----- | ----- | | generator name | java-msf4j | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java Micro Service based on WSO2 Microservices Framework for Java (MSF4J) | | ## CONFIG OPTIONS diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 9731d407c37..18b27e77430 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -8,6 +8,7 @@ title: Documentation for the java-pkmst Generator | -------- | ----- | ----- | | generator name | java-pkmst | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a PKMST SpringBoot Server application using the SpringFox integration. Also enables EurekaServerClient / Zipkin / Spring-Boot admin | | ## CONFIG OPTIONS diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 8137dc2f7a6..abc3d0b4239 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -8,6 +8,7 @@ title: Documentation for the java-play-framework Generator | -------- | ----- | ----- | | generator name | java-play-framework | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java Play Framework Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 340ae31025b..b359cf88035 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -8,6 +8,7 @@ title: Documentation for the java-undertow-server Generator | -------- | ----- | ----- | | generator name | java-undertow-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java Undertow Server application (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 5d4946c67d4..4e599a29d08 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -8,6 +8,7 @@ title: Documentation for the java-vertx-web Generator | -------- | ----- | ----- | | generator name | java-vertx-web | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java Vert.x-Web Server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 82660a9c9ea..96ffc3ee975 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -8,6 +8,7 @@ title: Documentation for the java-vertx Generator | -------- | ----- | ----- | | generator name | java-vertx | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a java-Vert.X Server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/java.md b/docs/generators/java.md index 90aa5d73f66..dae11b0a614 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -8,6 +8,7 @@ title: Documentation for the java Generator | -------- | ----- | ----- | | generator name | java | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Java | | | helpTxt | Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more. | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 3129864fb33..9d91580aba7 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -8,6 +8,7 @@ title: Documentation for the javascript-apollo Generator | -------- | ----- | ----- | | generator name | javascript-apollo | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Javascript | | | helpTxt | Generates a JavaScript client library (beta) using Apollo RESTDatasource. | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index b9da1dc8f55..aa2b36502f9 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -8,6 +8,7 @@ title: Documentation for the javascript-closure-angular Generator | -------- | ----- | ----- | | generator name | javascript-closure-angular | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Javascript | | | helpTxt | Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en) | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 76b81c5aa82..e404f23e631 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -8,6 +8,7 @@ title: Documentation for the javascript-flowtyped Generator | -------- | ----- | ----- | | generator name | javascript-flowtyped | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Javascript | | | helpTxt | Generates a Javascript client library (beta) using Flow types and Fetch API. | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index 2381c5108f3..ce8123c03b2 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -8,6 +8,7 @@ title: Documentation for the javascript Generator | -------- | ----- | ----- | | generator name | javascript | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Javascript | | | helpTxt | Generates a JavaScript client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 1564b252520..b4f16bea4c9 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-cxf-cdi Generator | -------- | ----- | ----- | | generator name | jaxrs-cxf-cdi | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an Apache CXF runtime and a Java EE runtime with CDI enabled. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index b7fcd7f4942..a31c00fe698 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-cxf-client Generator | -------- | ----- | ----- | | generator name | jaxrs-cxf-client | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS Client based on Apache CXF framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index c44b15f100b..40fa6dfde17 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-cxf-extended Generator | -------- | ----- | ----- | | generator name | jaxrs-cxf-extended | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Extends jaxrs-cxf with options to generate a functional mock server. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index f3cb09d4176..ed251b835f0 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-cxf Generator | -------- | ----- | ----- | | generator name | jaxrs-cxf | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS Server application based on Apache CXF framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 086f079c059..f82ae05541c 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-jersey Generator | -------- | ----- | ----- | | generator name | jaxrs-jersey | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS Server application based on Jersey framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 3670d584186..7dff1caf8c7 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-resteasy-eap Generator | -------- | ----- | ----- | | generator name | jaxrs-resteasy-eap | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS-Resteasy Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index bf56de2f235..32fb664d902 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-resteasy Generator | -------- | ----- | ----- | | generator name | jaxrs-resteasy | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS-Resteasy Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 84d8b47d501..91bfa156aea 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -8,6 +8,7 @@ title: Documentation for the jaxrs-spec Generator | -------- | ----- | ----- | | generator name | jaxrs-spec | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification. | | ## CONFIG OPTIONS diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index e47e7fef177..426ed04b4cc 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -8,6 +8,7 @@ title: Documentation for the jmeter Generator | -------- | ----- | ----- | | generator name | jmeter | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Java | | | helpTxt | Generates a JMeter .jmx file. | | ## CONFIG OPTIONS diff --git a/docs/generators/k6.md b/docs/generators/k6.md index a23aec49d2d..0ab38225e03 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -8,6 +8,7 @@ title: Documentation for the k6 Generator | -------- | ----- | ----- | | generator name | k6 | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | k6 | | | helpTxt | Generates a k6 script (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md index 79e12009c63..3c5c6ca448d 100644 --- a/docs/generators/kotlin-server-deprecated.md +++ b/docs/generators/kotlin-server-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the kotlin-server-deprecated Generator | -------- | ----- | ----- | | generator name | kotlin-server-deprecated | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Kotlin | | | helpTxt | Generates a Kotlin server (Ktor v1.1.3). IMPORTANT: this generator has been deprecated. Please migrate to `kotlin-server` which supports Ktor v1.5.2+. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 95dce36a027..c0a473d9fd8 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -8,6 +8,7 @@ title: Documentation for the kotlin-server Generator | -------- | ----- | ----- | | generator name | kotlin-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Kotlin | | | helpTxt | Generates a Kotlin server. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index d09124f4a7f..8363a31d4bf 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -8,6 +8,7 @@ title: Documentation for the kotlin-spring Generator | -------- | ----- | ----- | | generator name | kotlin-spring | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Kotlin | | | helpTxt | Generates a Kotlin Spring application. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 174d19f1669..30c0474ca76 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -8,6 +8,7 @@ title: Documentation for the kotlin-vertx Generator | -------- | ----- | ----- | | generator name | kotlin-vertx | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Kotlin | | | helpTxt | Generates a kotlin-vertx server. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 31f9601161d..d825664c0c8 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -8,6 +8,7 @@ title: Documentation for the kotlin Generator | -------- | ----- | ----- | | generator name | kotlin | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Kotlin | | | helpTxt | Generates a Kotlin client. | | ## CONFIG OPTIONS diff --git a/docs/generators/ktorm-schema.md b/docs/generators/ktorm-schema.md index 163fce14c15..b301b23a3bc 100644 --- a/docs/generators/ktorm-schema.md +++ b/docs/generators/ktorm-schema.md @@ -8,6 +8,7 @@ title: Documentation for the ktorm-schema Generator | -------- | ----- | ----- | | generator name | ktorm-schema | pass this to the generate command after -g | | generator type | SCHEMA | | +| generator language | Ktorm | | | helpTxt | Generates a kotlin-ktorm schema (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/lua.md b/docs/generators/lua.md index 3f4e6e34c6c..a890b08256f 100644 --- a/docs/generators/lua.md +++ b/docs/generators/lua.md @@ -8,6 +8,7 @@ title: Documentation for the lua Generator | -------- | ----- | ----- | | generator name | lua | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Lua | | | helpTxt | Generates a Lua client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 3499563f5a8..0fa16e99328 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -8,6 +8,7 @@ title: Documentation for the mysql-schema Generator | -------- | ----- | ----- | | generator name | mysql-schema | pass this to the generate command after -g | | generator type | SCHEMA | | +| generator language | Mysql | | | helpTxt | Generates a MySQL schema based on the model or schema defined in the OpenAPI specification (v2, v3). | | ## CONFIG OPTIONS diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 77a6d5e9046..669b310cd31 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -8,6 +8,7 @@ title: Documentation for the nim Generator | -------- | ----- | ----- | | generator name | nim | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Nim | | | helpTxt | Generates a nim client (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index f2bca510334..e530fd1a1b5 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -8,6 +8,7 @@ title: Documentation for the nodejs-express-server Generator | -------- | ----- | ----- | | generator name | nodejs-express-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Javascript | | | helpTxt | Generates a NodeJS Express server (alpha). IMPORTANT: this generator may subject to breaking changes without further notice). | | ## CONFIG OPTIONS diff --git a/docs/generators/objc.md b/docs/generators/objc.md index fa4c1350801..11e1e4280bc 100644 --- a/docs/generators/objc.md +++ b/docs/generators/objc.md @@ -8,6 +8,7 @@ title: Documentation for the objc Generator | -------- | ----- | ----- | | generator name | objc | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Objective-C | | | helpTxt | Generates an Objective-C client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index a453f108792..d1a5175be91 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -8,6 +8,7 @@ title: Documentation for the ocaml Generator | -------- | ----- | ----- | | generator name | ocaml | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | OCaml | | | helpTxt | Generates an OCaml client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/perl.md b/docs/generators/perl.md index 5d9c89a3a10..82bb14d553f 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -8,6 +8,7 @@ title: Documentation for the perl Generator | -------- | ----- | ----- | | generator name | perl | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Perl | | | helpTxt | Generates a Perl client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index 293940f6ca0..9ee8556dc2b 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -8,6 +8,7 @@ title: Documentation for the php-dt Generator | -------- | ----- | ----- | | generator name | php-dt | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | PHP | | | helpTxt | Generates a PHP client relying on Data Transfer ( https://github.com/Articus/DataTransfer ) and compliant with PSR-7, PSR-11, PSR-17 and PSR-18. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index bd374554c82..0f4c9b9b43a 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -8,6 +8,7 @@ title: Documentation for the php-laravel Generator | -------- | ----- | ----- | | generator name | php-laravel | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates a PHP laravel server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 1b91b92fd9a..44952212bd1 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -8,6 +8,7 @@ title: Documentation for the php-lumen Generator | -------- | ----- | ----- | | generator name | php-lumen | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates a PHP Lumen server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 71268386534..1060eb030ed 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -8,6 +8,7 @@ title: Documentation for the php-mezzio-ph Generator | -------- | ----- | ----- | | generator name | php-mezzio-ph | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates PHP server stub using Mezzio ( https://docs.mezzio.dev/mezzio/ ) and Path Handler ( https://github.com/Articus/PathHandler ). | | ## CONFIG OPTIONS diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index e9af8da6621..df5ed167aec 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the php-silex-deprecated Generator | -------- | ----- | ----- | | generator name | php-silex-deprecated | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates a PHP Silex server library. IMPORTANT NOTE: this generator is no longer actively maintained. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index 5e88e4e684a..19fb25e9a97 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the php-slim-deprecated Generator | -------- | ----- | ----- | | generator name | php-slim-deprecated | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates a PHP Slim Framework server library. IMPORTANT NOTE: this generator (Slim 3.x) is no longer actively maintained so please use 'php-slim4' generator instead. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index ae8676e2d9a..b021d914077 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -8,6 +8,7 @@ title: Documentation for the php-slim4 Generator | -------- | ----- | ----- | | generator name | php-slim4 | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates a PHP Slim 4 Framework server library(with Mock server). | | ## CONFIG OPTIONS diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 8ed3be46e39..da7aac53103 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -8,6 +8,7 @@ title: Documentation for the php-symfony Generator | -------- | ----- | ----- | | generator name | php-symfony | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | PHP | | | helpTxt | Generates a PHP Symfony server bundle. | | ## CONFIG OPTIONS diff --git a/docs/generators/php.md b/docs/generators/php.md index b9a93234cb2..113eb324755 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -8,6 +8,7 @@ title: Documentation for the php Generator | -------- | ----- | ----- | | generator name | php | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | PHP | | | helpTxt | Generates a PHP client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index 36d7ba9e54d..7efbc46ff08 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -8,6 +8,7 @@ title: Documentation for the powershell Generator | -------- | ----- | ----- | | generator name | powershell | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | PowerShell | | | helpTxt | Generates a PowerShell API client (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index 2f350f1a1b0..e8f8361bea0 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -8,6 +8,7 @@ title: Documentation for the protobuf-schema Generator | -------- | ----- | ----- | | generator name | protobuf-schema | pass this to the generate command after -g | | generator type | SCHEMA | | +| generator language | Protocol Buffers (Protobuf) | | | helpTxt | Generates gRPC and protocol buffer schema files (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index fdfdf70f306..79ee486c1ea 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -8,6 +8,7 @@ title: Documentation for the python-aiohttp Generator | -------- | ----- | ----- | | generator name | python-aiohttp | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Python | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index f8f6d4f6307..bd5d365f4fb 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -8,6 +8,7 @@ title: Documentation for the python-blueplanet Generator | -------- | ----- | ----- | | generator name | python-blueplanet | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Python | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index e026fdf032a..49e06706d54 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -8,6 +8,7 @@ title: Documentation for the python-experimental Generator | -------- | ----- | ----- | | generator name | python-experimental | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Python | | | helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | ## CONFIG OPTIONS diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index bb88a406076..72a438df371 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -8,6 +8,7 @@ title: Documentation for the python-fastapi Generator | -------- | ----- | ----- | | generator name | python-fastapi | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Python | | | helpTxt | Generates a Python FastAPI server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index b53c86fded1..084f4723afc 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -8,6 +8,7 @@ title: Documentation for the python-flask Generator | -------- | ----- | ----- | | generator name | python-flask | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Python | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-legacy.md b/docs/generators/python-legacy.md index 14821d0ae1c..43d89e0b844 100644 --- a/docs/generators/python-legacy.md +++ b/docs/generators/python-legacy.md @@ -8,6 +8,7 @@ title: Documentation for the python-legacy Generator | -------- | ----- | ----- | | generator name | python-legacy | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Python | | | helpTxt | Generates a Python client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/python.md b/docs/generators/python.md index 607c71a2604..3db4f227b07 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -8,6 +8,7 @@ title: Documentation for the python Generator | -------- | ----- | ----- | | generator name | python | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Python | | | helpTxt | Generates a Python client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/r.md b/docs/generators/r.md index d2ee1ea6836..f2ab5c63832 100644 --- a/docs/generators/r.md +++ b/docs/generators/r.md @@ -8,6 +8,7 @@ title: Documentation for the r Generator | -------- | ----- | ----- | | generator name | r | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | R | | | helpTxt | Generates a R client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index f0be7a29e13..3473ee666cd 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -8,6 +8,7 @@ title: Documentation for the ruby-on-rails Generator | -------- | ----- | ----- | | generator name | ruby-on-rails | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Ruby | | | helpTxt | Generates a Ruby on Rails (v5) server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index f58b4b948b1..981be7d3c32 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -8,6 +8,7 @@ title: Documentation for the ruby-sinatra Generator | -------- | ----- | ----- | | generator name | ruby-sinatra | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Ruby | | | helpTxt | Generates a Ruby Sinatra server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 56c094bbd9f..126d32b111b 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -8,6 +8,7 @@ title: Documentation for the ruby Generator | -------- | ----- | ----- | | generator name | ruby | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Ruby | | | helpTxt | Generates a Ruby client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md index 7822aa5417c..b669ac3fae9 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -8,6 +8,7 @@ title: Documentation for the rust-server Generator | -------- | ----- | ----- | | generator name | rust-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Rust | | | helpTxt | Generates a Rust client/server library (beta) using the openapi-generator project. | | ## CONFIG OPTIONS diff --git a/docs/generators/rust.md b/docs/generators/rust.md index 44b63aee0ec..6637bf69098 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -8,6 +8,7 @@ title: Documentation for the rust Generator | -------- | ----- | ----- | | generator name | rust | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Rust | | | helpTxt | Generates a Rust client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 9c35ef92e7d..33fa8817eb8 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -8,6 +8,7 @@ title: Documentation for the scala-akka-http-server Generator | -------- | ----- | ----- | | generator name | scala-akka-http-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Scala | | | helpTxt | Generates a scala-akka-http server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index cf8b6909aca..9612a78014a 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -8,6 +8,7 @@ title: Documentation for the scala-akka Generator | -------- | ----- | ----- | | generator name | scala-akka | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Scala | | | helpTxt | Generates a Scala client library (beta) base on Akka/Spray. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-finch.md b/docs/generators/scala-finch.md index 9796e5d50fd..02ebc385796 100644 --- a/docs/generators/scala-finch.md +++ b/docs/generators/scala-finch.md @@ -8,6 +8,7 @@ title: Documentation for the scala-finch Generator | -------- | ----- | ----- | | generator name | scala-finch | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Scala | | | helpTxt | Generates a Scala server application with Finch. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 19cd4528952..fc111db2002 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -8,6 +8,7 @@ title: Documentation for the scala-gatling Generator | -------- | ----- | ----- | | generator name | scala-gatling | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Scala | | | helpTxt | Generates a gatling simulation library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index af714b42ed2..6760f78c776 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the scala-httpclient-deprecated Generator | -------- | ----- | ----- | | generator name | scala-httpclient-deprecated | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Scala | | | helpTxt | Generates a Scala client library (beta). IMPORTANT: This generator is no longer actively maintained and will be deprecated. PLease use 'scala-akka' generator instead. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index aba88bb57ee..aae66c6de02 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -8,6 +8,7 @@ title: Documentation for the scala-lagom-server Generator | -------- | ----- | ----- | | generator name | scala-lagom-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Scala | | | helpTxt | Generates a Lagom API server (Beta) in scala | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index 845b9a233b8..ebe594a10a9 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -8,6 +8,7 @@ title: Documentation for the scala-play-server Generator | -------- | ----- | ----- | | generator name | scala-play-server | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Scala | | | helpTxt | Generates a Scala server application (beta) with Play Framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index 1befd28b70e..7bd25ecef96 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -8,6 +8,7 @@ title: Documentation for the scala-sttp Generator | -------- | ----- | ----- | | generator name | scala-sttp | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Scala | | | helpTxt | Generates a Scala client library (beta) based on Sttp. | | ## CONFIG OPTIONS diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index 56bef75b6cc..3e52e8e9f9a 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -8,6 +8,7 @@ title: Documentation for the scalatra Generator | -------- | ----- | ----- | | generator name | scalatra | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Scala | | | helpTxt | Generates a Scala server application with Scalatra. | | ## CONFIG OPTIONS diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 7c356c9f8e2..077d1d3d14f 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -8,6 +8,7 @@ title: Documentation for the scalaz Generator | -------- | ----- | ----- | | generator name | scalaz | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Scala | | | helpTxt | Generates a Scalaz client library (beta) that uses http4s | | ## CONFIG OPTIONS diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 7623c432a75..8dee03a692a 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -8,6 +8,7 @@ title: Documentation for the spring Generator | -------- | ----- | ----- | | generator name | spring | pass this to the generate command after -g | | generator type | SERVER | | +| generator language | Java | | | helpTxt | Generates a Java SpringBoot Server application using the SpringFox integration. | | ## CONFIG OPTIONS diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md index 7743ddf5a45..26c3dbaf030 100644 --- a/docs/generators/swift4-deprecated.md +++ b/docs/generators/swift4-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the swift4-deprecated Generator | -------- | ----- | ----- | | generator name | swift4-deprecated | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Swift | | | helpTxt | Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.) | | ## CONFIG OPTIONS diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index cb5ea31e124..2d9b0128973 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -8,6 +8,7 @@ title: Documentation for the swift5 Generator | -------- | ----- | ----- | | generator name | swift5 | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Swift | | | helpTxt | Generates a Swift 5.x client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index accefab18e0..112ec3f54da 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-angular Generator | -------- | ----- | ----- | | generator name | typescript-angular | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript Angular (6.x - 13.x) client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index bcacd72ecb8..4490fc90ba6 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-angularjs-deprecated Generator | -------- | ----- | ----- | | generator name | typescript-angularjs-deprecated | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript AngularJS client library. This generator has been deprecated and will be removed in the future release. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 0632ee05eb0..6c2b5d91f99 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-aurelia Generator | -------- | ----- | ----- | | generator name | typescript-aurelia | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript client library for the Aurelia framework (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 00bd32f9535..244b5471e3d 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-axios Generator | -------- | ----- | ----- | | generator name | typescript-axios | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript client library using axios. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index b272b0bb2bf..104a33cf745 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-fetch Generator | -------- | ----- | ----- | | generator name | typescript-fetch | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript client library using Fetch API (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 5834880e4a4..ceca00588a3 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-inversify Generator | -------- | ----- | ----- | | generator name | typescript-inversify | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates Typescript services using Inversify IOC | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index e9469f20589..7f89c8e326d 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-jquery Generator | -------- | ----- | ----- | | generator name | typescript-jquery | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript jquery client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index 0619d801227..f6cd75a328c 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-nestjs Generator | -------- | ----- | ----- | | generator name | typescript-nestjs | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript Nestjs 6.x client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index b2afd57352d..03c988d6f25 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-node Generator | -------- | ----- | ----- | | generator name | typescript-node | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript NodeJS client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 022f22d8c5e..85fc2a548c7 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-redux-query Generator | -------- | ----- | ----- | | generator name | typescript-redux-query | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript client library using redux-query API (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 52ed0e12ef0..06ef6aa84b7 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -8,6 +8,7 @@ title: Documentation for the typescript-rxjs Generator | -------- | ----- | ----- | | generator name | typescript-rxjs | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript client library using Rxjs API. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index 3aae708a3bd..8659b4fbf96 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -8,6 +8,7 @@ title: Documentation for the typescript Generator | -------- | ----- | ----- | | generator name | typescript | pass this to the generate command after -g | | generator type | CLIENT | | +| generator language | Typescript | | | helpTxt | Generates a TypeScript client library using Fetch API (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index 47c95920be5..131d78b443b 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -8,6 +8,7 @@ title: Documentation for the wsdl-schema Generator | -------- | ----- | ----- | | generator name | wsdl-schema | pass this to the generate command after -g | | generator type | SCHEMA | | +| generator language | Web Services Description Language (WSDL) | | | helpTxt | Generates WSDL files. | | ## CONFIG OPTIONS diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 3c61526cddc..35e16eaf0e3 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -304,6 +304,9 @@ public class ConfigHelp extends OpenApiGeneratorCommand { sb.append("| -------- | ----- | ----- |").append(newline); sb.append("| generator name | "+config.getName()+" | pass this to the generate command after -g |").append(newline); sb.append("| generator type | "+config.getTag()+" | |").append(newline); + if (config.generatorLanguage() != null) { + sb.append("| generator language | "+config.generatorLanguage().toString()+" | |").append(newline); + } sb.append("| helpTxt | "+config.getHelp()+" | |").append(newline); sb.append(newline); 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 17b9b978259..7e6bc07dede 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 @@ -306,4 +306,6 @@ public interface CodegenConfig { Schema unaliasSchema(Schema schema, Map usedImportMappings); public String defaultTemplatingEngine(); + + public GeneratorLanguage generatorLanguage(); } 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 1a9d09441c0..1744cb31736 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 @@ -7361,4 +7361,7 @@ public class DefaultCodegen implements CodegenConfig { public String defaultTemplatingEngine() { return "mustache"; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java new file mode 100644 index 00000000000..b7248350253 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/GeneratorLanguage.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * 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. + */ + +package org.openapitools.codegen; + +public enum GeneratorLanguage { + /* + Not defined because they use the default Java language: + Android + + Note: all documentation generators have generatorLanguage set to null + */ + JAVA("Java"), ADA("Ada"), APEX("Apex"), BASH("Bash"), C("C"), + CLOJURE("Clojure"), C_PLUS_PLUS("C++"), CRYSTAL("Crystal"), C_SHARP("C#"), + DART("Dart"), EIFFEL("Eiffel"), ELIXIR("Elixir"), ELM("Elm"), + ERLANG("Erlang"), FLASH("Flash"), F_SHARP("F#"), GO("Go"), + JAVASCRIPT("Javascript"), GRAPH_QL("GraphQL"), GROOVY("Groovy"), + HASKELL("Haskell"), TYPESCRIPT("Typescript"), K_SIX("k6"), KOTLIN("Kotlin"), + KTORM("Ktorm"), LUA("Lua"), MYSQL("Mysql"), NIM("Nim"), + OBJECTIVE_C("Objective-C"), OCAML("OCaml"), PERL("Perl"), PHP("PHP"), + POWERSHELL("PowerShell"), PROTOBUF("Protocol Buffers (Protobuf)"), PYTHON("Python"), + R("R"), RUBY("Ruby"), RUST("Rust"), SCALA("Scala"), SWIFT("Swift"), + WSDL("Web Services Description Language (WSDL)"); + + private final String label; + + private GeneratorLanguage(String label) { + this.label = label; + } + + @Override + public String toString() { + return this.label; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index 9670576e7db..2473ebd97d1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -820,4 +820,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg } return result; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ADA; } } 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 a42ee2dadab..a294a59fb04 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 @@ -1341,4 +1341,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.C_SHARP; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index 982980afbc8..fc4e37066f8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -25,14 +25,9 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.servers.ServerVariables; import io.swagger.v3.oas.models.servers.ServerVariable; -import org.openapitools.codegen.CodegenServer; -import org.openapitools.codegen.CodegenServerVariable; +import org.openapitools.codegen.*; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.templating.mustache.IndentedLambda; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.URLPathUtils; @@ -439,4 +434,7 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg } return; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.C_PLUS_PLUS; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 75e466165a5..92c7fef7470 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -768,4 +768,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.DART; } } 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 85cc06c3c6d..26069c778bb 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 @@ -634,4 +634,6 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.EIFFEL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java index e2e9d96dc9f..b780186d65b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java @@ -1130,4 +1130,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.F_SHARP; } } 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 803fc6ace34..6c206de669d 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 @@ -848,4 +848,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege protected boolean isNumberType(String datatype) { return numberTypes.contains(datatype); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GO; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 0cd24435d48..ad48b483a9b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -1016,4 +1016,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return null; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.KOTLIN; } } 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 db9c3e42029..bfbeb59452a 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 @@ -809,4 +809,7 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg public boolean isDataTypeString(String dataType) { return "string".equals(dataType); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PHP; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index f07cef7e4de..1d406e00ac5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -700,4 +700,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co protected static String dropDots(String str) { return str.replaceAll("\\.", "_"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PYTHON; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index 67fe9bc6d93..a57af7989a1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -23,6 +23,7 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.GeneratorLanguage; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -262,4 +263,7 @@ abstract public class AbstractRubyCodegen extends DefaultCodegen implements Code } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.RUBY; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java index c3132a06f42..6a1f0d33071 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java @@ -575,4 +575,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { this.invokerPackage = invokerPackage; } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SCALA; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 647ecda7a04..ee69893ecf7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -956,4 +956,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp return schemaType; }).distinct().collect(Collectors.toList()); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.TYPESCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java index 4c56b3c0eef..f8d43504d27 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java @@ -23,6 +23,7 @@ import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.GeneratorLanguage; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -326,5 +327,6 @@ public class ApexClientCodegen extends AbstractApexCodegen { } - + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.APEX; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 5ca5fbb156b..5cc50db1415 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -828,4 +828,6 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { return camelize(sanitizeName(operationId), true); } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.BASH; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index 788639ab1d7..e7aa24c603d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -920,4 +920,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf System.out.println("# > Niklas Werner - https://paypal.me/wernerdevelopment #"); System.out.println("################################################################################"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.C; } } 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 df4a237bd85..8527aba03f6 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 @@ -382,4 +382,7 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi // ref: https://clojurebridge.github.io/community-docs/docs/clojure/comment/ return input.replace("(comment", "(_comment"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.CLOJURE; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java index edb5f81cd0d..20c3fb25373 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ConfluenceWikiCodegen.java @@ -150,4 +150,7 @@ public class ConfluenceWikiCodegen extends DefaultCodegen implements CodegenConf // chomp tailing newline because it breaks the tables and keep all other sign to show documentation properly return StringUtils.chomp(input); } + + @Override + public GeneratorLanguage generatorLanguage() { return null; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index 21b18e18154..d4c83e5d5f0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -898,4 +898,7 @@ public class CrystalClientCodegen extends DefaultCodegen { } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.CRYSTAL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 62c9d6dcc5f..e3291df8611 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -915,4 +915,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig public void setModuleName(String moduleName) { this.moduleName = moduleName; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ELIXIR; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java index 20b2ac0c944..78241218e21 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java @@ -465,4 +465,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { writer.write(fragment.execute().replaceAll("\\s+", "")); } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ELM; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java index 541456a824e..3ba5232be16 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java @@ -479,4 +479,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig public String addRegularExpressionDelimiter(String pattern) { return pattern; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ERLANG; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java index aec98664149..e065ca217ee 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java @@ -573,4 +573,7 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig public String addRegularExpressionDelimiter(String pattern) { return pattern; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ERLANG; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java index 0c9fc2dcc19..05e488e5354 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangServerCodegen.java @@ -330,4 +330,7 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig public String addRegularExpressionDelimiter(String pattern) { return pattern; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ERLANG; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java index 2dfcbfcafbe..2b89404ce7d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java @@ -410,4 +410,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.FLASH; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java index edfe46026a2..fc68c05827a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLNodeJSExpressServerCodegen.java @@ -166,4 +166,7 @@ public class GraphQLNodeJSExpressServerCodegen extends AbstractGraphQLCodegen im return StringUtils.capitalize(enumName) + "Enum"; } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java index 9835ee9d0e5..5215b9d3bed 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java @@ -16,10 +16,7 @@ package org.openapitools.codegen.languages; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -102,4 +99,7 @@ public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements Code //supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")) //supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GRAPH_QL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java index 77844538e47..c12ce839375 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java @@ -24,10 +24,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Map; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.ClientModificationFeature; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.GlobalFeature; @@ -157,4 +154,7 @@ public class GroovyClientCodegen extends AbstractJavaCodegen { public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GROOVY; } } 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 645069903b8..3f7845bfa7c 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 @@ -1473,4 +1473,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC static boolean ContainsJsonMimeType(String mime) { return mime != null && CONTAINS_JSON_MIME_PATTERN.matcher(mime).matches(); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.HASKELL; } } 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 9b44c0b2d68..477df471507 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 @@ -701,4 +701,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.HASKELL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java index 736b9d599b1..d30093ce7c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java @@ -630,4 +630,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.HASKELL; } } 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 32b601491d3..27649495346 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 @@ -1143,4 +1143,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } 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 4e9ddd2a007..1f8f973e029 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 @@ -1240,4 +1240,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo } return super.getCollectionFormat(codegenParameter); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java index edc3c21e4d5..8744934020a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java @@ -319,4 +319,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem public void setUseEs6(boolean useEs6) { this.useEs6 = useEs6; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java index c82f5e1c68e..cf344c8281c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java @@ -223,4 +223,6 @@ public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCo this.npmRepository = npmRepository; } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java index 982a3fefbe0..05a9d1536d4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java @@ -46,16 +46,7 @@ import javax.annotation.Nullable; import com.google.common.collect.ImmutableMap; import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenParameter; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenResponse; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.utils.ModelUtils; @@ -1155,4 +1146,6 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { } } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.K_SIX; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java index 876a1b3b479..d69af302d54 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KtormSchemaCodegen.java @@ -1224,4 +1224,6 @@ public class KtormSchemaCodegen extends AbstractKotlinCodegen { return StringUtils.removeEnd(packagePath, File.separator); } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.KTORM; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java index 795b829036a..84af5454e0d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/LuaClientCodegen.java @@ -594,4 +594,7 @@ public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig { System.out.println("# Pls support his work directly via https://github.com/sponsors/daurnimator \uD83D\uDE4F #"); System.out.println("################################################################################"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.LUA; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java index 3a3e081f7b8..0e4ad861cb3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java @@ -1,11 +1,6 @@ package org.openapitools.codegen.languages; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.*; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; @@ -112,4 +107,7 @@ public class MarkdownDocumentationCodegen extends DefaultCodegen implements Code public String toModelFilename(String name) { return name; } + + @Override + public GeneratorLanguage generatorLanguage() { return null; } } 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 97748d8d6db..d1f95897135 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 @@ -1254,4 +1254,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig // Trim trailing file separators from the overall path return StringUtils.removeEnd(packagePath, File.separator); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.MYSQL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java index 572cbacc66f..4db55bcb17e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -368,4 +368,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { return name; } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.NIM; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java index 3af6d99b96f..774df093e1d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java @@ -455,4 +455,7 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVASCRIPT; } } 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 3b62750ae02..c9319b48ea4 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 @@ -828,4 +828,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.OCAML; } } 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 0075bcb8a57..5667e3e2918 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 @@ -791,4 +791,6 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { return input.replace("*/", "*_/").replace("/*", "/_*"); } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.OBJECTIVE_C; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java index ccd3ff685d6..8e65252b1a3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIGenerator.java @@ -106,4 +106,7 @@ public class OpenAPIGenerator extends DefaultCodegen implements CodegenConfig { // just return the original string return input; } + + @Override + public GeneratorLanguage generatorLanguage() { return null; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java index d697fe54fa1..d60fa609d39 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java @@ -120,4 +120,6 @@ public class OpenAPIYamlGenerator extends DefaultCodegen implements CodegenConfi return input; } + @Override + public GeneratorLanguage generatorLanguage() { return null; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 2a4a8d1905f..2f48cbc9b90 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -643,4 +643,7 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { System.out.println("# - OpenAPI Generator for Perl Developers https://bit.ly/2OId6p3 #"); System.out.println("################################################################################"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PERL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index a6efee11fb1..212459d8d34 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -281,4 +281,6 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf return objs; } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PHP; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java index ad63034acbe..8df3f2a3c4d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java @@ -215,4 +215,7 @@ public class PlantumlDocumentationCodegen extends DefaultCodegen implements Code // to suppress the warning message return input; } + + @Override + public GeneratorLanguage generatorLanguage() { return null; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index c7d4028d84a..fee739c2c82 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -1538,4 +1538,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo System.out.println("# - OpenAPI Generator for PowerShell Developers https://bit.ly/3qBWfRJ #"); System.out.println("################################################################################"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.POWERSHELL; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 777f6fc5169..769d143091d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -603,4 +603,7 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf } return containsVar; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.PROTOBUF; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index b24d527646a..99294b06a15 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -796,4 +796,6 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { System.out.println("################################################################################"); } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.R; } } 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 265a9afc208..5e8e5ac0308 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 @@ -690,4 +690,7 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig { return null; } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.RUST; } } 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 328e18387ea..e4eb0dc9d79 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 @@ -1742,4 +1742,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { updatePropertyForMap(property, p); } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.RUST; } } 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 146ddf06ccf..7aa5bfcce97 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 @@ -484,4 +484,6 @@ public class ScalaFinchServerCodegen extends DefaultCodegen implements CodegenCo System.out.println("################################################################################"); } + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SCALA; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java index ce43779dfd7..7e207388852 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticDocCodegen.java @@ -129,4 +129,7 @@ public class StaticDocCodegen extends DefaultCodegen implements CodegenConfig { // just return the original string return input; } + + @Override + public GeneratorLanguage generatorLanguage() { return null; } } 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 523c7de0d09..a6a2c81328f 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 @@ -286,4 +286,7 @@ public class StaticHtml2Generator extends DefaultCodegen implements CodegenConfi // just return the original string return input; } + + @Override + public GeneratorLanguage generatorLanguage() { return null; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java index 910528d7498..b3a34018238 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtmlGenerator.java @@ -229,4 +229,6 @@ public class StaticHtmlGenerator extends DefaultCodegen implements CodegenConfig property.unescapedDescription); } + @Override + public GeneratorLanguage generatorLanguage() { return null; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index 0762835b4a5..5adc13172bf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -1091,4 +1091,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { example += ")"; return example; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SWIFT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index b853bf351cc..ed0dc45e1b9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -1320,4 +1320,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig System.out.println("# Please support his work directly via https://paypal.com/paypalme/4brunu \uD83D\uDE4F #"); System.out.println("################################################################################"); } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SWIFT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index d371f617718..51cc382c09d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -1573,4 +1573,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo } } } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.TYPESCRIPT; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java index ac29e7caba7..42b22298758 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/WsdlSchemaCodegen.java @@ -280,4 +280,7 @@ public class WsdlSchemaCodegen extends DefaultCodegen implements CodegenConfig { // just return the original string return input; } + + @Override + public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.WSDL; } } From de036e211ede645bde4d1408863f44e524802d29 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 10 Jan 2022 18:16:53 -0800 Subject: [PATCH 023/113] Improves generator docs: stability + language version added (#11270) * Adds generatorLanguageVersion and uses it in python generators * Regenerates docs * Adds stability to generator docs * Triple braces generatorLanguageVersion * Regenerates samples * Fixes the python-experimental setup.py file so it works with generatorLanguageVersion * Updates generators readme --- docs/generators.md | 2 +- docs/generators/ada-server.md | 1 + docs/generators/ada.md | 1 + docs/generators/android.md | 1 + docs/generators/apache2.md | 1 + docs/generators/apex.md | 1 + docs/generators/asciidoc.md | 1 + docs/generators/aspnetcore.md | 1 + docs/generators/avro-schema.md | 1 + docs/generators/bash.md | 1 + docs/generators/c.md | 1 + docs/generators/clojure.md | 1 + docs/generators/cpp-pistache-server.md | 1 + docs/generators/cpp-qt-client.md | 1 + docs/generators/cpp-qt-qhttpengine-server.md | 1 + docs/generators/cpp-restbed-server.md | 1 + docs/generators/cpp-restsdk.md | 1 + docs/generators/cpp-tiny.md | 1 + docs/generators/cpp-tizen.md | 1 + docs/generators/cpp-ue4.md | 1 + docs/generators/crystal.md | 1 + docs/generators/csharp-dotnet2.md | 1 + docs/generators/csharp-nancyfx.md | 1 + docs/generators/csharp-netcore-functions.md | 1 + docs/generators/csharp-netcore.md | 1 + docs/generators/csharp.md | 1 + docs/generators/cwiki.md | 1 + docs/generators/dart-dio-next.md | 1 + docs/generators/dart-dio.md | 1 + docs/generators/dart-jaguar.md | 1 + docs/generators/dart.md | 1 + docs/generators/dynamic-html.md | 1 + docs/generators/eiffel.md | 1 + docs/generators/elixir.md | 1 + docs/generators/elm.md | 1 + docs/generators/erlang-client.md | 1 + docs/generators/erlang-proper.md | 1 + docs/generators/erlang-server.md | 1 + docs/generators/flash-deprecated.md | 1 + docs/generators/fsharp-functions.md | 1 + docs/generators/fsharp-giraffe-server.md | 1 + docs/generators/go-deprecated.md | 1 + docs/generators/go-echo-server.md | 1 + docs/generators/go-gin-server.md | 1 + docs/generators/go-server.md | 1 + docs/generators/go.md | 1 + docs/generators/graphql-nodejs-express-server.md | 1 + docs/generators/graphql-schema.md | 1 + docs/generators/groovy.md | 1 + docs/generators/haskell-http-client.md | 1 + docs/generators/haskell-yesod.md | 1 + docs/generators/haskell.md | 1 + docs/generators/html.md | 1 + docs/generators/html2.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/javascript-apollo.md | 1 + docs/generators/javascript-closure-angular.md | 1 + docs/generators/javascript-flowtyped.md | 1 + docs/generators/javascript.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/jmeter.md | 1 + docs/generators/k6.md | 1 + docs/generators/kotlin-server-deprecated.md | 1 + docs/generators/kotlin-server.md | 1 + docs/generators/kotlin-spring.md | 1 + docs/generators/kotlin-vertx.md | 1 + docs/generators/kotlin.md | 1 + docs/generators/ktorm-schema.md | 1 + docs/generators/lua.md | 1 + docs/generators/markdown.md | 1 + docs/generators/mysql-schema.md | 1 + docs/generators/nim.md | 1 + docs/generators/nodejs-express-server.md | 1 + docs/generators/objc.md | 1 + docs/generators/ocaml.md | 1 + docs/generators/openapi-yaml.md | 1 + docs/generators/openapi.md | 1 + docs/generators/perl.md | 1 + docs/generators/php-dt.md | 1 + docs/generators/php-laravel.md | 1 + docs/generators/php-lumen.md | 1 + docs/generators/php-mezzio-ph.md | 1 + docs/generators/php-silex-deprecated.md | 1 + docs/generators/php-slim-deprecated.md | 1 + docs/generators/php-slim4.md | 1 + docs/generators/php-symfony.md | 1 + docs/generators/php.md | 1 + docs/generators/plantuml.md | 1 + docs/generators/powershell.md | 1 + docs/generators/protobuf-schema.md | 1 + docs/generators/python-aiohttp.md | 2 ++ docs/generators/python-blueplanet.md | 2 ++ docs/generators/python-experimental.md | 2 ++ docs/generators/python-fastapi.md | 4 +++- docs/generators/python-flask.md | 2 ++ docs/generators/python-legacy.md | 2 ++ docs/generators/python.md | 2 ++ docs/generators/r.md | 1 + docs/generators/ruby-on-rails.md | 1 + docs/generators/ruby-sinatra.md | 1 + docs/generators/ruby.md | 1 + docs/generators/rust-server.md | 1 + docs/generators/rust.md | 1 + docs/generators/scala-akka-http-server.md | 1 + docs/generators/scala-akka.md | 1 + docs/generators/scala-finch.md | 1 + docs/generators/scala-gatling.md | 1 + docs/generators/scala-httpclient-deprecated.md | 1 + docs/generators/scala-lagom-server.md | 1 + docs/generators/scala-play-server.md | 1 + docs/generators/scala-sttp.md | 1 + docs/generators/scalatra.md | 1 + docs/generators/scalaz.md | 1 + docs/generators/spring.md | 1 + docs/generators/swift4-deprecated.md | 1 + docs/generators/swift5.md | 1 + docs/generators/typescript-angular.md | 1 + docs/generators/typescript-angularjs-deprecated.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-nestjs.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + docs/generators/typescript.md | 1 + docs/generators/wsdl-schema.md | 1 + .../main/java/org/openapitools/codegen/cmd/ConfigHelp.java | 4 ++++ .../main/java/org/openapitools/codegen/CodegenConfig.java | 6 ++++++ .../main/java/org/openapitools/codegen/DefaultCodegen.java | 3 +++ .../java/org/openapitools/codegen/DefaultGenerator.java | 1 + .../languages/PythonAiohttpConnexionServerCodegen.java | 3 +++ .../codegen/languages/PythonBluePlanetServerCodegen.java | 2 ++ .../openapitools/codegen/languages/PythonClientCodegen.java | 5 ++++- .../codegen/languages/PythonExperimentalClientCodegen.java | 3 +++ .../codegen/languages/PythonFastAPIServerCodegen.java | 5 ++++- .../languages/PythonFlaskConnexionServerCodegen.java | 3 +++ .../codegen/languages/PythonLegacyClientCodegen.java | 4 +++- .../src/main/resources/python-aiohttp/README.mustache | 2 +- .../main/resources/python-experimental/README.handlebars | 2 +- .../python-experimental/README_onlypackage.handlebars | 2 +- .../src/main/resources/python-experimental/setup.handlebars | 2 +- .../src/main/resources/python-fastapi/Dockerfile.mustache | 6 +++--- .../src/main/resources/python-fastapi/README.mustache | 2 +- .../src/main/resources/python-fastapi/setup_cfg.mustache | 4 ++-- .../src/main/resources/python-legacy/README.mustache | 2 +- .../resources/python-legacy/README_onlypackage.mustache | 2 +- .../src/main/resources/python/README.mustache | 2 +- .../src/main/resources/python/README_onlypackage.mustache | 2 +- .../src/main/resources/python/setup.mustache | 2 +- samples/client/petstore/python/README.md | 2 +- .../README.md | 2 +- .../client/extensions/x-auth-id-alias/python/README.md | 2 +- .../client/features/dynamic-servers/python/README.md | 2 +- .../openapi3/client/petstore/python-experimental/README.md | 2 +- samples/openapi3/client/petstore/python/README.md | 2 +- 173 files changed, 209 insertions(+), 26 deletions(-) diff --git a/docs/generators.md b/docs/generators.md index 2d887687911..5bd6cadfa00 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -53,7 +53,7 @@ The following generators are available: * [php](generators/php.md) * [php-dt (beta)](generators/php-dt.md) * [powershell (beta)](generators/powershell.md) -* [python (experimental)](generators/python.md) +* [python](generators/python.md) * [python-experimental (experimental)](generators/python-experimental.md) * [python-legacy](generators/python-legacy.md) * [r](generators/r.md) diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index bda2ebc4d61..4dcede68c0d 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -7,6 +7,7 @@ title: Documentation for the ada-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ada-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Ada | | | helpTxt | Generates an Ada server implementation (beta). | | diff --git a/docs/generators/ada.md b/docs/generators/ada.md index c7fc549290a..12fd0187cfa 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -7,6 +7,7 @@ title: Documentation for the ada Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ada | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Ada | | | helpTxt | Generates an Ada client implementation (beta). | | diff --git a/docs/generators/android.md b/docs/generators/android.md index 78336829f03..36a0bc0406d 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -7,6 +7,7 @@ title: Documentation for the android Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | android | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | | helpTxt | Generates an Android client library. | | diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 9f5cfa8ed6c..5b8e5d4e456 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -7,6 +7,7 @@ title: Documentation for the apache2 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | apache2 | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CONFIG | | | generator language | Java | | | helpTxt | Generates an Apache2 Config file with the permissions | | diff --git a/docs/generators/apex.md b/docs/generators/apex.md index 7fc192390fa..2c815c44960 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -7,6 +7,7 @@ title: Documentation for the apex Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | apex | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Apex | | | helpTxt | Generates an Apex API client library. | | diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index 815a5eea266..b966cd6e179 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -7,6 +7,7 @@ title: Documentation for the asciidoc Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | asciidoc | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | generator language | Java | | | helpTxt | Generates asciidoc markup based documentation. | | diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index f97033ac35a..1488ec9672f 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -7,6 +7,7 @@ title: Documentation for the aspnetcore Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | aspnetcore | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | C# | | | helpTxt | Generates an ASP.NET Core Web API server. | | diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index ce8261b0701..d8929e448ea 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -7,6 +7,7 @@ title: Documentation for the avro-schema Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | avro-schema | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SCHEMA | | | generator language | Java | | | helpTxt | Generates a Avro model (beta). | | diff --git a/docs/generators/bash.md b/docs/generators/bash.md index 3356189af73..d7053aaa12c 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -7,6 +7,7 @@ title: Documentation for the bash Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | bash | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Bash | | | helpTxt | Generates a Bash client script based on cURL. | | diff --git a/docs/generators/c.md b/docs/generators/c.md index d7006f36cc9..700b9c59efd 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -7,6 +7,7 @@ title: Documentation for the c Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | c | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | C | | | helpTxt | Generates a C (libcurl) client library (beta). | | diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index 7cc512620ed..512688ead46 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -7,6 +7,7 @@ title: Documentation for the clojure Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | clojure | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Clojure | | | helpTxt | Generates a Clojure client library. | | diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index f9c171feeeb..534d5a52f48 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-pistache-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-pistache-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | C++ | | | helpTxt | Generates a C++ API server (based on Pistache) | | diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index f26b827b8d4..9ea981421a5 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-qt-client Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-qt-client | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | C++ | | | helpTxt | Generates a Qt C++ client library. | | diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index 42d3f4c7e04..12fd8dc3a63 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-qt-qhttpengine-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-qt-qhttpengine-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | C++ | | | helpTxt | Generates a Qt C++ Server using the QHTTPEngine HTTP Library. | | diff --git a/docs/generators/cpp-restbed-server.md b/docs/generators/cpp-restbed-server.md index 065ead399b7..f5037c7ac5d 100644 --- a/docs/generators/cpp-restbed-server.md +++ b/docs/generators/cpp-restbed-server.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-restbed-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-restbed-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | C++ | | | helpTxt | Generates a C++ API Server with Restbed (https://github.com/Corvusoft/restbed). | | diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index fa04e41dcd7..700f1c657d1 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-restsdk Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-restsdk | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | C++ | | | helpTxt | Generates a C++ API client with C++ REST SDK (https://github.com/Microsoft/cpprestsdk). | | diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index e669c1ad7c4..08a7e4f6919 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-tiny Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-tiny | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | C++ | | | helpTxt | Generates a C++ Arduino REST API client. | | diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index 0528620b776..c81dec1d03a 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-tizen Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-tizen | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | C++ | | | helpTxt | Generates a Samsung Tizen C++ client library. | | diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index 56eb1c96799..563f1325a4c 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -7,6 +7,7 @@ title: Documentation for the cpp-ue4 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cpp-ue4 | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | C++ | | | helpTxt | Generates a Unreal Engine 4 C++ Module (beta). | | diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index d44e727ddbb..0961a1e0514 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -7,6 +7,7 @@ title: Documentation for the crystal Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | crystal | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Crystal | | | helpTxt | Generates a Crystal client library (beta). | | diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md index 22fbde9e287..539eb8282e6 100644 --- a/docs/generators/csharp-dotnet2.md +++ b/docs/generators/csharp-dotnet2.md @@ -7,6 +7,7 @@ title: Documentation for the csharp-dotnet2 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | csharp-dotnet2 | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | C# | | | helpTxt | Generates a C# .Net 2.0 client library (beta). | | diff --git a/docs/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx.md index c20541a52f9..076cf18395c 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx.md @@ -7,6 +7,7 @@ title: Documentation for the csharp-nancyfx Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | csharp-nancyfx | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | C# | | | helpTxt | Generates a C# NancyFX Web API server. | | diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md index 888ada38128..eca318215d8 100644 --- a/docs/generators/csharp-netcore-functions.md +++ b/docs/generators/csharp-netcore-functions.md @@ -7,6 +7,7 @@ title: Documentation for the csharp-netcore-functions Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | csharp-netcore-functions | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | C# | | | helpTxt | Generates a csharp server. | | diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 57d4e3ac2b6..ad581afc56b 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -7,6 +7,7 @@ title: Documentation for the csharp-netcore Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | csharp-netcore | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | C# | | | helpTxt | Generates a C# client library (.NET Standard, .NET Core). | | diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 2a61a6fa326..656b537a2c0 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -7,6 +7,7 @@ title: Documentation for the csharp Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | csharp | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | C# | | | helpTxt | Generates a CSharp client library. | | diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index 13a6eb489e3..19997fc3e8d 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -7,6 +7,7 @@ title: Documentation for the cwiki Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | cwiki | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | helpTxt | Generates confluence wiki markup. | | diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index 157fb47af53..0bb7adfd786 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -7,6 +7,7 @@ title: Documentation for the dart-dio-next Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | dart-dio-next | pass this to the generate command after -g | +| generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Dart | | | helpTxt | Generates a Dart Dio client library with null-safety. | | diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 2ef52cbffe4..00aa3d7e869 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -7,6 +7,7 @@ title: Documentation for the dart-dio Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | dart-dio | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Dart | | | helpTxt | Generates a Dart Dio client library. | | diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 7bae4db6903..aa68db809fe 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -7,6 +7,7 @@ title: Documentation for the dart-jaguar Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | dart-jaguar | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Dart | | | helpTxt | Generates a Dart Jaguar client library. | | diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 0193acff4a9..190fd2cd8ae 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -7,6 +7,7 @@ title: Documentation for the dart Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | dart | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Dart | | | helpTxt | Generates a Dart 2.x client library. | | diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index ff0c25132f5..d7c58fc6869 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -7,6 +7,7 @@ title: Documentation for the dynamic-html Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | dynamic-html | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | helpTxt | Generates a dynamic HTML site. | | diff --git a/docs/generators/eiffel.md b/docs/generators/eiffel.md index b9406ac1f60..c462e16da44 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -7,6 +7,7 @@ title: Documentation for the eiffel Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | eiffel | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Eiffel | | | helpTxt | Generates a Eiffel client library (beta). | | diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index 74447410848..a71bf4df0a7 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -7,6 +7,7 @@ title: Documentation for the elixir Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | elixir | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Elixir | | | helpTxt | Generates an elixir client library (alpha). | | diff --git a/docs/generators/elm.md b/docs/generators/elm.md index c26c96f85eb..99ddd6afb20 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -7,6 +7,7 @@ title: Documentation for the elm Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | elm | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Elm | | | helpTxt | Generates an Elm client library. | | diff --git a/docs/generators/erlang-client.md b/docs/generators/erlang-client.md index afa0291fd21..31c0a53e805 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -7,6 +7,7 @@ title: Documentation for the erlang-client Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | erlang-client | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Erlang | | | helpTxt | Generates an Erlang client library (beta). | | diff --git a/docs/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 48571920cfd..08ca60c92f1 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -7,6 +7,7 @@ title: Documentation for the erlang-proper Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | erlang-proper | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Erlang | | | helpTxt | Generates an Erlang library with PropEr generators (beta). | | diff --git a/docs/generators/erlang-server.md b/docs/generators/erlang-server.md index 15a38755f5a..77677a3d6c1 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -7,6 +7,7 @@ title: Documentation for the erlang-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | erlang-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Erlang | | | helpTxt | Generates an Erlang server library (beta) using OpenAPI Generator (https://openapi-generator.tech). By default, it will also generate service classes, which can be disabled with the `-Dnoservice` environment variable. | | diff --git a/docs/generators/flash-deprecated.md b/docs/generators/flash-deprecated.md index b5669b0e2ea..1ac45d4a6d3 100644 --- a/docs/generators/flash-deprecated.md +++ b/docs/generators/flash-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the flash-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | flash-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Flash | | | helpTxt | Generates a Flash (ActionScript) client library (beta). IMPORTANT: this generator has been deprecated in v5.x | | diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index 5d148d8fe2f..80f49c5c4f4 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -7,6 +7,7 @@ title: Documentation for the fsharp-functions Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | fsharp-functions | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | F# | | | helpTxt | Generates a fsharp-functions server (beta). | | diff --git a/docs/generators/fsharp-giraffe-server.md b/docs/generators/fsharp-giraffe-server.md index 176603a3135..289cf42a68a 100644 --- a/docs/generators/fsharp-giraffe-server.md +++ b/docs/generators/fsharp-giraffe-server.md @@ -7,6 +7,7 @@ title: Documentation for the fsharp-giraffe-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | fsharp-giraffe-server | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | F# | | | helpTxt | Generates a F# Giraffe server (beta). | | diff --git a/docs/generators/go-deprecated.md b/docs/generators/go-deprecated.md index fa44c2c81ad..978447f56b9 100644 --- a/docs/generators/go-deprecated.md +++ b/docs/generators/go-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the go-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | go-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Go | | | helpTxt | Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead. | | diff --git a/docs/generators/go-echo-server.md b/docs/generators/go-echo-server.md index 9f4a8e2e236..dc3fd01982d 100644 --- a/docs/generators/go-echo-server.md +++ b/docs/generators/go-echo-server.md @@ -7,6 +7,7 @@ title: Documentation for the go-echo-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | go-echo-server | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Go | | | helpTxt | Generates a go-echo server. (Beta) | | diff --git a/docs/generators/go-gin-server.md b/docs/generators/go-gin-server.md index 86f6b26bdd8..d7989246b6b 100644 --- a/docs/generators/go-gin-server.md +++ b/docs/generators/go-gin-server.md @@ -7,6 +7,7 @@ title: Documentation for the go-gin-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | go-gin-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Go | | | helpTxt | Generates a Go server library with the gin framework using OpenAPI-Generator.By default, it will also generate service classes. | | diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index 310a212a504..f17d5eb1106 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -7,6 +7,7 @@ title: Documentation for the go-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | go-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Go | | | helpTxt | Generates a Go server library using OpenAPI-Generator. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | diff --git a/docs/generators/go.md b/docs/generators/go.md index 4a005d47ac0..066b561c154 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -7,6 +7,7 @@ title: Documentation for the go Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | go | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Go | | | helpTxt | Generates a Go client library. | | diff --git a/docs/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index 8d323b1b7bc..593c0488ded 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -7,6 +7,7 @@ title: Documentation for the graphql-nodejs-express-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | graphql-nodejs-express-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Javascript | | | helpTxt | Generates a GraphQL Node.js Express server (beta) including it's types, queries, mutations, (resolvers) | | diff --git a/docs/generators/graphql-schema.md b/docs/generators/graphql-schema.md index a5c60cf1a15..bb2fb950265 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -7,6 +7,7 @@ title: Documentation for the graphql-schema Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | graphql-schema | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SCHEMA | | | generator language | GraphQL | | | helpTxt | Generates GraphQL schema files (beta) | | diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index a7d42bb7c05..2b1aadd5398 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -7,6 +7,7 @@ title: Documentation for the groovy Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | groovy | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Groovy | | | helpTxt | Generates a Groovy API client. | | diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 8ffbcdb5cfd..13d7e7b478d 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -7,6 +7,7 @@ title: Documentation for the haskell-http-client Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | haskell-http-client | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Haskell | | | helpTxt | Generates a Haskell http-client library. | | diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index 3b472c8a28b..f1bc1a3e40e 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -7,6 +7,7 @@ title: Documentation for the haskell-yesod Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | haskell-yesod | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Haskell | | | helpTxt | Generates a haskell-yesod server. | | diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index b2ebcdaa699..cd49e615f46 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -7,6 +7,7 @@ title: Documentation for the haskell Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | haskell | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Haskell | | | helpTxt | Generates a Haskell server and client library. | | diff --git a/docs/generators/html.md b/docs/generators/html.md index d597f69ce9e..056f8ccb7bd 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -7,6 +7,7 @@ title: Documentation for the html Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | html | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | helpTxt | Generates a static HTML file. | | diff --git a/docs/generators/html2.md b/docs/generators/html2.md index 0e99b15a11e..d4fa263b979 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -7,6 +7,7 @@ title: Documentation for the html2 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | html2 | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | helpTxt | Generates a static HTML file. | | diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index d397419112f..45e001e20c1 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -7,6 +7,7 @@ title: Documentation for the java-inflector Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-inflector | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java Inflector Server application. | | diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 75c961bcf92..9c6ead8858d 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -7,6 +7,7 @@ title: Documentation for the java-micronaut-client Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-micronaut-client | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Java | | | helpTxt | Generates a Java Micronaut Client. | | diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 7b92e9cad42..ed489110832 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -7,6 +7,7 @@ title: Documentation for the java-msf4j Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-msf4j | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java Micro Service based on WSO2 Microservices Framework for Java (MSF4J) | | diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 18b27e77430..d782f1bc594 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -7,6 +7,7 @@ title: Documentation for the java-pkmst Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-pkmst | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a PKMST SpringBoot Server application using the SpringFox integration. Also enables EurekaServerClient / Zipkin / Spring-Boot admin | | diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index abc3d0b4239..fa402771d7b 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -7,6 +7,7 @@ title: Documentation for the java-play-framework Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-play-framework | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java Play Framework Server application. | | diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index b359cf88035..dab7af6ab14 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -7,6 +7,7 @@ title: Documentation for the java-undertow-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-undertow-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java Undertow Server application (beta). | | diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 4e599a29d08..f91bff636d7 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -7,6 +7,7 @@ title: Documentation for the java-vertx-web Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-vertx-web | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java Vert.x-Web Server (beta). | | diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 96ffc3ee975..2efeb21b042 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -7,6 +7,7 @@ title: Documentation for the java-vertx Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java-vertx | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a java-Vert.X Server library. | | diff --git a/docs/generators/java.md b/docs/generators/java.md index dae11b0a614..7cc9a069413 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -7,6 +7,7 @@ title: Documentation for the java Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | java | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | | helpTxt | Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more. | | diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 9d91580aba7..3e1091b4d65 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -7,6 +7,7 @@ title: Documentation for the javascript-apollo Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | javascript-apollo | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Javascript | | | helpTxt | Generates a JavaScript client library (beta) using Apollo RESTDatasource. | | diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index aa2b36502f9..054f051f232 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -7,6 +7,7 @@ title: Documentation for the javascript-closure-angular Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | javascript-closure-angular | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Javascript | | | helpTxt | Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en) | | diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index e404f23e631..0fb54da17cd 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -7,6 +7,7 @@ title: Documentation for the javascript-flowtyped Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | javascript-flowtyped | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Javascript | | | helpTxt | Generates a Javascript client library (beta) using Flow types and Fetch API. | | diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index ce8123c03b2..f4d7273d1e8 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -7,6 +7,7 @@ title: Documentation for the javascript Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | javascript | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Javascript | | | helpTxt | Generates a JavaScript client library. | | diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index b4f16bea4c9..cbaefddff3e 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-cxf-cdi Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-cxf-cdi | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an Apache CXF runtime and a Java EE runtime with CDI enabled. | | diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index a31c00fe698..addca8b4687 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-cxf-client Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-cxf-client | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | | helpTxt | Generates a Java JAXRS Client based on Apache CXF framework. | | diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 40fa6dfde17..35134cf1b80 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-cxf-extended Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-cxf-extended | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Extends jaxrs-cxf with options to generate a functional mock server. | | diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index ed251b835f0..960649abf88 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-cxf Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-cxf | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java JAXRS Server application based on Apache CXF framework. | | diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index f82ae05541c..2d34e322f49 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-jersey Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-jersey | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java JAXRS Server application based on Jersey framework. | | diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 7dff1caf8c7..491a91757a7 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-resteasy-eap Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-resteasy-eap | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java JAXRS-Resteasy Server application. | | diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 32fb664d902..edf75370553 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-resteasy Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-resteasy | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java JAXRS-Resteasy Server application. | | diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 91bfa156aea..66492d46c03 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -7,6 +7,7 @@ title: Documentation for the jaxrs-spec Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jaxrs-spec | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification. | | diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 426ed04b4cc..3f3b3545862 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -7,6 +7,7 @@ title: Documentation for the jmeter Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | jmeter | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | | helpTxt | Generates a JMeter .jmx file. | | diff --git a/docs/generators/k6.md b/docs/generators/k6.md index 0ab38225e03..f26f01cfa31 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -7,6 +7,7 @@ title: Documentation for the k6 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | k6 | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | k6 | | | helpTxt | Generates a k6 script (beta). | | diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md index 3c5c6ca448d..d2d71faffd8 100644 --- a/docs/generators/kotlin-server-deprecated.md +++ b/docs/generators/kotlin-server-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the kotlin-server-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | kotlin-server-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | Kotlin | | | helpTxt | Generates a Kotlin server (Ktor v1.1.3). IMPORTANT: this generator has been deprecated. Please migrate to `kotlin-server` which supports Ktor v1.5.2+. | | diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index c0a473d9fd8..8e48bda46da 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -7,6 +7,7 @@ title: Documentation for the kotlin-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | kotlin-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Kotlin | | | helpTxt | Generates a Kotlin server. | | diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 8363a31d4bf..a773df36b05 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -7,6 +7,7 @@ title: Documentation for the kotlin-spring Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | kotlin-spring | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Kotlin | | | helpTxt | Generates a Kotlin Spring application. | | diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 30c0474ca76..17c3415382c 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -7,6 +7,7 @@ title: Documentation for the kotlin-vertx Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | kotlin-vertx | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Kotlin | | | helpTxt | Generates a kotlin-vertx server. | | diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index d825664c0c8..a942e2e3f9b 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -7,6 +7,7 @@ title: Documentation for the kotlin Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | kotlin | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Kotlin | | | helpTxt | Generates a Kotlin client. | | diff --git a/docs/generators/ktorm-schema.md b/docs/generators/ktorm-schema.md index b301b23a3bc..f7ff70e5590 100644 --- a/docs/generators/ktorm-schema.md +++ b/docs/generators/ktorm-schema.md @@ -7,6 +7,7 @@ title: Documentation for the ktorm-schema Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ktorm-schema | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SCHEMA | | | generator language | Ktorm | | | helpTxt | Generates a kotlin-ktorm schema (beta) | | diff --git a/docs/generators/lua.md b/docs/generators/lua.md index a890b08256f..18ec54ad4c0 100644 --- a/docs/generators/lua.md +++ b/docs/generators/lua.md @@ -7,6 +7,7 @@ title: Documentation for the lua Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | lua | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Lua | | | helpTxt | Generates a Lua client library (beta). | | diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 87e922f1b9d..71e1e6ac51a 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -7,6 +7,7 @@ title: Documentation for the markdown Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | markdown | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | DOCUMENTATION | | | helpTxt | Generates a markdown documentation. | | diff --git a/docs/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 0fa16e99328..1abe0062392 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -7,6 +7,7 @@ title: Documentation for the mysql-schema Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | mysql-schema | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SCHEMA | | | generator language | Mysql | | | helpTxt | Generates a MySQL schema based on the model or schema defined in the OpenAPI specification (v2, v3). | | diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 669b310cd31..fa582893419 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -7,6 +7,7 @@ title: Documentation for the nim Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | nim | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Nim | | | helpTxt | Generates a nim client (beta). | | diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index e530fd1a1b5..62d154361a4 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -7,6 +7,7 @@ title: Documentation for the nodejs-express-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | nodejs-express-server | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Javascript | | | helpTxt | Generates a NodeJS Express server (alpha). IMPORTANT: this generator may subject to breaking changes without further notice). | | diff --git a/docs/generators/objc.md b/docs/generators/objc.md index 11e1e4280bc..f15b6bcb49f 100644 --- a/docs/generators/objc.md +++ b/docs/generators/objc.md @@ -7,6 +7,7 @@ title: Documentation for the objc Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | objc | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Objective-C | | | helpTxt | Generates an Objective-C client library. | | diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index d1a5175be91..eaa087b13c6 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -7,6 +7,7 @@ title: Documentation for the ocaml Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ocaml | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | OCaml | | | helpTxt | Generates an OCaml client library (beta). | | diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index db86e36ac3d..c12743b4383 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -7,6 +7,7 @@ title: Documentation for the openapi-yaml Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | openapi-yaml | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | helpTxt | Creates a static openapi.yaml file (OpenAPI spec v3). | | diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index 754d65ebc26..f6ea2597cf0 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -7,6 +7,7 @@ title: Documentation for the openapi Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | openapi | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | DOCUMENTATION | | | helpTxt | Creates a static openapi.json file (OpenAPI spec v3.0). | | diff --git a/docs/generators/perl.md b/docs/generators/perl.md index 82bb14d553f..8a2245c05dd 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -7,6 +7,7 @@ title: Documentation for the perl Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | perl | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Perl | | | helpTxt | Generates a Perl client library. | | diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index 9ee8556dc2b..3642ebb5f0a 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -7,6 +7,7 @@ title: Documentation for the php-dt Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-dt | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | PHP | | | helpTxt | Generates a PHP client relying on Data Transfer ( https://github.com/Articus/DataTransfer ) and compliant with PSR-7, PSR-11, PSR-17 and PSR-18. | | diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index 0f4c9b9b43a..8a62c49894b 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -7,6 +7,7 @@ title: Documentation for the php-laravel Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-laravel | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates a PHP laravel server library. | | diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 44952212bd1..54148245f77 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -7,6 +7,7 @@ title: Documentation for the php-lumen Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-lumen | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates a PHP Lumen server library. | | diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 1060eb030ed..3905506371f 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -7,6 +7,7 @@ title: Documentation for the php-mezzio-ph Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-mezzio-ph | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates PHP server stub using Mezzio ( https://docs.mezzio.dev/mezzio/ ) and Path Handler ( https://github.com/Articus/PathHandler ). | | diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index df5ed167aec..ed0b98d2907 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the php-silex-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-silex-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates a PHP Silex server library. IMPORTANT NOTE: this generator is no longer actively maintained. | | diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index 19fb25e9a97..a3f433a625b 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the php-slim-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-slim-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates a PHP Slim Framework server library. IMPORTANT NOTE: this generator (Slim 3.x) is no longer actively maintained so please use 'php-slim4' generator instead. | | diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index b021d914077..cd8ab1f3468 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -7,6 +7,7 @@ title: Documentation for the php-slim4 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-slim4 | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates a PHP Slim 4 Framework server library(with Mock server). | | diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index da7aac53103..22184a49be2 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -7,6 +7,7 @@ title: Documentation for the php-symfony Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php-symfony | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | | helpTxt | Generates a PHP Symfony server bundle. | | diff --git a/docs/generators/php.md b/docs/generators/php.md index 113eb324755..fc04a4b5d81 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -7,6 +7,7 @@ title: Documentation for the php Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | php | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | PHP | | | helpTxt | Generates a PHP client library. | | diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index b2c4c230c0b..51dee6f7e47 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -7,6 +7,7 @@ title: Documentation for the plantuml Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | plantuml | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | DOCUMENTATION | | | helpTxt | Generates a plantuml documentation. | | diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index 7efbc46ff08..4c56c6e27fa 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -7,6 +7,7 @@ title: Documentation for the powershell Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | powershell | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | PowerShell | | | helpTxt | Generates a PowerShell API client (beta) | | diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index e8f8361bea0..913489defe9 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -7,6 +7,7 @@ title: Documentation for the protobuf-schema Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | protobuf-schema | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SCHEMA | | | generator language | Protocol Buffers (Protobuf) | | | helpTxt | Generates gRPC and protocol buffer schema files (beta) | | diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 79ee486c1ea..7578a6be290 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -7,8 +7,10 @@ title: Documentation for the python-aiohttp Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python-aiohttp | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Python | | +| generator language version | 3.5.2+ | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index bd5d365f4fb..1759a675b6c 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -7,8 +7,10 @@ title: Documentation for the python-blueplanet Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python-blueplanet | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Python | | +| generator language version | 2.7+ and 3.5.2+ | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 49e06706d54..968f0d3fb2e 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -7,8 +7,10 @@ title: Documentation for the python-experimental Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python-experimental | pass this to the generate command after -g | +| generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Python | | +| generator language version | >=3.9 | | | helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | ## CONFIG OPTIONS diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index 72a438df371..2464a81f1bc 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -7,9 +7,11 @@ title: Documentation for the python-fastapi Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python-fastapi | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Python | | -| helpTxt | Generates a Python FastAPI server (beta). | | +| generator language version | 3.7 | | +| helpTxt | Generates a Python FastAPI server (beta). Models are defined with the pydantic library | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index 084f4723afc..21e2ab52495 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -7,8 +7,10 @@ title: Documentation for the python-flask Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python-flask | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Python | | +| generator language version | 2.7 and 3.5.2+ | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-legacy.md b/docs/generators/python-legacy.md index 43d89e0b844..8b4a7e2a948 100644 --- a/docs/generators/python-legacy.md +++ b/docs/generators/python-legacy.md @@ -7,8 +7,10 @@ title: Documentation for the python-legacy Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python-legacy | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Python | | +| generator language version | 2.7 and 3.4+ | | | helpTxt | Generates a Python client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/python.md b/docs/generators/python.md index 3db4f227b07..b6a2df4f9c2 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -7,8 +7,10 @@ title: Documentation for the python Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | python | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Python | | +| generator language version | >=3.6 | | | helpTxt | Generates a Python client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/r.md b/docs/generators/r.md index f2ab5c63832..b5eef889bfa 100644 --- a/docs/generators/r.md +++ b/docs/generators/r.md @@ -7,6 +7,7 @@ title: Documentation for the r Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | r | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | R | | | helpTxt | Generates a R client library (beta). | | diff --git a/docs/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index 3473ee666cd..84b67956163 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -7,6 +7,7 @@ title: Documentation for the ruby-on-rails Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ruby-on-rails | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Ruby | | | helpTxt | Generates a Ruby on Rails (v5) server library. | | diff --git a/docs/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index 981be7d3c32..56aff137de1 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -7,6 +7,7 @@ title: Documentation for the ruby-sinatra Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ruby-sinatra | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Ruby | | | helpTxt | Generates a Ruby Sinatra server library. | | diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 126d32b111b..c635612e090 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -7,6 +7,7 @@ title: Documentation for the ruby Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | ruby | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Ruby | | | helpTxt | Generates a Ruby client library. | | diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md index b669ac3fae9..d894959db87 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -7,6 +7,7 @@ title: Documentation for the rust-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | rust-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Rust | | | helpTxt | Generates a Rust client/server library (beta) using the openapi-generator project. | | diff --git a/docs/generators/rust.md b/docs/generators/rust.md index 6637bf69098..cc2f93c4b89 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -7,6 +7,7 @@ title: Documentation for the rust Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | rust | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Rust | | | helpTxt | Generates a Rust client library (beta). | | diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 33fa8817eb8..172d71db74f 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -7,6 +7,7 @@ title: Documentation for the scala-akka-http-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-akka-http-server | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SERVER | | | generator language | Scala | | | helpTxt | Generates a scala-akka-http server (beta). | | diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index 9612a78014a..b3a160f5dea 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -7,6 +7,7 @@ title: Documentation for the scala-akka Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-akka | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Scala | | | helpTxt | Generates a Scala client library (beta) base on Akka/Spray. | | diff --git a/docs/generators/scala-finch.md b/docs/generators/scala-finch.md index 02ebc385796..2b732d98f07 100644 --- a/docs/generators/scala-finch.md +++ b/docs/generators/scala-finch.md @@ -7,6 +7,7 @@ title: Documentation for the scala-finch Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-finch | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | | helpTxt | Generates a Scala server application with Finch. | | diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index fc111db2002..51e3084079c 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -7,6 +7,7 @@ title: Documentation for the scala-gatling Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-gatling | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Scala | | | helpTxt | Generates a gatling simulation library (beta). | | diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index 6760f78c776..3b7d7a9ef28 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the scala-httpclient-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-httpclient-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Scala | | | helpTxt | Generates a Scala client library (beta). IMPORTANT: This generator is no longer actively maintained and will be deprecated. PLease use 'scala-akka' generator instead. | | diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index aae66c6de02..bc8984497d1 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -7,6 +7,7 @@ title: Documentation for the scala-lagom-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-lagom-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | | helpTxt | Generates a Lagom API server (Beta) in scala | | diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index ebe594a10a9..4a78dfb8271 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -7,6 +7,7 @@ title: Documentation for the scala-play-server Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-play-server | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | | helpTxt | Generates a Scala server application (beta) with Play Framework. | | diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index 7bd25ecef96..d1ef1d48cdc 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -7,6 +7,7 @@ title: Documentation for the scala-sttp Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scala-sttp | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | CLIENT | | | generator language | Scala | | | helpTxt | Generates a Scala client library (beta) based on Sttp. | | diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index 3e52e8e9f9a..03a957f6ef8 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -7,6 +7,7 @@ title: Documentation for the scalatra Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scalatra | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | | helpTxt | Generates a Scala server application with Scalatra. | | diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 077d1d3d14f..81af6b8eb8f 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -7,6 +7,7 @@ title: Documentation for the scalaz Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | scalaz | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Scala | | | helpTxt | Generates a Scalaz client library (beta) that uses http4s | | diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 8dee03a692a..bf67e6f53b9 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -7,6 +7,7 @@ title: Documentation for the spring Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | spring | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | | helpTxt | Generates a Java SpringBoot Server application using the SpringFox integration. | | diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md index 26c3dbaf030..f2eaf80a50b 100644 --- a/docs/generators/swift4-deprecated.md +++ b/docs/generators/swift4-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the swift4-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | swift4-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Swift | | | helpTxt | Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.) | | diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 2d9b0128973..4183ade7215 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -7,6 +7,7 @@ title: Documentation for the swift5 Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | swift5 | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Swift | | | helpTxt | Generates a Swift 5.x client library. | | diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 112ec3f54da..b92521c6a3e 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-angular Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-angular | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript Angular (6.x - 13.x) client library. | | diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index 4490fc90ba6..5f9e08c77c4 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-angularjs-deprecated Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-angularjs-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript AngularJS client library. This generator has been deprecated and will be removed in the future release. | | diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 6c2b5d91f99..eb24409651a 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-aurelia Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-aurelia | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript client library for the Aurelia framework (beta). | | diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 244b5471e3d..05e51236f5e 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-axios Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-axios | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript client library using axios. | | diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 104a33cf745..f548480236b 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-fetch Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-fetch | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript client library using Fetch API (beta). | | diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index ceca00588a3..c79ad504731 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-inversify Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-inversify | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates Typescript services using Inversify IOC | | diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 7f89c8e326d..4cdac527636 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-jquery Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-jquery | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript jquery client library. | | diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index f6cd75a328c..bfab1479590 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-nestjs Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-nestjs | pass this to the generate command after -g | +| generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript Nestjs 6.x client library. | | diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index 03c988d6f25..f017b86055f 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-node Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-node | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript NodeJS client library. | | diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 85fc2a548c7..c7d325a40fa 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-redux-query Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-redux-query | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript client library using redux-query API (beta). | | diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 06ef6aa84b7..2e4febab52a 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -7,6 +7,7 @@ title: Documentation for the typescript-rxjs Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript-rxjs | pass this to the generate command after -g | +| generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript client library using Rxjs API. | | diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index 8659b4fbf96..4172f40be71 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -7,6 +7,7 @@ title: Documentation for the typescript Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | typescript | pass this to the generate command after -g | +| generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Typescript | | | helpTxt | Generates a TypeScript client library using Fetch API (beta). | | diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index 131d78b443b..b0ec6860192 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -7,6 +7,7 @@ title: Documentation for the wsdl-schema Generator | Property | Value | Notes | | -------- | ----- | ----- | | generator name | wsdl-schema | pass this to the generate command after -g | +| generator stability | BETA | | | generator type | SCHEMA | | | generator language | Web Services Description Language (WSDL) | | | helpTxt | Generates WSDL files. | | diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 35e16eaf0e3..73858d84691 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -303,10 +303,14 @@ public class ConfigHelp extends OpenApiGeneratorCommand { sb.append("| Property | Value | Notes |").append(newline); sb.append("| -------- | ----- | ----- |").append(newline); sb.append("| generator name | "+config.getName()+" | pass this to the generate command after -g |").append(newline); + sb.append("| generator stability | "+config.getGeneratorMetadata().getStability()+" | |").append(newline); sb.append("| generator type | "+config.getTag()+" | |").append(newline); if (config.generatorLanguage() != null) { sb.append("| generator language | "+config.generatorLanguage().toString()+" | |").append(newline); } + if (config.generatorLanguageVersion() != null) { + sb.append("| generator language version | "+config.generatorLanguageVersion()+" | |").append(newline); + } sb.append("| helpTxt | "+config.getHelp()+" | |").append(newline); sb.append(newline); 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 7e6bc07dede..952d3a841f2 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 @@ -308,4 +308,10 @@ public interface CodegenConfig { public String defaultTemplatingEngine(); public GeneratorLanguage generatorLanguage(); + + /* + the version of the language that the generator implements + For python 3.9.0, generatorLanguageVersion would be "3.9.0" + */ + public String generatorLanguageVersion(); } 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 1744cb31736..d4c70494f97 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 @@ -7364,4 +7364,7 @@ public class DefaultCodegen implements CodegenConfig { @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; } + + @Override + public String generatorLanguageVersion() { return null; }; } 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 8e3d27c6cd9..b4c4296f1b1 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 @@ -788,6 +788,7 @@ public class DefaultGenerator implements Generator { bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar)); bundle.put("modelPackage", config.modelPackage()); bundle.put("library", config.getLibrary()); + bundle.put("generatorLanguageVersion", config.generatorLanguageVersion()); // todo verify support and operation bundles have access to the common variables addAuthenticationSwitches(bundle); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java index c5474260b62..d497c8a0e01 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java @@ -75,4 +75,7 @@ public class PythonAiohttpConnexionServerCodegen extends AbstractPythonConnexion supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); } + + @Override + public String generatorLanguageVersion() { return "3.5.2+"; }; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java index 964b942e864..fd381e52974 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java @@ -265,4 +265,6 @@ public class PythonBluePlanetServerCodegen extends AbstractPythonConnexionServer return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); } + @Override + public String generatorLanguageVersion() { return "2.7+ and 3.5.2+"; }; } 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 6273a453183..2d1b6253612 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 @@ -123,7 +123,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.EXPERIMENTAL) + .stability(Stability.STABLE) .build(); } @@ -1501,4 +1501,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { } return modelNameToSchemaCache; } + + @Override + public String generatorLanguageVersion() { return ">=3.6"; }; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 6d1aebdac02..8c6529e99e0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -2080,4 +2080,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { public String defaultTemplatingEngine() { return "handlebars"; } + + @Override + public String generatorLanguageVersion() { return ">=3.9"; }; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java index 6ee1131973e..72001434c03 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java @@ -72,7 +72,7 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen { @Override public String getHelp() { - return "Generates a Python FastAPI server (beta)."; + return "Generates a Python FastAPI server (beta). Models are defined with the pydantic library"; } public PythonFastAPIServerCodegen() { @@ -294,4 +294,7 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen { String regex = super.toRegularExpression(pattern); return StringUtils.substring(regex, 1, -1); } + + @Override + public String generatorLanguageVersion() { return "3.7"; }; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java index 79fa8885b2e..a9358b4007a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java @@ -54,4 +54,7 @@ public class PythonFlaskConnexionServerCodegen extends AbstractPythonConnexionSe supportingFiles.add(new SupportingFile("__init__.mustache", packagePath(), "__init__.py")); testPackage = packageName + "." + testPackage; } + + @Override + public String generatorLanguageVersion() { return "2.7 and 3.5.2+"; }; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java index 05b5b92df39..7fc09f0cbfa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java @@ -17,7 +17,6 @@ package org.openapitools.codegen.languages; -import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; @@ -435,4 +434,7 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements public String generatePackageName(String packageName) { return underscore(packageName.replaceAll("[^\\w]+", "")); } + + @Override + public String generatorLanguageVersion() { return "2.7 and 3.4+"; }; } diff --git a/modules/openapi-generator/src/main/resources/python-aiohttp/README.mustache b/modules/openapi-generator/src/main/resources/python-aiohttp/README.mustache index a9730470093..42dd581c40e 100644 --- a/modules/openapi-generator/src/main/resources/python-aiohttp/README.mustache +++ b/modules/openapi-generator/src/main/resources/python-aiohttp/README.mustache @@ -8,7 +8,7 @@ is an example of building a OpenAPI-enabled aiohttp server. This example uses the [Connexion](https://github.com/zalando/connexion) library on top of aiohttp. ## Requirements -Python 3.5.2+ +Python {{{generatorLanguageVersion}}} ## Usage To run the server, please execute the following from the root directory: diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars index e03e96972ab..aee6b66db62 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/README.handlebars @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python >= 3.9 +Python {{generatorLanguageVersion}} v3.9 is needed so one can combine classmethod and property decorators to define object schema properties as classes diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars index f9fda7de212..63f959375b0 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/README_onlypackage.handlebars @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python >= 3.6 +Python {{generatorLanguageVersion}} ## Installation & Usage diff --git a/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars index 476157a0c5d..7045d259412 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/setup.handlebars @@ -39,7 +39,7 @@ setup( author_email="{{#if infoEmail}}{{infoEmail}}{{/if}}{{#unless infoEmail}}team@openapitools.org{{/unless}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires=">=3.9", + python_requires="{{{generatorLanguageVersion}}}", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/Dockerfile.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/Dockerfile.mustache index b66458eb417..2136eab06e5 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/Dockerfile.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/Dockerfile.mustache @@ -1,4 +1,4 @@ -FROM python:3.7 AS builder +FROM python:{{{generatorLanguageVersion}}} AS builder WORKDIR /usr/src/app @@ -11,7 +11,7 @@ COPY . . RUN pip install --no-cache-dir . -FROM python:3.7 AS test_runner +FROM python:{{{generatorLanguageVersion}}} AS test_runner WORKDIR /tmp COPY --from=builder /venv /venv COPY --from=builder /usr/src/app/tests tests @@ -24,7 +24,7 @@ RUN pip install pytest RUN pytest tests -FROM python:3.7 AS service +FROM python:{{{generatorLanguageVersion}}} AS service WORKDIR /root/app/site-packages COPY --from=test_runner /venv /venv ENV PATH=/venv/bin:$PATH diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache index c426a965f0f..8e6e65b7e8b 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/README.mustache @@ -10,7 +10,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.7 +Python >= {{{generatorLanguageVersion}}} ## Installation & Usage diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/setup_cfg.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/setup_cfg.mustache index 2934cb8fc53..97721bdc497 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/setup_cfg.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/setup_cfg.mustache @@ -4,11 +4,11 @@ version = {{appVersion}} description = {{appDescription}} long_description = file: README.md keywords = OpenAPI {{appName}} -python_requires = >= 3.7.* +python_requires = >= {{{generatorLanguageVersion}}}.* classifiers = Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 + Programming Language :: Python :: {{{generatorLanguageVersion}}} [options] install_requires = diff --git a/modules/openapi-generator/src/main/resources/python-legacy/README.mustache b/modules/openapi-generator/src/main/resources/python-legacy/README.mustache index 71f0ef69bbd..ae4af162a14 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/README.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/README.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python 2.7 and 3.4+ +Python {{{generatorLanguageVersion}}} ## Installation & Usage ### pip install diff --git a/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache index 3f1d5b1fc64..3f7e0860de3 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/README_onlypackage.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python 2.7 and 3.4+ +Python {{{generatorLanguageVersion}}} ## Installation & Usage diff --git a/modules/openapi-generator/src/main/resources/python/README.mustache b/modules/openapi-generator/src/main/resources/python/README.mustache index b066ed85961..b0d33e535ac 100644 --- a/modules/openapi-generator/src/main/resources/python/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/README.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python >= 3.6 +Python {{{generatorLanguageVersion}}} ## Installation & Usage ### pip install diff --git a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache index 79457c4b59b..ba08a3acfea 100644 --- a/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache +++ b/modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python >= 3.6 +Python {{{generatorLanguageVersion}}} ## Installation & Usage diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache index af494177549..5f557825638 100644 --- a/modules/openapi-generator/src/main/resources/python/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/setup.mustache @@ -37,7 +37,7 @@ setup( author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires=">=3.6", + python_requires="{{{generatorLanguageVersion}}}", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 5f53c0f6423..8e57b995b3e 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.6 +Python >=3.6 ## Installation & Usage ### pip install diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md index 5f53c0f6423..8e57b995b3e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.6 +Python >=3.6 ## Installation & Usage ### pip install diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md index 86eababfa80..72ef1f59d6c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.6 +Python >=3.6 ## Installation & Usage ### pip install diff --git a/samples/openapi3/client/features/dynamic-servers/python/README.md b/samples/openapi3/client/features/dynamic-servers/python/README.md index df93218ea4b..7d9ade3fca6 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/README.md +++ b/samples/openapi3/client/features/dynamic-servers/python/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.6 +Python >=3.6 ## Installation & Usage ### pip install diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 5798de014b7..98ccaf5dbbc 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.9 +Python >=3.9 v3.9 is needed so one can combine classmethod and property decorators to define object schema properties as classes diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index f8ceed3eb8e..2d83d666f8e 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python >= 3.6 +Python >=3.6 ## Installation & Usage ### pip install From b05faefb9304839b6c0d1f1d5e56fcb82d2f2456 Mon Sep 17 00:00:00 2001 From: joaocmendes Date: Tue, 11 Jan 2022 03:02:39 +0000 Subject: [PATCH 024/113] [BUG][csharp-netcore] Fix Multi Files for the same FormField (#11132) (#11259) * [BUG][csharp-netcore] Fix Multi Files for the some FormField (#11132) Make FileParamerts a Multimap to enable sending more than one file with the same key. * update documentation for csharp-netcore --- .../resources/csharp-netcore/ApiClient.mustache | 15 +++++++++------ .../csharp-netcore/RequestOptions.mustache | 4 ++-- .../libraries/httpclient/ApiClient.mustache | 10 ++++++---- .../libraries/httpclient/RequestOptions.mustache | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 10 ++++++---- .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- .../src/Org.OpenAPITools/Client/ApiClient.cs | 15 +++++++++------ .../src/Org.OpenAPITools/Client/RequestOptions.cs | 4 ++-- 20 files changed, 104 insertions(+), 76 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index d533d30f901..e42b50fbd8b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -371,12 +371,15 @@ namespace {{packageName}}.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache index dc924c733c1..a3f9691b8d2 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/RequestOptions.mustache @@ -38,7 +38,7 @@ namespace {{packageName}}.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -59,7 +59,7 @@ namespace {{packageName}}.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index bd7663012f1..f62f0e9423f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -278,10 +278,12 @@ namespace {{packageName}}.Client { foreach (var fileParam in options.FileParameters) { - var content = new StreamContent(fileParam.Value.Content); - content.Headers.ContentType = new MediaTypeHeaderValue(fileParam.Value.ContentType); - multipartContent.Add(content, fileParam.Key, - fileParam.Value.Name); + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } } } return multipartContent; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/RequestOptions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/RequestOptions.mustache index bc5a8e348b8..62859649ced 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/RequestOptions.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/RequestOptions.mustache @@ -38,7 +38,7 @@ namespace {{packageName}}.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -59,7 +59,7 @@ namespace {{packageName}}.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs index 11f158d6943..3c817d1a646 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs @@ -370,12 +370,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs index 8cbf48a6032..6ebad92d947 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs index ab6f1f72507..96ed4f89595 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs @@ -370,12 +370,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RequestOptions.cs index 7a1d5b97a88..68cd1637590 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs index b6d9195b3f6..997930301f6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -277,10 +277,12 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var content = new StreamContent(fileParam.Value.Content); - content.Headers.ContentType = new MediaTypeHeaderValue(fileParam.Value.ContentType); - multipartContent.Add(content, fileParam.Key, - fileParam.Value.Name); + foreach (var file in fileParam.Value) + { + var content = new StreamContent(file.Content); + content.Headers.ContentType = new MediaTypeHeaderValue(file.ContentType); + multipartContent.Add(content, fileParam.Key, file.Name); + } } } return multipartContent; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RequestOptions.cs index 91a5fbf28f3..70b67cb2590 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ApiClient.cs index 6f26226ea86..ffb05840d5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/ApiClient.cs @@ -371,12 +371,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RequestOptions.cs index 7a1d5b97a88..68cd1637590 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ApiClient.cs index 6f26226ea86..ffb05840d5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/ApiClient.cs @@ -371,12 +371,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RequestOptions.cs index 7a1d5b97a88..68cd1637590 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index ab6f1f72507..96ed4f89595 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -370,12 +370,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RequestOptions.cs index 7a1d5b97a88..68cd1637590 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index 6f26226ea86..ffb05840d5b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -371,12 +371,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RequestOptions.cs index 7a1d5b97a88..68cd1637590 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ApiClient.cs index 62f6adbb205..bf0d7413615 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/ApiClient.cs @@ -370,12 +370,15 @@ namespace Org.OpenAPITools.Client { foreach (var fileParam in options.FileParameters) { - var bytes = ClientUtils.ReadAsBytes(fileParam.Value); - var fileStream = fileParam.Value as FileStream; - if (fileStream != null) - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); - else - request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + foreach (var file in fileParam.Value) + { + var bytes = ClientUtils.ReadAsBytes(file); + var fileStream = file as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RequestOptions.cs index c6b3ccc38f2..b21e8c5ffcd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RequestOptions.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Multimap FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Multimap(); Cookies = new List(); } } From f06e7c52f4aee6e6c53fe129e5f4f07161dcc660 Mon Sep 17 00:00:00 2001 From: Anakael Date: Tue, 11 Jan 2022 07:09:33 +0300 Subject: [PATCH 025/113] Add only one auth header (#11272) --- .../resources/csharp-netcore/api.mustache | 12 +++---- .../src/Org.OpenAPITools/Api/FakeApi.cs | 8 ++--- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +++++++++---------- .../src/Org.OpenAPITools/Api/FakeApi.cs | 8 ++--- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +++++++++---------- .../src/Org.OpenAPITools/Api/FakeApi.cs | 8 ++--- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +++++++++---------- .../src/Org.OpenAPITools/Api/FakeApi.cs | 8 ++--- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +++++++++---------- .../src/Org.OpenAPITools/Api/FakeApi.cs | 8 ++--- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +++++++++---------- .../src/Org.OpenAPITools/Api/PetApi.cs | 28 ++++++++-------- 12 files changed, 120 insertions(+), 120 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index ce2000f63e9..c4824e8db8a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -415,21 +415,21 @@ namespace {{packageName}}.{{apiPackage}} {{/isApiKey}} {{#isBasicBasic}} // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } {{/isBasicBasic}} {{#isBasicBearer}} // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } {{/isBasicBearer}} {{#isOAuth}} // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -640,14 +640,14 @@ namespace {{packageName}}.{{apiPackage}} {{#isBasic}} {{#isBasicBasic}} // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } {{/isBasicBasic}} {{#isBasicBearer}} // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -655,7 +655,7 @@ namespace {{packageName}}.{{apiPackage}} {{/isBasic}} {{#isOAuth}} // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs index 57a99469634..5f1dae74c24 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2188,7 +2188,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2336,7 +2336,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2634,7 +2634,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2724,7 +2724,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs index 39d2e425e63..b42f2c168ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs @@ -633,7 +633,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -723,7 +723,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -793,7 +793,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -865,7 +865,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -954,7 +954,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1045,7 +1045,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1136,7 +1136,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1229,7 +1229,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1451,7 +1451,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1541,7 +1541,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1618,7 +1618,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1697,7 +1697,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1776,7 +1776,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1857,7 +1857,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1939,7 +1939,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2023,7 +2023,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs index 57a99469634..5f1dae74c24 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2188,7 +2188,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2336,7 +2336,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2634,7 +2634,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2724,7 +2724,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs index 39d2e425e63..b42f2c168ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs @@ -633,7 +633,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -723,7 +723,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -793,7 +793,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -865,7 +865,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -954,7 +954,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1045,7 +1045,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1136,7 +1136,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1229,7 +1229,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1451,7 +1451,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1541,7 +1541,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1618,7 +1618,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1697,7 +1697,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1776,7 +1776,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1857,7 +1857,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1939,7 +1939,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2023,7 +2023,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs index 57a99469634..5f1dae74c24 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2188,7 +2188,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2336,7 +2336,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2634,7 +2634,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2724,7 +2724,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs index 39d2e425e63..b42f2c168ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -633,7 +633,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -723,7 +723,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -793,7 +793,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -865,7 +865,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -954,7 +954,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1045,7 +1045,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1136,7 +1136,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1229,7 +1229,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1451,7 +1451,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1541,7 +1541,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1618,7 +1618,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1697,7 +1697,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1776,7 +1776,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1857,7 +1857,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1939,7 +1939,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2023,7 +2023,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 57a99469634..5f1dae74c24 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2188,7 +2188,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2336,7 +2336,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2634,7 +2634,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2724,7 +2724,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 39d2e425e63..b42f2c168ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -633,7 +633,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -723,7 +723,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -793,7 +793,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -865,7 +865,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -954,7 +954,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1045,7 +1045,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1136,7 +1136,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1229,7 +1229,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1451,7 +1451,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1541,7 +1541,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1618,7 +1618,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1697,7 +1697,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1776,7 +1776,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1857,7 +1857,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1939,7 +1939,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2023,7 +2023,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 57a99469634..5f1dae74c24 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2188,7 +2188,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2336,7 +2336,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2634,7 +2634,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2724,7 +2724,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index 39d2e425e63..b42f2c168ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -633,7 +633,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -723,7 +723,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -793,7 +793,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -865,7 +865,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -954,7 +954,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1045,7 +1045,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1136,7 +1136,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1229,7 +1229,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1451,7 +1451,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1541,7 +1541,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1618,7 +1618,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1697,7 +1697,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1776,7 +1776,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1857,7 +1857,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1939,7 +1939,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2023,7 +2023,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs index 08b2900cec6..3912ab8d5f7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs @@ -571,7 +571,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -648,7 +648,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -718,7 +718,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -790,7 +790,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -863,7 +863,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -938,7 +938,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1013,7 +1013,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1090,7 +1090,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1299,7 +1299,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1376,7 +1376,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1453,7 +1453,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1532,7 +1532,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1611,7 +1611,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1692,7 +1692,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } From 1f7eebd52d495e1a9843467ab6046c2726358fec Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 10 Jan 2022 20:11:57 -0800 Subject: [PATCH 026/113] Fixes openapi-generator.tech content, python-exp documentation helpTxt updated (#11273) * Fixes python-exp line breaks * Docs updated --- docs/generators/python-experimental.md | 2 +- .../codegen/languages/PythonExperimentalClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 968f0d3fb2e..00614e6ccb1 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -11,7 +11,7 @@ title: Documentation for the python-experimental Generator | generator type | CLIENT | | | generator language | Python | | | generator language version | >=3.9 | | -| helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | +| helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 8c6529e99e0..2bcbcef08d0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -499,7 +499,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { @Override public String getHelp() { String newLine = System.getProperty("line.separator"); - return String.join("
", + return String.join("
", "Generates a Python client library", "", "Features in this generator:", From 45b66d660a9c94e3fa420d9ecfd81b4e8d863b9d Mon Sep 17 00:00:00 2001 From: jiangyuan Date: Tue, 11 Jan 2022 15:21:29 +0800 Subject: [PATCH 027/113] [python] modify python import classVarName to classFileName (#11180) * fix python import classVarName to classFileName * add samples change --- .../resources/python-experimental/README_common.handlebars | 4 ++-- .../resources/python-experimental/__init__apis.handlebars | 4 ++-- .../resources/python-experimental/api_doc_example.handlebars | 4 ++-- .../src/main/resources/python-legacy/__init__api.mustache | 2 +- .../src/main/resources/python-legacy/__init__package.mustache | 2 +- .../src/main/resources/python-legacy/api_test.mustache | 4 ++-- .../src/main/resources/python/README_common.mustache | 4 ++-- .../src/main/resources/python/__init__apis.mustache | 4 ++-- .../src/main/resources/python/api_doc_example.mustache | 4 ++-- .../src/main/resources/python/api_test.mustache | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars index 17663663d7c..5c57735164b 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/README_common.handlebars @@ -6,7 +6,7 @@ from pprint import pprint {{#with apiInfo}} {{#each apis}} {{#if @first}} -from {{packageName}}.{{apiPackage}} import {{classVarName}} +from {{packageName}}.{{apiPackage}} import {{classFilename}} {{#each imports}} {{{import}}} {{/each}} @@ -18,7 +18,7 @@ from {{packageName}}.{{apiPackage}} import {{classVarName}} # 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 = {{classVarName}}.{{{classname}}}(api_client) + api_instance = {{classFilename}}.{{{classname}}}(api_client) {{#each allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{#unless required}} (optional){{/unless}}{{#if defaultValue}} (default to {{{.}}}){{/if}} {{/each}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars index c8466369da7..06fb33610b2 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/__init__apis.handlebars @@ -10,7 +10,7 @@ # raise a `RecursionError`. # In order to avoid this, import only the API that you directly need like: # -# from {{packagename}}.{{apiPackage}}.{{classVarName}} import {{classname}} +# from {{packagename}}.{{apiPackage}}.{{classFilename}} import {{classname}} # # or import this package, but before doing it, use: # @@ -19,6 +19,6 @@ # Import APIs into API package: {{/if}} -from {{packageName}}.{{apiPackage}}.{{classVarName}} import {{classname}} +from {{packageName}}.{{apiPackage}}.{{classFilename}} import {{classname}} {{/each}} {{/with}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars index eaa2260e3f0..e6fa0bd4edb 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_doc_example.handlebars @@ -1,6 +1,6 @@ ```python import {{{packageName}}} -from {{packageName}}.{{apiPackage}} import {{classVarName}} +from {{packageName}}.{{apiPackage}} import {{classFilename}} {{#each imports}} {{{.}}} {{/each}} @@ -9,7 +9,7 @@ from pprint import pprint # 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 = {{classVarName}}.{{{classname}}}(api_client) + api_instance = {{classFilename}}.{{{classname}}}(api_client) {{#if requiredParams}} # example passing only required values which don't have defaults set diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache index db658a10fa8..c2232a92f4c 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/__init__api.mustache @@ -3,5 +3,5 @@ from __future__ import absolute_import # flake8: noqa # import apis into api package -{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}} +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache b/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache index f81dd5735fa..87a7f612d3b 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/__init__package.mustache @@ -9,7 +9,7 @@ from __future__ import absolute_import __version__ = "{{packageVersion}}" # import apis into sdk package -{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classVarName}} import {{classname}} +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}}{{/apiInfo}} # import ApiClient from {{packageName}}.api_client import ApiClient diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache index 6f8539bb0d6..a981c662a0d 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/api_test.mustache @@ -7,7 +7,7 @@ from __future__ import absolute_import import unittest import {{packageName}} -from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501 +from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 from {{packageName}}.rest import ApiException @@ -15,7 +15,7 @@ class {{#operations}}Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" def setUp(self): - self.api = {{apiPackage}}.{{classVarName}}.{{classname}}() # noqa: E501 + self.api = {{apiPackage}}.{{classFilename}}.{{classname}}() # noqa: E501 def tearDown(self): pass diff --git a/modules/openapi-generator/src/main/resources/python/README_common.mustache b/modules/openapi-generator/src/main/resources/python/README_common.mustache index 268d99beb5f..614a9d0c62e 100644 --- a/modules/openapi-generator/src/main/resources/python/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/README_common.mustache @@ -6,7 +6,7 @@ from pprint import pprint {{#apiInfo}} {{#apis}} {{#-first}} -from {{apiPackage}} import {{classVarName}} +from {{apiPackage}} import {{classFilename}} {{#imports}} {{{import}}} {{/imports}} @@ -18,7 +18,7 @@ from {{apiPackage}} import {{classVarName}} # 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 = {{classVarName}}.{{{classname}}}(api_client) + api_instance = {{classFilename}}.{{{classname}}}(api_client) {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/python/__init__apis.mustache b/modules/openapi-generator/src/main/resources/python/__init__apis.mustache index b4ec8a9a472..927bb6d52c4 100644 --- a/modules/openapi-generator/src/main/resources/python/__init__apis.mustache +++ b/modules/openapi-generator/src/main/resources/python/__init__apis.mustache @@ -9,7 +9,7 @@ # raise a `RecursionError`. # In order to avoid this, import only the API that you directly need like: # -# from {{packagename}}.api.{{classVarName}} import {{classname}} +# from {{packagename}}.api.{{classFilename}} import {{classname}} # # or import this package, but before doing it, use: # @@ -18,6 +18,6 @@ # Import APIs into API package: {{/-first}} -from {{apiPackage}}.{{classVarName}} import {{classname}} +from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}} {{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache index 6a08d7c660b..4d6d7bf1dd2 100644 --- a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache @@ -1,7 +1,7 @@ ```python import time import {{{packageName}}} -from {{apiPackage}} import {{classVarName}} +from {{apiPackage}} import {{classFilename}} {{#imports}} {{{.}}} {{/imports}} @@ -15,7 +15,7 @@ with {{{packageName}}}.ApiClient(configuration) as api_client: with {{{packageName}}}.ApiClient() as api_client: {{/hasAuthMethods}} # Create an instance of the API class - api_instance = {{classVarName}}.{{{classname}}}(api_client) + api_instance = {{classFilename}}.{{{classname}}}(api_client) {{#requiredParams}} {{^defaultValue}} {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} diff --git a/modules/openapi-generator/src/main/resources/python/api_test.mustache b/modules/openapi-generator/src/main/resources/python/api_test.mustache index 4b13fad2420..8f3d764d0a5 100644 --- a/modules/openapi-generator/src/main/resources/python/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_test.mustache @@ -3,7 +3,7 @@ import unittest import {{packageName}} -from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501 +from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 class {{#operations}}Test{{classname}}(unittest.TestCase): From ce04e9b6a2db14d152f24870de28637ae41bc0fb Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 11 Jan 2022 09:31:25 -0800 Subject: [PATCH 028/113] python-experimental, redundant docstrings removed (#11281) * Removes docstrings drom models because type hints already includes this info * Samples updated --- .../schema_composed_or_anytype.handlebars | 19 -------------- .../model_templates/schema_dict.handlebars | 19 -------------- .../model_templates/schema_list.handlebars | 9 ------- .../model_templates/schema_simple.handlebars | 8 ------ .../model/additional_properties_class.py | 12 --------- ...ditional_properties_with_array_of_enums.py | 4 --- .../petstore_api/model/address.py | 4 --- .../petstore_api/model/animal.py | 8 ------ .../petstore_api/model/animal_farm.py | 3 --- .../petstore_api/model/api_response.py | 7 ------ .../petstore_api/model/apple.py | 6 ----- .../petstore_api/model/apple_req.py | 4 --- .../model/array_holding_any_type.py | 3 --- .../model/array_of_array_of_number_only.py | 5 ---- .../petstore_api/model/array_of_enums.py | 3 --- .../model/array_of_number_only.py | 5 ---- .../petstore_api/model/array_test.py | 7 ------ .../model/array_with_validations_in_items.py | 7 ------ .../petstore_api/model/banana.py | 5 ---- .../petstore_api/model/banana_req.py | 4 --- .../petstore_api/model/basque_pig.py | 5 ---- .../petstore_api/model/boolean_enum.py | 2 -- .../petstore_api/model/capitalization.py | 10 -------- .../petstore_api/model/cat.py | 4 --- .../petstore_api/model/cat_all_of.py | 5 ---- .../petstore_api/model/category.py | 6 ----- .../petstore_api/model/child_cat.py | 4 --- .../petstore_api/model/child_cat_all_of.py | 5 ---- .../petstore_api/model/class_model.py | 5 ---- .../petstore_api/model/client.py | 5 ---- .../model/complex_quadrilateral.py | 4 --- .../model/complex_quadrilateral_all_of.py | 5 ---- ...d_any_of_different_types_no_validations.py | 4 --- .../petstore_api/model/composed_array.py | 3 --- .../petstore_api/model/composed_bool.py | 2 -- .../petstore_api/model/composed_none.py | 2 -- .../petstore_api/model/composed_number.py | 2 -- .../petstore_api/model/composed_object.py | 4 --- .../model/composed_one_of_different_types.py | 4 --- .../petstore_api/model/composed_string.py | 2 -- .../petstore_api/model/danish_pig.py | 5 ---- .../model/date_time_with_validations.py | 6 ----- .../model/date_with_validations.py | 6 ----- .../petstore_api/model/dog.py | 4 --- .../petstore_api/model/dog_all_of.py | 5 ---- .../petstore_api/model/drawing.py | 8 ------ .../petstore_api/model/enum_arrays.py | 6 ----- .../petstore_api/model/enum_class.py | 2 -- .../petstore_api/model/enum_test.py | 13 ---------- .../model/equilateral_triangle.py | 4 --- .../model/equilateral_triangle_all_of.py | 5 ---- .../petstore_api/model/file.py | 5 ---- .../model/file_schema_test_class.py | 6 ----- .../petstore_api/model/foo.py | 5 ---- .../petstore_api/model/format_test.py | 25 ------------------- .../petstore_api/model/fruit.py | 5 ---- .../petstore_api/model/fruit_req.py | 4 --- .../petstore_api/model/gm_fruit.py | 5 ---- .../petstore_api/model/grandparent_animal.py | 7 ------ .../petstore_api/model/has_only_read_only.py | 6 ----- .../petstore_api/model/health_check_result.py | 5 ---- .../model/inline_response_default.py | 5 ---- .../petstore_api/model/integer_enum.py | 2 -- .../petstore_api/model/integer_enum_big.py | 2 -- .../model/integer_enum_one_value.py | 2 -- .../model/integer_enum_with_default_value.py | 2 -- .../petstore_api/model/integer_max10.py | 6 ----- .../petstore_api/model/integer_min15.py | 6 ----- .../petstore_api/model/isosceles_triangle.py | 4 --- .../model/isosceles_triangle_all_of.py | 5 ---- .../petstore_api/model/mammal.py | 6 ----- .../petstore_api/model/map_test.py | 8 ------ ...perties_and_additional_properties_class.py | 7 ------ .../petstore_api/model/model200_response.py | 6 ----- .../petstore_api/model/model_return.py | 5 ---- .../petstore_api/model/name.py | 7 ------ .../model/no_additional_properties.py | 4 --- .../petstore_api/model/nullable_class.py | 16 ------------ .../petstore_api/model/nullable_shape.py | 6 ----- .../petstore_api/model/nullable_string.py | 2 -- .../petstore_api/model/number_only.py | 5 ---- .../model/number_with_validations.py | 6 ----- .../model/object_model_with_ref_props.py | 7 ------ .../object_with_difficultly_named_props.py | 7 ------ .../model/object_with_validations.py | 8 ------ .../petstore_api/model/order.py | 10 -------- .../petstore_api/model/parent_pet.py | 6 ----- .../petstore_api/model/pet.py | 10 -------- .../petstore_api/model/pig.py | 6 ----- .../petstore_api/model/player.py | 6 ----- .../petstore_api/model/quadrilateral.py | 6 ----- .../model/quadrilateral_interface.py | 6 ----- .../petstore_api/model/read_only_first.py | 6 ----- .../petstore_api/model/scalene_triangle.py | 4 --- .../model/scalene_triangle_all_of.py | 5 ---- .../petstore_api/model/shape.py | 6 ----- .../petstore_api/model/shape_or_null.py | 6 ----- .../model/simple_quadrilateral.py | 4 --- .../model/simple_quadrilateral_all_of.py | 5 ---- .../petstore_api/model/some_object.py | 4 --- .../petstore_api/model/special_model_name.py | 5 ---- .../petstore_api/model/string_boolean_map.py | 4 --- .../petstore_api/model/string_enum.py | 2 -- .../model/string_enum_with_default_value.py | 2 -- .../model/string_with_validation.py | 6 ----- .../petstore_api/model/tag.py | 6 ----- .../petstore_api/model/triangle.py | 6 ----- .../petstore_api/model/triangle_interface.py | 6 ----- .../petstore_api/model/user.py | 16 ------------ .../petstore_api/model/whale.py | 7 ------ .../petstore_api/model/zebra.py | 6 ----- 111 files changed, 652 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars index 18527e02eff..2c9a6f469ba 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars @@ -32,25 +32,6 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{{unescapedDescription}}} {{/if}} - - Attributes: -{{#each vars}} - {{baseName}} ({{#if isArray}}tuple,{{/if}}{{#if isBoolean}}bool,{{/if}}{{#if isDate}}date,{{/if}}{{#if isDateTime}}datetime,{{/if}}{{#if isMap}}dict,{{/if}}{{#if isFloat}}float,{{/if}}{{#if isNumber}}float,{{/if}}{{#if isUnboundedInteger}}int,{{/if}}{{#if isShort}}int,{{/if}}{{#if isLong}}int,{{/if}}{{#if isString}}str,{{/if}}{{#if isByteArray}}str,{{/if}}{{#if isNull}} none_type,{{/if}}): {{#if description}}{{description}}{{/if}} -{{/each}} -{{#if hasValidation}} - _validations (dict): the validations which apply to the current Schema - 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. -{{/if}} -{{#with additionalProperties}} - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties -{{/with}} -{{#if getHasDiscriminatorWithNonEmptyMapping}} - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class -{{/if}} """ {{/if}} {{#or isMap isAnyType}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars index f811b092e50..c17e0f5764c 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_dict.handlebars @@ -15,25 +15,6 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{{unescapedDescription}}} {{/if}} - - Attributes: -{{#each vars}} - {{baseName}} ({{#if isArray}}tuple,{{/if}}{{#if isBoolean}}bool,{{/if}}{{#if isDate}}date,{{/if}}{{#if isDateTime}}datetime,{{/if}}{{#if isMap}}dict,{{/if}}{{#if isFloat}}float,{{/if}}{{#if isDouble}}float,{{/if}}{{#if isNumber}}int, float,{{/if}}{{#if isUnboundedInteger}}int,{{/if}}{{#if isShort}}int,{{/if}}{{#if isLong}}int,{{/if}}{{#if isString}}str,{{/if}}{{#if isByteArray}}str,{{/if}}{{#if isNull}} none_type,{{/if}}): {{#if description}}{{description}}{{/if}} -{{/each}} -{{#if hasValidation}} - _validations (dict): the validations which apply to the current Schema - 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. -{{/if}} -{{#with additionalProperties}} - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties -{{/with}} -{{#if getHasDiscriminatorWithNonEmptyMapping}} - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class -{{/if}} """ {{/if}} {{> model_templates/dict_partial }} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars index 8617eeb0559..542b486ab4c 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_list.handlebars @@ -15,15 +15,6 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{{unescapedDescription}}} {{/if}} - - Attributes: - _items (Schema): the schema definition of the array items -{{#if hasValidation}} - _validations (dict): the validations which apply to the current Schema - 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. -{{/if}} """ {{/if}} {{#with items}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars index 06ba2af1917..ea12a00ff40 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_simple.handlebars @@ -18,14 +18,6 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{{unescapedDescription}}} {{/if}} - - Attributes: -{{#if hasValidation}} - _validations (dict): the validations which apply to the current Schema - 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. -{{/if}} """ {{/if}} {{#if isEnum}} diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index a5e4f0a45d9..a9dbd2396f0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -65,18 +65,6 @@ class AdditionalPropertiesClass( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - map_property (dict,): - map_of_map_property (dict,): - anytype_1 (): - map_with_undeclared_properties_anytype_1 (dict,): - map_with_undeclared_properties_anytype_2 (dict,): - map_with_undeclared_properties_anytype_3 (dict,): - empty_map (dict,): an object with no declared properties and no undeclared properties, hence it's an empty map. - map_with_undeclared_properties_string (dict,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index db4d01003d3..e6b66637e22 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -65,10 +65,6 @@ class AdditionalPropertiesWithArrayOfEnums( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index d088fe45158..255e88d8f05 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -65,10 +65,6 @@ class Address( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _additional_properties = IntSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 783f9026bd5..c5a1a74ddfe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -65,14 +65,6 @@ class Animal( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - className (str,): - color (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ _required_property_names = set(( 'className', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 1868ee5ee69..4a2b3dca68a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -65,9 +65,6 @@ class AnimalFarm( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _items (Schema): the schema definition of the array items """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index 505d16f177a..b282cdccb5d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -65,13 +65,6 @@ class ApiResponse( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - code (int,): - type (str,): - message (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ code = Int32Schema type = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index 07991225ef5..eef32e7fc2c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -68,12 +68,6 @@ class Apple( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - cultivar (str,): - origin (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'cultivar', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index c94a177b0ac..907e5332a51 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -65,10 +65,6 @@ class AppleReq( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - cultivar (str,): - mealy (bool,): """ _required_property_names = set(( 'cultivar', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py index 90f05d5eb12..a87a3963bf0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py @@ -65,8 +65,5 @@ class ArrayHoldingAnyType( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _items (Schema): the schema definition of the array items """ _items = AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 6f9cd63088b..0441017cce2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -65,11 +65,6 @@ class ArrayOfArrayOfNumberOnly( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - ArrayArrayNumber (tuple,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index ddb90807d27..84a16a901f4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -65,9 +65,6 @@ class ArrayOfEnums( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _items (Schema): the schema definition of the array items """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 1ee632533c3..befe0446d4a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -65,11 +65,6 @@ class ArrayOfNumberOnly( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - ArrayNumber (tuple,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index f69faad445e..9d5ed1fe8f1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -65,13 +65,6 @@ class ArrayTest( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - array_of_string (tuple,): - array_array_of_integer (tuple,): - array_array_of_model (tuple,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py index b34bcf6c27f..0d8bd1f5f59 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py @@ -68,13 +68,6 @@ class ArrayWithValidationsInItems( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _items (Schema): the schema definition of the array items - _validations (dict): the validations which apply to the current Schema - 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. """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 9cdf3cd55c6..2b745add0af 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -65,11 +65,6 @@ class Banana( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - lengthCm (int, float,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'lengthCm', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 1cf74f05e3e..938ad1c8da9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -65,10 +65,6 @@ class BananaReq( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - lengthCm (int, float,): - sweet (bool,): """ _required_property_names = set(( 'lengthCm', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index c11f9ab4bf9..5470dcaa409 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -65,11 +65,6 @@ class BasquePig( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - className (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'className', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py index 50b7181cc7e..26b0d6fb5d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py @@ -70,8 +70,6 @@ class BooleanEnum( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 8b508242ff2..daef598fe3a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -65,16 +65,6 @@ class Capitalization( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - smallCamel (str,): - CapitalCamel (str,): - small_Snake (str,): - Capital_Snake (str,): - SCA_ETH_Flow_Points (str,): - ATT_NAME (str,): Name of the pet - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ smallCamel = StrSchema CapitalCamel = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index 080d2bde5b8..7ac8563f778 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -65,10 +65,6 @@ class Cat( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index b08ff9b66f0..ec36b96f9f8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -65,11 +65,6 @@ class CatAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - declawed (bool,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ declawed = BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index abc7c3fc95a..a3b9e2134d7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -65,12 +65,6 @@ class Category( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - id (int,): - name (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'name', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index e33b977dea1..d165c485a8f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -65,10 +65,6 @@ class ChildCat( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index aadedf15481..108a5620181 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -65,11 +65,6 @@ class ChildCatAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - name (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ name = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index 54118dfb5d6..432b40a385d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -67,11 +67,6 @@ class ClassModel( Do not edit the class manually. Model for testing model with "_class" property - - Attributes: - _class (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _class = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index 713b3156872..372f5b8fe04 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -65,11 +65,6 @@ class Client( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - client (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ client = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 8a7f81af753..ef414f33d68 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -65,10 +65,6 @@ class ComplexQuadrilateral( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py index 095c96095ac..128d50c3f03 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py @@ -65,11 +65,6 @@ class ComplexQuadrilateralAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - quadrilateralType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py index fb200660c6e..67f71c76782 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py @@ -65,10 +65,6 @@ class ComposedAnyOfDifferentTypesNoValidations( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py index 6a9d0e19c3f..197dc534477 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py @@ -65,8 +65,5 @@ class ComposedArray( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _items (Schema): the schema definition of the array items """ _items = AnyTypeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py index b74990ba87a..57d1a5862ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py @@ -66,8 +66,6 @@ class ComposedBool( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py index ac6f516344f..7ba7de5a523 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py @@ -66,8 +66,6 @@ class ComposedNone( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py index e932e138bcc..f6725565fc8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py @@ -66,8 +66,6 @@ class ComposedNumber( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py index 92942e256c4..64435b68570 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py @@ -66,10 +66,6 @@ class ComposedObject( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py index 0a454dbceed..9f42e28f2fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py @@ -67,10 +67,6 @@ class ComposedOneOfDifferentTypes( Do not edit the class manually. this is a model that allows payloads of type object or number - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py index dec60c328ef..75a01e3dee8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py @@ -66,8 +66,6 @@ class ComposedString( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index d269be73d17..559aefad1dc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -65,11 +65,6 @@ class DanishPig( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - className (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'className', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py index d7bc79a11f9..800e2d5fa1d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py @@ -70,11 +70,5 @@ class DateTimeWithValidations( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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. """ pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py index a61d8da1b01..5c2886e4968 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py @@ -70,11 +70,5 @@ class DateWithValidations( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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. """ pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index dbfc2b13770..2556f7bab69 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -65,10 +65,6 @@ class Dog( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 1767fc983ae..fac002ead0c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -65,11 +65,6 @@ class DogAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - breed (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ breed = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index 5196bd01cce..fa243f3bdf1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -65,14 +65,6 @@ class Drawing( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - mainShape (): - shapeOrNull (): - nullableShape (): - shapes (tuple,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 54d293edd16..c5adca61568 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -65,12 +65,6 @@ class EnumArrays( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - just_symbol (str,): - array_enum (tuple,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 475c1dd6ca2..371b7835062 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -72,8 +72,6 @@ class EnumClass( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 77769e3cd74..6c0dd1eb4f9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -65,19 +65,6 @@ class EnumTest( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - enum_string (str,): - enum_string_required (str,): - enum_integer (int,): - enum_number (float,): - stringEnum (): - IntegerEnum (): - StringEnumWithDefaultValue (): - IntegerEnumWithDefaultValue (): - IntegerEnumOneValue (): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'enum_string_required', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 69bf6944cf7..75d6046477f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -65,10 +65,6 @@ class EquilateralTriangle( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py index fb6edf7c749..a6a6e6a494d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py @@ -65,11 +65,6 @@ class EquilateralTriangleAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - triangleType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index 30ccd52a5f5..a9306665853 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -67,11 +67,6 @@ class File( Do not edit the class manually. Must be named `File` for test. - - Attributes: - sourceURI (str,): Test capitalization - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ sourceURI = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index f0f6f4d9d83..632b4be2e00 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -65,12 +65,6 @@ class FileSchemaTestClass( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - file (): - files (tuple,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 2160642188d..8ad604af2b6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -65,11 +65,6 @@ class Foo( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - bar (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ bar = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 913a2a90d1b..e86ab8fc5da 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -65,31 +65,6 @@ class FormatTest( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - integer (int,): - int32 (int,): - int32withValidations (int,): - int64 (int,): - number (int, float,): - float (float,): this is a reserved python keyword - float32 (float,): - double (float,): - float64 (float,): - arrayWithUniqueItems (tuple,): - string (str,): - byte (str,): - binary (): - date (date,): - dateTime (datetime,): - uuid (str,): - uuidNoExample (str,): - password (str,): - pattern_with_digits (str,): A string that is a 10 digit number. Can have leading zeros. - pattern_with_digits_and_delimiter (str,): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - noneProp ( none_type,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'number', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 77d38d632d4..c4d04e6f6fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -65,11 +65,6 @@ class Fruit( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - color (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ color = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 37fcf71a44b..5170901cec3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -65,10 +65,6 @@ class FruitReq( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index ab342907147..45a96f3718e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -65,11 +65,6 @@ class GmFruit( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - color (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ color = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index f5625407bc7..fce1e5b8a45 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -65,13 +65,6 @@ class GrandparentAnimal( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - pet_type (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ _required_property_names = set(( 'pet_type', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index 3a84082bd47..35a72109094 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -65,12 +65,6 @@ class HasOnlyReadOnly( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - bar (str,): - foo (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ bar = StrSchema foo = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index 9cf48be2b36..db0e3586671 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -67,11 +67,6 @@ class HealthCheckResult( Do not edit the class manually. Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - - Attributes: - NullableMessage (str, none_type,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index 6b0f32db72a..ae29e2cf1c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -65,11 +65,6 @@ class InlineResponseDefault( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - string (): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 02a228957b6..857b0cffa90 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -72,8 +72,6 @@ class IntegerEnum( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py index babc39df7d4..bcc9aa57f93 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py @@ -72,8 +72,6 @@ class IntegerEnumBig( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index fa7e4258cbb..17b1d599779 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -70,8 +70,6 @@ class IntegerEnumOneValue( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index cb5860a0bdb..2916e4fcdff 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -72,8 +72,6 @@ class IntegerEnumWithDefaultValue( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py index affe4283ac6..8a57a1cdd5e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py @@ -68,11 +68,5 @@ class IntegerMax10( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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. """ pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py index 6a6488136d1..18a76f8e6ff 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py @@ -68,11 +68,5 @@ class IntegerMin15( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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. """ pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index b8527d08df5..2f14974794e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -65,10 +65,6 @@ class IsoscelesTriangle( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py index 8d9bc65556f..96d8b286c0e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py @@ -65,11 +65,6 @@ class IsoscelesTriangleAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - triangleType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index fd1784636b2..6868e7e2a8b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -65,12 +65,6 @@ class Mammal( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 90e2f053e68..9fca5b0310b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -65,14 +65,6 @@ class MapTest( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - map_map_of_string (dict,): - map_of_enum_string (dict,): - direct_map (dict,): - indirect_map (): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index e3a39533757..fa0afeab0be 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -65,13 +65,6 @@ class MixedPropertiesAndAdditionalPropertiesClass( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - uuid (str,): - dateTime (datetime,): - map (dict,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ uuid = StrSchema dateTime = DateTimeSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index c47980d5a7f..a7fcdd30ad5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -67,12 +67,6 @@ class Model200Response( Do not edit the class manually. model with an invalid class name for python, starts with a number - - Attributes: - name (int,): - class (str,): this is a reserved python keyword - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ name = Int32Schema _class = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index 81116280224..8ca497627cc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -67,11 +67,6 @@ class ModelReturn( Do not edit the class manually. Model for testing reserved words - - Attributes: - return (int,): this is a reserved python keyword - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _return = Int32Schema locals()['return'] = _return diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 7343223c4d2..c5700c9b763 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -67,13 +67,6 @@ class Name( Do not edit the class manually. Model for testing model name same as property name - - Attributes: - name (int,): - snake_case (int,): - property (str,): this is a reserved python keyword - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'name', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py index 910b8bc1f11..2ec538c5dae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py @@ -65,10 +65,6 @@ class NoAdditionalProperties( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - id (int,): - petId (int,): """ _required_property_names = set(( 'id', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index 45743da4394..329db7acc08 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -65,22 +65,6 @@ class NullableClass( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - integer_prop (int, none_type,): - number_prop (int, float, none_type,): - boolean_prop (bool, none_type,): - string_prop (str, none_type,): - date_prop (date, none_type,): - datetime_prop (datetime, none_type,): - array_nullable_prop (tuple, none_type,): - array_and_items_nullable_prop (tuple, none_type,): - array_items_nullable (tuple,): - object_nullable_prop (dict, none_type,): - object_and_items_nullable_prop (dict, none_type,): - object_items_nullable (dict,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index 7c4e3079234..8bf418c1445 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -67,12 +67,6 @@ class NullableShape( Do not edit the class manually. 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. For a nullable composed schema to work, one of its chosen oneOf schemas must be type null - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py index 2386522587d..db4a33d9be0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py @@ -68,8 +68,6 @@ class NullableString( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ def __new__( diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index ff476caf032..d9e2b49aa81 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -65,11 +65,6 @@ class NumberOnly( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - JustNumber (int, float,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ JustNumber = NumberSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 25ec9cdf00f..fa87e19d3a4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -69,11 +69,5 @@ class NumberWithValidations( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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. """ pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 99ca8288ee8..005497a8fa4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -67,13 +67,6 @@ class ObjectModelWithRefProps( Do not edit the class manually. a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations - - Attributes: - myNumber (): - myString (str,): - myBoolean (bool,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py index 11c22fd99f7..2beb1a96edf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py @@ -67,13 +67,6 @@ class ObjectWithDifficultlyNamedProps( Do not edit the class manually. model with properties that have invalid names for python - - Attributes: - $special[property.name] (int,): - 123-list (str,): - 123Number (int,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( '123-list', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py index c55d028c374..ff52e9e6a07 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py @@ -68,14 +68,6 @@ class ObjectWithValidations( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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 (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index b00c227a86c..e272d48cf0d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -65,16 +65,6 @@ class Order( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - id (int,): - petId (int,): - quantity (int,): - shipDate (datetime,): - status (str,): Order Status - complete (bool,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ id = Int64Schema petId = Int64Schema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index b9066defb50..4946eb510dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -66,12 +66,6 @@ class ParentPet( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index f602e6e722d..3bd1fcadb75 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -67,16 +67,6 @@ class Pet( Do not edit the class manually. Pet object that needs to be added to the store - - Attributes: - id (int,): - category (): - name (str,): - photoUrls (tuple,): - tags (tuple,): - status (str,): pet status in the store - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'name', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index 02ef6df613b..e5dc2bb1710 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -65,12 +65,6 @@ class Pig( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py index b568eadf36e..817770d4455 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py @@ -67,12 +67,6 @@ class Player( Do not edit the class manually. a model that includes a self reference this forces properties and additionalProperties to be lazy loaded in python models because the Player class has not fully loaded when defining properties - - Attributes: - name (str,): - enemyPlayer (): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ name = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index e5e8dd8788a..85fa3e76334 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -65,12 +65,6 @@ class Quadrilateral( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index 606805b40ee..52f17cf2ec8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -65,12 +65,6 @@ class QuadrilateralInterface( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - shapeType (str,): - quadrilateralType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'shapeType', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 136a772cd00..ebc9b3b5662 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -65,12 +65,6 @@ class ReadOnlyFirst( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - bar (str,): - baz (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ bar = StrSchema baz = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 0639b5aeb3c..9bddbc85da5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -65,10 +65,6 @@ class ScaleneTriangle( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py index 9e031ca5a74..f5c2edcb720 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py @@ -65,11 +65,6 @@ class ScaleneTriangleAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - triangleType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 6142062fbc7..4aaa6b6be13 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -65,12 +65,6 @@ class Shape( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index b1a7ecd967d..121988a3def 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -67,12 +67,6 @@ class ShapeOrNull( Do not edit the class manually. The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index bc907bfb30b..b326d1a5837 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -65,10 +65,6 @@ class SimpleQuadrilateral( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py index b6b63fb9ff0..ff52c014531 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py @@ -65,11 +65,6 @@ class SimpleQuadrilateralAllOf( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - quadrilateralType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py index c4fa2a0cff6..2b7e243a476 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py @@ -65,10 +65,6 @@ class SomeObject( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 47c8e538244..967b02cb3d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -67,11 +67,6 @@ class SpecialModelName( Do not edit the class manually. model with an invalid class name for python - - Attributes: - a (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ a = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 8022c91ced1..14fb2216dad 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -65,10 +65,6 @@ class StringBooleanMap( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _additional_properties = BoolSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index 0f803ec7d24..a8fa2a6c6ba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -81,8 +81,6 @@ lines''': "MULTIPLE_LINES", Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index 7894c4093a4..52689f388b5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -72,8 +72,6 @@ class StringEnumWithDefaultValue( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py index 135b181127d..7b41acff15d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py @@ -68,11 +68,5 @@ class StringWithValidation( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _validations (dict): the validations which apply to the current Schema - 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. """ pass diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index 275974b2ecf..0316fce5b92 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -65,12 +65,6 @@ class Tag( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - id (int,): - name (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ id = Int64Schema name = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index a35af496f9c..dae6c43d213 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -65,12 +65,6 @@ class Triangle( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties - _discriminator(cls) -> dict: the key is the required discriminator propertyName - the value is a dict mapping from a string name to the corresponding Schema class """ @classmethod diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index d21d93687c8..db721a77afb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -65,12 +65,6 @@ class TriangleInterface( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - shapeType (str,): - triangleType (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'shapeType', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index dccbf4d2040..c55c2e0e687 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -65,22 +65,6 @@ class User( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - id (int,): - username (str,): - firstName (str,): - lastName (str,): - email (str,): - password (str,): - phone (str,): - userStatus (int,): User Status - objectWithNoDeclaredProps (dict,): test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - objectWithNoDeclaredPropsNullable (dict, none_type,): test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - anyTypeProp (): 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 (): 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. - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ id = Int64Schema username = StrSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index 2018c62eb3c..dabdd735658 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -65,13 +65,6 @@ class Whale( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - hasBaleen (bool,): - hasTeeth (bool,): - className (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'className', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index 8a5ef4550d7..17d8746ce70 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -65,12 +65,6 @@ class Zebra( Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - type (str,): - className (str,): - _additional_properties (Schema): the definition used for additional properties - that are not defined in _properties """ _required_property_names = set(( 'className', From 95a1154c20658e48af38d02aa08094064d27952c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 11 Jan 2022 21:51:50 -0800 Subject: [PATCH 029/113] python-experimental adds DecimalSchema (#11282) * Fixes test * Adds decimal examples to the pythonExp generator * Adds isDecimal to CodegenModel, updates python-exp samples * Fixes decimal types in ObjectModelWIthDecimalProperties and DecimalPayload * Updates tests * Decimal feature added to python-exp docs * Samples and docs regenerated --- docs/generators/python-experimental.md | 2 +- .../openapitools/codegen/CodegenModel.java | 6 +- .../PythonExperimentalClientCodegen.java | 10 ++ .../python-experimental/api_client.handlebars | 1 - .../python-experimental/api_test.handlebars | 2 +- .../imports_schema_types.handlebars | 3 +- .../model_templates/new.handlebars | 4 +- .../schema_composed_or_anytype.handlebars | 2 +- .../model_templates/var_equals_cls.handlebars | 2 +- .../model_templates/xbase_schema.handlebars | 3 + .../python-experimental/model_test.handlebars | 3 +- .../python-experimental/schemas.handlebars | 137 ++++++++++++------ ...odels-for-testing-with-http-signature.yaml | 29 ++++ .../.openapi-generator/FILES | 8 + .../petstore/python-experimental/README.md | 4 + .../python-experimental/docs/Currency.md | 8 + .../docs/DecimalPayload.md | 8 + .../python-experimental/docs/Money.md | 11 ++ .../docs/ObjectWithDecimalProperties.md | 12 ++ .../call_123_test_special_tags.py | 3 +- .../api/default_api_endpoints/foo_get.py | 3 +- ...ditional_properties_with_array_of_enums.py | 3 +- .../api/fake_api_endpoints/array_model.py | 3 +- .../api/fake_api_endpoints/array_of_enums.py | 3 +- .../body_with_file_schema.py | 3 +- .../body_with_query_params.py | 3 +- .../api/fake_api_endpoints/boolean.py | 3 +- .../case_sensitive_params.py | 3 +- .../api/fake_api_endpoints/client_model.py | 3 +- .../composed_one_of_different_types.py | 3 +- .../fake_api_endpoints/endpoint_parameters.py | 5 +- .../api/fake_api_endpoints/enum_parameters.py | 5 +- .../api/fake_api_endpoints/fake_health_get.py | 3 +- .../fake_api_endpoints/group_parameters.py | 3 +- .../inline_additional_properties.py | 5 +- .../api/fake_api_endpoints/json_form_data.py | 5 +- .../api/fake_api_endpoints/mammal.py | 3 +- .../number_with_validations.py | 3 +- .../object_model_with_ref_props.py | 3 +- .../parameter_collisions.py | 3 +- .../query_parameter_collection_format.py | 3 +- .../api/fake_api_endpoints/string.py | 3 +- .../api/fake_api_endpoints/string_enum.py | 3 +- .../upload_download_file.py | 3 +- .../api/fake_api_endpoints/upload_file.py | 5 +- .../api/fake_api_endpoints/upload_files.py | 5 +- .../classname.py | 3 +- .../api/pet_api_endpoints/add_pet.py | 3 +- .../api/pet_api_endpoints/delete_pet.py | 3 +- .../pet_api_endpoints/find_pets_by_status.py | 3 +- .../pet_api_endpoints/find_pets_by_tags.py | 3 +- .../api/pet_api_endpoints/get_pet_by_id.py | 3 +- .../api/pet_api_endpoints/update_pet.py | 3 +- .../pet_api_endpoints/update_pet_with_form.py | 5 +- .../upload_file_with_required_file.py | 5 +- .../api/pet_api_endpoints/upload_image.py | 5 +- .../api/store_api_endpoints/delete_order.py | 3 +- .../api/store_api_endpoints/get_inventory.py | 5 +- .../store_api_endpoints/get_order_by_id.py | 3 +- .../api/store_api_endpoints/place_order.py | 3 +- .../api/user_api_endpoints/create_user.py | 3 +- .../create_users_with_array_input.py | 3 +- .../create_users_with_list_input.py | 3 +- .../api/user_api_endpoints/delete_user.py | 3 +- .../user_api_endpoints/get_user_by_name.py | 3 +- .../api/user_api_endpoints/login_user.py | 3 +- .../api/user_api_endpoints/logout_user.py | 3 +- .../api/user_api_endpoints/update_user.py | 3 +- .../petstore_api/api_client.py | 1 - .../model/additional_properties_class.py | 15 +- ...ditional_properties_with_array_of_enums.py | 5 +- .../petstore_api/model/address.py | 5 +- .../petstore_api/model/animal.py | 5 +- .../petstore_api/model/animal_farm.py | 3 +- .../petstore_api/model/api_response.py | 5 +- .../petstore_api/model/apple.py | 5 +- .../petstore_api/model/apple_req.py | 5 +- .../model/array_holding_any_type.py | 3 +- .../model/array_of_array_of_number_only.py | 5 +- .../petstore_api/model/array_of_enums.py | 3 +- .../model/array_of_number_only.py | 5 +- .../petstore_api/model/array_test.py | 5 +- .../model/array_with_validations_in_items.py | 3 +- .../petstore_api/model/banana.py | 5 +- .../petstore_api/model/banana_req.py | 5 +- .../petstore_api/model/bar.py | 3 +- .../petstore_api/model/basque_pig.py | 5 +- .../petstore_api/model/boolean.py | 3 +- .../petstore_api/model/boolean_enum.py | 3 +- .../petstore_api/model/capitalization.py | 5 +- .../petstore_api/model/cat.py | 7 +- .../petstore_api/model/cat_all_of.py | 5 +- .../petstore_api/model/category.py | 5 +- .../petstore_api/model/child_cat.py | 7 +- .../petstore_api/model/child_cat_all_of.py | 5 +- .../petstore_api/model/class_model.py | 7 +- .../petstore_api/model/client.py | 5 +- .../model/complex_quadrilateral.py | 7 +- .../model/complex_quadrilateral_all_of.py | 5 +- ...d_any_of_different_types_no_validations.py | 7 +- .../petstore_api/model/composed_array.py | 3 +- .../petstore_api/model/composed_bool.py | 5 +- .../petstore_api/model/composed_none.py | 5 +- .../petstore_api/model/composed_number.py | 5 +- .../petstore_api/model/composed_object.py | 5 +- .../model/composed_one_of_different_types.py | 9 +- .../petstore_api/model/composed_string.py | 5 +- .../petstore_api/model/currency.py | 85 +++++++++++ .../petstore_api/model/danish_pig.py | 5 +- .../petstore_api/model/date_time_test.py | 3 +- .../model/date_time_with_validations.py | 3 +- .../model/date_with_validations.py | 3 +- .../petstore_api/model/decimal_payload.py | 60 ++++++++ .../petstore_api/model/dog.py | 7 +- .../petstore_api/model/dog_all_of.py | 5 +- .../petstore_api/model/drawing.py | 5 +- .../petstore_api/model/enum_arrays.py | 5 +- .../petstore_api/model/enum_class.py | 3 +- .../petstore_api/model/enum_test.py | 5 +- .../model/equilateral_triangle.py | 7 +- .../model/equilateral_triangle_all_of.py | 5 +- .../petstore_api/model/file.py | 5 +- .../model/file_schema_test_class.py | 5 +- .../petstore_api/model/foo.py | 5 +- .../petstore_api/model/format_test.py | 5 +- .../petstore_api/model/fruit.py | 7 +- .../petstore_api/model/fruit_req.py | 7 +- .../petstore_api/model/gm_fruit.py | 7 +- .../petstore_api/model/grandparent_animal.py | 5 +- .../petstore_api/model/has_only_read_only.py | 5 +- .../petstore_api/model/health_check_result.py | 7 +- .../model/inline_response_default.py | 5 +- .../petstore_api/model/integer_enum.py | 3 +- .../petstore_api/model/integer_enum_big.py | 3 +- .../model/integer_enum_one_value.py | 3 +- .../model/integer_enum_with_default_value.py | 3 +- .../petstore_api/model/integer_max10.py | 3 +- .../petstore_api/model/integer_min15.py | 3 +- .../petstore_api/model/isosceles_triangle.py | 7 +- .../model/isosceles_triangle_all_of.py | 5 +- .../petstore_api/model/mammal.py | 7 +- .../petstore_api/model/map_test.py | 13 +- ...perties_and_additional_properties_class.py | 7 +- .../petstore_api/model/model200_response.py | 7 +- .../petstore_api/model/model_return.py | 7 +- .../petstore_api/model/money.py | 99 +++++++++++++ .../petstore_api/model/name.py | 7 +- .../model/no_additional_properties.py | 5 +- .../petstore_api/model/nullable_class.py | 39 ++--- .../petstore_api/model/nullable_shape.py | 7 +- .../petstore_api/model/nullable_string.py | 5 +- .../petstore_api/model/number.py | 3 +- .../petstore_api/model/number_only.py | 5 +- .../model/number_with_validations.py | 3 +- .../petstore_api/model/object_interface.py | 3 +- .../model/object_model_with_ref_props.py | 5 +- .../model/object_with_decimal_properties.py | 98 +++++++++++++ .../object_with_difficultly_named_props.py | 5 +- .../model/object_with_validations.py | 5 +- .../petstore_api/model/order.py | 5 +- .../petstore_api/model/parent_pet.py | 5 +- .../petstore_api/model/pet.py | 5 +- .../petstore_api/model/pig.py | 7 +- .../petstore_api/model/player.py | 5 +- .../petstore_api/model/quadrilateral.py | 7 +- .../model/quadrilateral_interface.py | 7 +- .../petstore_api/model/read_only_first.py | 5 +- .../petstore_api/model/scalene_triangle.py | 7 +- .../model/scalene_triangle_all_of.py | 5 +- .../petstore_api/model/shape.py | 7 +- .../petstore_api/model/shape_or_null.py | 7 +- .../model/simple_quadrilateral.py | 7 +- .../model/simple_quadrilateral_all_of.py | 5 +- .../petstore_api/model/some_object.py | 7 +- .../petstore_api/model/special_model_name.py | 5 +- .../petstore_api/model/string.py | 3 +- .../petstore_api/model/string_boolean_map.py | 5 +- .../petstore_api/model/string_enum.py | 5 +- .../model/string_enum_with_default_value.py | 3 +- .../model/string_with_validation.py | 3 +- .../petstore_api/model/tag.py | 5 +- .../petstore_api/model/triangle.py | 7 +- .../petstore_api/model/triangle_interface.py | 7 +- .../petstore_api/model/user.py | 7 +- .../petstore_api/model/whale.py | 5 +- .../petstore_api/model/zebra.py | 5 +- .../petstore_api/models/__init__.py | 4 + .../petstore_api/schemas.py | 137 ++++++++++++------ .../test/test_additional_properties_class.py | 2 - ...ditional_properties_with_array_of_enums.py | 2 - .../python-experimental/test/test_address.py | 2 - .../python-experimental/test/test_animal.py | 2 - .../test/test_animal_farm.py | 2 - .../test/test_another_fake_api.py | 1 - .../test/test_api_response.py | 2 - .../python-experimental/test/test_apple.py | 2 - .../test/test_apple_req.py | 2 - .../test/test_array_holding_any_type.py | 2 - .../test_array_of_array_of_number_only.py | 2 - .../test/test_array_of_enums.py | 2 - .../test/test_array_of_number_only.py | 2 - .../test/test_array_test.py | 2 - .../test_array_with_validations_in_items.py | 2 - .../python-experimental/test/test_banana.py | 2 - .../test/test_banana_req.py | 2 - .../python-experimental/test/test_bar.py | 2 - .../test/test_basque_pig.py | 2 - .../python-experimental/test/test_boolean.py | 2 - .../test/test_boolean_enum.py | 2 - .../test/test_capitalization.py | 2 - .../python-experimental/test/test_cat.py | 2 - .../test/test_cat_all_of.py | 2 - .../python-experimental/test/test_category.py | 2 - .../test/test_child_cat.py | 2 - .../test/test_child_cat_all_of.py | 2 - .../test/test_class_model.py | 2 - .../python-experimental/test/test_client.py | 2 - .../test/test_complex_quadrilateral.py | 2 - .../test/test_complex_quadrilateral_all_of.py | 2 - ...d_any_of_different_types_no_validations.py | 2 - .../test/test_composed_array.py | 2 - .../test/test_composed_bool.py | 2 - .../test/test_composed_none.py | 2 - .../test/test_composed_number.py | 2 - .../test/test_composed_object.py | 2 - .../test_composed_one_of_different_types.py | 2 - .../test/test_composed_string.py | 2 - .../python-experimental/test/test_currency.py | 35 +++++ .../test/test_danish_pig.py | 2 - .../test/test_date_time_test.py | 2 - .../test/test_date_time_with_validations.py | 2 - .../test/test_date_with_validations.py | 2 - .../test/test_decimal_payload.py | 35 +++++ .../test/test_default_api.py | 1 - .../python-experimental/test/test_dog.py | 2 - .../test/test_dog_all_of.py | 2 - .../python-experimental/test/test_drawing.py | 2 - .../test/test_enum_arrays.py | 2 - .../test/test_enum_class.py | 2 - .../test/test_enum_test.py | 2 - .../test/test_equilateral_triangle.py | 2 - .../test/test_equilateral_triangle_all_of.py | 2 - .../test/test_fake_classname_tags_123_api.py | 5 +- .../python-experimental/test/test_file.py | 2 - .../test/test_file_schema_test_class.py | 2 - .../python-experimental/test/test_foo.py | 2 - .../test/test_format_test.py | 2 - .../python-experimental/test/test_fruit.py | 2 - .../test/test_fruit_req.py | 2 - .../python-experimental/test/test_gm_fruit.py | 2 - .../test/test_grandparent_animal.py | 2 - .../test/test_has_only_read_only.py | 2 - .../test/test_health_check_result.py | 2 - .../test/test_inline_response_default.py | 2 - .../test/test_integer_enum.py | 2 - .../test/test_integer_enum_big.py | 2 - .../test/test_integer_enum_one_value.py | 2 - .../test_integer_enum_with_default_value.py | 2 - .../test/test_integer_max10.py | 2 - .../test/test_integer_min15.py | 2 - .../test/test_isosceles_triangle.py | 2 - .../test/test_isosceles_triangle_all_of.py | 2 - .../python-experimental/test/test_mammal.py | 2 - .../python-experimental/test/test_map_test.py | 2 - ...perties_and_additional_properties_class.py | 2 - .../test/test_model200_response.py | 2 - .../test/test_model_return.py | 2 - .../python-experimental/test/test_money.py | 35 +++++ .../python-experimental/test/test_name.py | 2 - .../test/test_no_additional_properties.py | 2 - .../test/test_nullable_class.py | 2 - .../test/test_nullable_shape.py | 2 - .../test/test_nullable_string.py | 2 - .../python-experimental/test/test_number.py | 2 - .../test/test_number_only.py | 2 - .../test/test_number_with_validations.py | 2 - .../test/test_object_interface.py | 2 - .../test/test_object_model_with_ref_props.py | 2 - .../test_object_with_decimal_properties.py | 35 +++++ ...est_object_with_difficultly_named_props.py | 26 +--- .../test/test_object_with_validations.py | 2 - .../python-experimental/test/test_order.py | 2 - .../test/test_parent_pet.py | 2 - .../python-experimental/test/test_pet.py | 2 - .../python-experimental/test/test_pet_api.py | 15 +- .../python-experimental/test/test_pig.py | 2 - .../python-experimental/test/test_player.py | 2 - .../test/test_quadrilateral.py | 2 - .../test/test_quadrilateral_interface.py | 2 - .../test/test_read_only_first.py | 2 - .../test/test_scalene_triangle.py | 2 - .../test/test_scalene_triangle_all_of.py | 2 - .../python-experimental/test/test_shape.py | 2 - .../test/test_shape_or_null.py | 2 - .../test/test_simple_quadrilateral.py | 2 - .../test/test_simple_quadrilateral_all_of.py | 2 - .../test/test_some_object.py | 2 - .../test/test_special_model_name.py | 2 - .../test/test_store_api.py | 1 - .../python-experimental/test/test_string.py | 2 - .../test/test_string_boolean_map.py | 2 - .../test/test_string_enum.py | 2 - .../test_string_enum_with_default_value.py | 2 - .../test/test_string_with_validation.py | 2 - .../python-experimental/test/test_tag.py | 2 - .../python-experimental/test/test_triangle.py | 2 - .../test/test_triangle_interface.py | 2 - .../python-experimental/test/test_user.py | 2 - .../python-experimental/test/test_user_api.py | 1 - .../python-experimental/test/test_whale.py | 2 - .../python-experimental/test/test_zebra.py | 2 - .../tests_manual/test_any_type_schema.py | 28 +++- .../tests_manual/test_decimal_payload.py | 46 ++++++ .../tests_manual/test_money.py | 34 +++++ 314 files changed, 1379 insertions(+), 680 deletions(-) create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Currency.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DecimalPayload.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Money.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDecimalProperties.md create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_currency.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_decimal_payload.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_money.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_with_decimal_properties.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_decimal_payload.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests_manual/test_money.py diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 00614e6ccb1..0d46556daf7 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -11,7 +11,7 @@ title: Documentation for the python-experimental Generator | generator type | CLIENT | | | generator language | Python | | | generator language version | >=3.9 | | -| helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | +| helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 91c8870774a..00fa3cf7a5e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -64,7 +64,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public String defaultValue; public String arrayModelType; public boolean isAlias; // Is this effectively an alias of another simple type - public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isShort, isUnboundedInteger, isBoolean; + public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isDecimal, isShort, isUnboundedInteger, isBoolean; private boolean additionalPropertiesIsAnyType; public List vars = new ArrayList<>(); // all properties (without parent's properties) public List allVars = new ArrayList<>(); // all properties (with parent's properties) @@ -856,6 +856,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { hasOnlyReadOnly == that.hasOnlyReadOnly && isNull == that.isNull && hasValidation == that.hasValidation && + isDecimal == that.isDecimal && hasMultipleTypes == that.getHasMultipleTypes() && hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() && getIsAnyType() == that.getIsAnyType() && @@ -934,7 +935,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(), getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(), getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping, - isAnyType, getComposedSchemas(), hasMultipleTypes); + isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal); } @Override @@ -1028,6 +1029,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { sb.append(", getIsAnyType=").append(getIsAnyType()); sb.append(", composedSchemas=").append(composedSchemas); sb.append(", hasMultipleTypes=").append(hasMultipleTypes); + sb.append(", isDecimal=").append(isDecimal); sb.append('}'); return sb.toString(); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 2bcbcef08d0..5424080f0d7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -198,6 +198,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { languageSpecificPrimitives.add("file_type"); languageSpecificPrimitives.add("none_type"); + typeMapping.put("decimal", "str"); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.EXPERIMENTAL) @@ -510,6 +511,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { "- inline schemas are supported at any location including composition", "- multiple content types supported in request body and response bodies", "- run time type checking", + "- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema", "- quicker load time for python modules (a single endpoint can be imported and used without loading others)", "- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed", "- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)", @@ -1053,6 +1055,14 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { @Override public CodegenModel fromModel(String name, Schema sc) { CodegenModel cm = super.fromModel(name, sc); + Schema unaliasedSchema = unaliasSchema(sc, importMapping); + if (unaliasedSchema != null) { + if (ModelUtils.isDecimalSchema(unaliasedSchema)) { // type: string, format: number + cm.isString = false; + cm.isDecimal = true; + } + } + if (cm.isNullable) { cm.setIsNull(true); cm.isNullable = false; diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars index 47c28bff18d..4dfc613aae2 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_client.handlebars @@ -25,7 +25,6 @@ from {{packageName}} import rest from {{packageName}}.configuration import Configuration from {{packageName}}.exceptions import ApiTypeError, ApiValueError from {{packageName}}.schemas import ( - Decimal, NoneClass, BoolClass, Schema, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars index a999b4b16c9..2f52783c605 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/api_test.handlebars @@ -5,7 +5,7 @@ import unittest import {{packageName}} -from {{packageName}}.api.{{classFilename}} import {{classname}} # noqa: E501 +from {{packageName}}.{{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 class {{#with operations}}Test{{classname}}(unittest.TestCase): diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars index 0741ba482fe..38015e35044 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/imports_schema_types.handlebars @@ -1,4 +1,4 @@ -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -16,6 +16,7 @@ from {{packageName}}.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars index bb220e4b8f3..e74461e8043 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/new.handlebars @@ -1,6 +1,6 @@ def __new__( cls, - *args: typing.Union[{{#if isAnyType}}dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes{{/if}}{{#if isUnboundedInteger}}int, {{/if}}{{#if isNumber}}float, {{/if}}{{#if isBoolean}}bool, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict, {{/if}}{{#if isString}}str, {{/if}}{{#if isNull}}None, {{/if}}], + *args: typing.Union[{{#if isAnyType}}dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes{{/if}}{{#if isUnboundedInteger}}int, {{/if}}{{#if isNumber}}float, {{/if}}{{#if isBoolean}}bool, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict, {{/if}}{{#if isString}}str, {{/if}}{{#if isNull}}None, {{/if}}], {{#unless isNull}} {{#if getHasRequired}} {{#each requiredVars}} @@ -26,7 +26,7 @@ def __new__( {{#with additionalProperties}} **kwargs: typing.Type[Schema], {{/with}} -): +) -> '{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}': return super().__new__( cls, *args, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars index 2c9a6f469ba..763da96feeb 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/schema_composed_or_anytype.handlebars @@ -12,7 +12,7 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{/if}} {{else}} {{#if getHasMultipleTypes}} - _SchemaTypeChecker(typing.Union[{{#if isArray}}tuple, {{/if}}{{#if isMap}}frozendict, {{/if}}{{#if isNull}}none_type, {{/if}}{{#if isString}}str, {{/if}}{{#if isByteArray}}str, {{/if}}{{#if isUnboundedInteger}}Decimal, {{/if}}{{#if isShort}}Decimal, {{/if}}{{#if isLong}}Decimal, {{/if}}{{#if isFloat}}Decimal, {{/if}}{{#if isDouble}}Decimal, {{/if}}{{#if isNumber}}Decimal, {{/if}}{{#if isDate}}str, {{/if}}{{#if isDateTime}}str, {{/if}}{{#if isBoolean}}bool, {{/if}}]), + _SchemaTypeChecker(typing.Union[{{#if isArray}}tuple, {{/if}}{{#if isMap}}frozendict, {{/if}}{{#if isNull}}none_type, {{/if}}{{#if isString}}str, {{/if}}{{#if isByteArray}}str, {{/if}}{{#if isUnboundedInteger}}decimal.Decimal, {{/if}}{{#if isShort}}decimal.Decimal, {{/if}}{{#if isLong}}decimal.Decimal, {{/if}}{{#if isFloat}}decimal.Decimal, {{/if}}{{#if isDouble}}decimal.Decimal, {{/if}}{{#if isNumber}}decimal.Decimal, {{/if}}{{#if isDate}}str, {{/if}}{{#if isDateTime}}str, {{/if}}{{#if isDecimal}}str, {{/if}}{{#if isBoolean}}bool, {{/if}}]), {{/if}} {{#if composedSchemas}} ComposedBase, diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars index 14b4c5e0648..24f52cac6ca 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/var_equals_cls.handlebars @@ -1 +1 @@ -{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = {{#if complexType}}{{complexType}}{{else}}{{#if isNullable}}Nullable{{/if}}{{#if getIsNull}}None{{/if}}{{#if isAnyType}}AnyType{{/if}}{{#if isMap}}Dict{{/if}}{{#if isArray}}List{{/if}}{{#if isString}}Str{{/if}}{{#if isByteArray}}Str{{/if}}{{#if isUnboundedInteger}}Int{{/if}}{{#if isShort}}Int32{{/if}}{{#if isLong}}Int64{{/if}}{{#if isFloat}}Float32{{/if}}{{#if isDouble}}Float64{{/if}}{{#if isNumber}}Number{{/if}}{{#if isDate}}Date{{/if}}{{#if isDateTime}}DateTime{{/if}}{{#if isBoolean}}Bool{{/if}}{{#if isBinary}}Binary{{/if}}Schema{{/if}} +{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}} = {{#if complexType}}{{complexType}}{{else}}{{#if isNullable}}Nullable{{/if}}{{#if getIsNull}}None{{/if}}{{#if isAnyType}}AnyType{{/if}}{{#if isMap}}Dict{{/if}}{{#if isArray}}List{{/if}}{{#if isString}}Str{{/if}}{{#if isByteArray}}Str{{/if}}{{#if isDate}}Date{{/if}}{{#if isDateTime}}DateTime{{/if}}{{#if isDecimal}}Decimal{{/if}}{{#if isUnboundedInteger}}Int{{/if}}{{#if isShort}}Int32{{/if}}{{#if isLong}}Int64{{/if}}{{#if isFloat}}Float32{{/if}}{{#if isDouble}}Float64{{/if}}{{#if isNumber}}Number{{/if}}{{#if isBoolean}}Bool{{/if}}{{#if isBinary}}Binary{{/if}}Schema{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars index 0b345344c43..87fe3d0b324 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_templates/xbase_schema.handlebars @@ -34,6 +34,9 @@ Date{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} {{#if isDateTime}} DateTime{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} {{/if}} +{{#if isDecimal}} +Decimal{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} +{{/if}} {{#if isBoolean}} Bool{{#if getHasMultipleTypes}}Base,{{else}}Schema{{/if}} {{/if}} diff --git a/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars index 094d7f49b65..48a4a7c85a1 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/model_test.handlebars @@ -2,13 +2,12 @@ {{>partial_header}} -import sys import unittest import {{packageName}} {{#each models}} {{#with model}} -from {{modelPackage}}.{{classFilename}} import {{classname}} +from {{packageName}}.{{modelPackage}}.{{classFilename}} import {{classname}} class Test{{classname}}(unittest.TestCase): diff --git a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars index b238468f73a..9450487cb54 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/schemas.handlebars @@ -6,7 +6,7 @@ from collections import defaultdict from datetime import date, datetime, timedelta # noqa: F401 from dataclasses import dataclass import functools -from decimal import Decimal +import decimal import io import os import re @@ -112,12 +112,12 @@ class ValidatorBase: """Returns true if JSON schema validation is enabled for the specified validation keyword. This can be used to skip JSON schema structural validation as requested in the configuration. - + Args: schema_keyword (string): the name of a JSON schema validation keyword. configuration (Configuration): the configuration class. """ - + return (configuration is None or not hasattr(configuration, '_disabled_client_side_validations') or schema_keyword not in configuration._disabled_client_side_validations) @@ -256,7 +256,7 @@ class ValidatorBase: _instantiation_metadata.configuration) and 'multiple_of' in validations: multiple_of_values = validations['multiple_of'] for multiple_of_value in multiple_of_values: - if (isinstance(input_values, Decimal) and + if (isinstance(input_values, decimal.Decimal) and not (float(input_values) / multiple_of_value).is_integer() ): # Note 'multipleOf' will be as good as the floating point arithmetic. @@ -327,7 +327,7 @@ class ValidatorBase: cls.__check_tuple_validations(validations, input_values, _instantiation_metadata) elif isinstance(input_values, frozendict): cls.__check_dict_validations(validations, input_values, _instantiation_metadata) - elif isinstance(input_values, Decimal): + elif isinstance(input_values, decimal.Decimal): cls.__check_numeric_validations(validations, input_values, _instantiation_metadata) try: return super()._validate_validations_pass(input_values, _instantiation_metadata) @@ -424,7 +424,7 @@ class EnumMakerInterface(typing.Protocol): @property def _enum_value_to_name( cls - ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + ) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]: pass @classmethod @@ -435,13 +435,13 @@ class EnumMakerInterface(typing.Protocol): pass -def _SchemaEnumMaker(enum_value_to_name: typing.Dict[typing.Union[str, Decimal, bool, none_type], str]) -> EnumMakerInterface: +def _SchemaEnumMaker(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> EnumMakerInterface: class SchemaEnumMaker(EnumMakerBase): @classmethod @property def _enum_value_to_name( cls - ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + ) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]: pass try: super_enum_value_to_name = super()._enum_value_to_name @@ -538,6 +538,10 @@ class StrBase: def as_datetime(self) -> datetime: raise Exception('not implemented') + @property + def as_decimal(self) -> decimal.Decimal: + raise Exception('not implemented') + class CustomIsoparser(isoparser): @@ -629,6 +633,39 @@ class DateTimeBase: return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) +class DecimalBase(StrBase): + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.cache + def as_decimal(self) -> decimal.Decimal: + return decimal.Decimal(self) + + @classmethod + def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, str): + try: + decimal.Decimal(arg) + return True + except decimal.InvalidOperation: + raise ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DecimalBase _validate + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + class NumberBase: @property def as_int(self) -> int: @@ -1038,7 +1075,7 @@ class DictBase(Discriminable): return super().__getattribute__(name) -inheritable_primitive_types_set = {Decimal, str, tuple, frozendict, FileIO, bytes} +inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict, FileIO, bytes} class Schema: @@ -1145,8 +1182,8 @@ class Schema: new_cls = get_new_class(cls_name, (cls, BoolBase, BoolClass)) elif base_cls is str: new_cls = get_new_class(cls_name, (cls, StrBase, str)) - elif base_cls is Decimal: - new_cls = get_new_class(cls_name, (cls, NumberBase, Decimal)) + elif base_cls is decimal.Decimal: + new_cls = get_new_class(cls_name, (cls, NumberBase, decimal.Decimal)) elif base_cls is tuple: new_cls = get_new_class(cls_name, (cls, ListBase, tuple)) elif base_cls is frozendict: @@ -1168,7 +1205,7 @@ class Schema: - the returned instance is a serializable type (except for None, True, and False) which are enums Use cases: - 1. inheritable type: string/Decimal/frozendict/tuple + 1. inheritable type: string/decimal.Decimal/frozendict/tuple 2. enum value cases: 'hi', 1 -> no base_class set because the enum includes the base class 3. uninheritable type: True/False/None -> no base_class because the base class is not inheritable _enum_by_value will handle this use case @@ -1308,7 +1345,7 @@ class Schema: return super(Schema, cls).__new__(cls, properties) """ str = openapi str, date, and datetime - Decimal = openapi int and float + decimal.Decimal = openapi int and float FileIO = openapi binary type and the user inputs a file bytes = openapi binary type and the user inputs bytes """ @@ -1323,7 +1360,7 @@ class Schema: datetime, int, float, - Decimal, + decimal.Decimal, bool, None, 'Schema', @@ -1360,13 +1397,13 @@ class Schema: def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: - args (int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): the value - kwargs (str, int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values _instantiation_metadata: contains the needed from_server, configuration, path_to_item """ kwargs = cls.__remove_unsets(kwargs) @@ -1390,10 +1427,10 @@ class Schema: def __init__( self, *args: typing.Union[ - dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[ - dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] ): """ @@ -1405,7 +1442,7 @@ class Schema: pass -def cast_to_allowed_types(arg: typing.Union[str, date, datetime, int, float, None, dict, frozendict, list, tuple, bytes, Schema], from_server=False) -> typing.Union[str, bytes, int, float, None, frozendict, tuple, Schema]: +def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema], from_server=False) -> typing.Union[str, bytes, decimal.Decimal, None, frozendict, tuple, Schema]: """ from_server=False date, datetime -> str int, float -> Decimal @@ -1422,16 +1459,16 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, int, float, Non because isinstance(True, int) is True """ return arg - elif isinstance(arg, Decimal): + elif isinstance(arg, decimal.Decimal): return arg elif isinstance(arg, int): - return Decimal(arg) + return decimal.Decimal(arg) elif isinstance(arg, float): - decimal_from_float = Decimal(arg) + decimal_from_float = decimal.Decimal(arg) if decimal_from_float.as_integer_ratio()[1] == 1: # 9.0 -> Decimal('9.0') # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return Decimal(str(decimal_from_float)+'.0') + return decimal.Decimal(str(decimal_from_float)+'.0') return decimal_from_float elif isinstance(arg, str): return arg @@ -1628,7 +1665,7 @@ class ComposedBase(Discriminable): # DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase class ComposedSchema( - _SchemaTypeChecker(typing.Union[none_type, str, Decimal, bool, tuple, frozendict]), + _SchemaTypeChecker(typing.Union[none_type, str, decimal.Decimal, bool, tuple, frozendict]), ComposedBase, DictBase, ListBase, @@ -1680,7 +1717,7 @@ class NoneSchema( class NumberSchema( - _SchemaTypeChecker(typing.Union[Decimal]), + _SchemaTypeChecker(typing.Union[decimal.Decimal]), NumberBase, Schema ): @@ -1690,10 +1727,10 @@ class NumberSchema( """ @classmethod - def _from_openapi_data(cls, arg: typing.Union[int, float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) - def __new__(cls, arg: typing.Union[Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1707,8 +1744,8 @@ class IntBase(NumberBase): return self._as_int @classmethod - def _validate_format(cls, arg: typing.Optional[Decimal], _instantiation_metadata: InstantiationMetadata): - if isinstance(arg, Decimal): + def _validate_format(cls, arg: typing.Optional[decimal.Decimal], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, decimal.Decimal): exponent = arg.as_tuple().exponent if exponent != 0: raise ApiValueError( @@ -1731,14 +1768,14 @@ class IntSchema(IntBase, NumberSchema): def _from_openapi_data(cls, arg: int, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) - def __new__(cls, arg: typing.Union[Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): return super().__new__(cls, arg, **kwargs) class Int32Schema( _SchemaValidator( - inclusive_minimum=Decimal(-2147483648), - inclusive_maximum=Decimal(2147483647) + inclusive_minimum=decimal.Decimal(-2147483648), + inclusive_maximum=decimal.Decimal(2147483647) ), IntSchema ): @@ -1746,8 +1783,8 @@ class Int32Schema( class Int64Schema( _SchemaValidator( - inclusive_minimum=Decimal(-9223372036854775808), - inclusive_maximum=Decimal(9223372036854775807) + inclusive_minimum=decimal.Decimal(-9223372036854775808), + inclusive_maximum=decimal.Decimal(9223372036854775807) ), IntSchema ): @@ -1756,28 +1793,28 @@ class Int64Schema( class Float32Schema( _SchemaValidator( - inclusive_minimum=Decimal(-3.4028234663852886e+38), - inclusive_maximum=Decimal(3.4028234663852886e+38) + inclusive_minimum=decimal.Decimal(-3.4028234663852886e+38), + inclusive_maximum=decimal.Decimal(3.4028234663852886e+38) ), NumberSchema ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): # todo check format return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) class Float64Schema( _SchemaValidator( - inclusive_minimum=Decimal(-1.7976931348623157E+308), - inclusive_maximum=Decimal(1.7976931348623157E+308) + inclusive_minimum=decimal.Decimal(-1.7976931348623157E+308), + inclusive_maximum=decimal.Decimal(1.7976931348623157E+308) ), NumberSchema ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): # todo check format return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) @@ -1814,6 +1851,20 @@ class DateTimeSchema(DateTimeBase, StrSchema): return super().__new__(cls, arg, **kwargs) +class DecimalSchema(DecimalBase, StrSchema): + + def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[InstantiationMetadata]): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg, **kwargs) + + class BytesSchema( _SchemaTypeChecker(typing.Union[bytes]), Schema, @@ -1901,7 +1952,7 @@ class BoolSchema( class AnyTypeSchema( _SchemaTypeChecker( - typing.Union[frozendict, tuple, Decimal, str, bool, none_type, bytes, FileIO] + typing.Union[frozendict, tuple, decimal.Decimal, str, bool, none_type, bytes, FileIO] ), DictBase, ListBase, @@ -1924,7 +1975,7 @@ class DictSchema( def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): return super().__new__(cls, *args, **kwargs) diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index f149e72a898..7fcdb42c7b3 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2653,3 +2653,32 @@ components: type: 'null' allOf: - {} + Currency: + type: string + enum: + - eur + - usd + Money: + type: object + properties: + amount: + type: string + format: number + currency: + $ref: '#/components/schemas/Currency' + required: + - amount + - currency + DecimalPayload: + type: string + format: number + ObjectWithDecimalProperties: + type: object + properties: + length: + $ref: '#/components/schemas/DecimalPayload' + width: + type: string + format: number + cost: + $ref: '#/components/schemas/Money' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index ad8d63e86a6..fdc3984d899 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -41,10 +41,12 @@ docs/ComposedNumber.md docs/ComposedObject.md docs/ComposedOneOfDifferentTypes.md docs/ComposedString.md +docs/Currency.md docs/DanishPig.md docs/DateTimeTest.md docs/DateTimeWithValidations.md docs/DateWithValidations.md +docs/DecimalPayload.md docs/DefaultApi.md docs/Dog.md docs/DogAllOf.md @@ -80,6 +82,7 @@ docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelReturn.md +docs/Money.md docs/Name.md docs/NoAdditionalProperties.md docs/NullableClass.md @@ -90,6 +93,7 @@ docs/NumberOnly.md docs/NumberWithValidations.md docs/ObjectInterface.md docs/ObjectModelWithRefProps.md +docs/ObjectWithDecimalProperties.md docs/ObjectWithDifficultlyNamedProps.md docs/ObjectWithValidations.md docs/Order.md @@ -175,10 +179,12 @@ petstore_api/model/composed_number.py petstore_api/model/composed_object.py petstore_api/model/composed_one_of_different_types.py petstore_api/model/composed_string.py +petstore_api/model/currency.py petstore_api/model/danish_pig.py petstore_api/model/date_time_test.py petstore_api/model/date_time_with_validations.py petstore_api/model/date_with_validations.py +petstore_api/model/decimal_payload.py petstore_api/model/dog.py petstore_api/model/dog_all_of.py petstore_api/model/drawing.py @@ -211,6 +217,7 @@ 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/money.py petstore_api/model/name.py petstore_api/model/no_additional_properties.py petstore_api/model/nullable_class.py @@ -221,6 +228,7 @@ petstore_api/model/number_only.py petstore_api/model/number_with_validations.py petstore_api/model/object_interface.py petstore_api/model/object_model_with_ref_props.py +petstore_api/model/object_with_decimal_properties.py petstore_api/model/object_with_difficultly_named_props.py petstore_api/model/object_with_validations.py petstore_api/model/order.py diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 98ccaf5dbbc..a849a36ae20 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -172,10 +172,12 @@ Class | Method | HTTP request | Description - [ComposedObject](docs/ComposedObject.md) - [ComposedOneOfDifferentTypes](docs/ComposedOneOfDifferentTypes.md) - [ComposedString](docs/ComposedString.md) + - [Currency](docs/Currency.md) - [DanishPig](docs/DanishPig.md) - [DateTimeTest](docs/DateTimeTest.md) - [DateTimeWithValidations](docs/DateTimeWithValidations.md) - [DateWithValidations](docs/DateWithValidations.md) + - [DecimalPayload](docs/DecimalPayload.md) - [Dog](docs/Dog.md) - [DogAllOf](docs/DogAllOf.md) - [Drawing](docs/Drawing.md) @@ -208,6 +210,7 @@ Class | Method | HTTP request | Description - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) - [ModelReturn](docs/ModelReturn.md) + - [Money](docs/Money.md) - [Name](docs/Name.md) - [NoAdditionalProperties](docs/NoAdditionalProperties.md) - [NullableClass](docs/NullableClass.md) @@ -218,6 +221,7 @@ Class | Method | HTTP request | Description - [NumberWithValidations](docs/NumberWithValidations.md) - [ObjectInterface](docs/ObjectInterface.md) - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [ObjectWithDecimalProperties](docs/ObjectWithDecimalProperties.md) - [ObjectWithDifficultlyNamedProps](docs/ObjectWithDifficultlyNamedProps.md) - [ObjectWithValidations](docs/ObjectWithValidations.md) - [Order](docs/Order.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Currency.md b/samples/openapi3/client/petstore/python-experimental/docs/Currency.md new file mode 100644 index 00000000000..9811a54c6e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Currency.md @@ -0,0 +1,8 @@ +# Currency + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | must be one of ["eur", "usd", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DecimalPayload.md b/samples/openapi3/client/petstore/python-experimental/docs/DecimalPayload.md new file mode 100644 index 00000000000..2e0821dd053 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DecimalPayload.md @@ -0,0 +1,8 @@ +# DecimalPayload + +Type | Description | Notes +------------- | ------------- | ------------- +**str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Money.md b/samples/openapi3/client/petstore/python-experimental/docs/Money.md new file mode 100644 index 00000000000..5deec5712ae --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Money.md @@ -0,0 +1,11 @@ +# Money + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **str** | | +**currency** | [**Currency**](Currency.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDecimalProperties.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDecimalProperties.md new file mode 100644 index 00000000000..10bd9061c0d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectWithDecimalProperties.md @@ -0,0 +1,12 @@ +# ObjectWithDecimalProperties + +#### Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**length** | **str** | | [optional] +**width** | **str** | | [optional] +**cost** | [**Money**](Money.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py index b9733311046..eef7420a019 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api_endpoints/call_123_test_special_tags.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py index b704f12197a..c1a9e4213e0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api_endpoints/foo_get.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py index f0d07f51205..1958cd47e5f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/additional_properties_with_array_of_enums.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py index 9c44cbce507..466bb6bdeac 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_model.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py index 83af2ce00ca..30eb23e2260 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/array_of_enums.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py index c46e584ab42..7d10197e7b9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_file_schema.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py index a99f338d61b..185f737fd61 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/body_with_query_params.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py index 49566ef541d..27c385cf6d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/boolean.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py index ac4d37279eb..8d33047b77b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/case_sensitive_params.py @@ -13,7 +13,7 @@ import typing import urllib3 from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -31,6 +31,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py index d1812acdfb6..32c09a60148 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/client_model.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py index 7f3ecf42045..f18f635fbcb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/composed_one_of_different_types.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py index 63faaf2db9a..5898d0608a2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/endpoint_parameters.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -172,7 +173,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( callback: typing.Union[callback, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py index 7d8e080429d..9a0375a83d9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/enum_parameters.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -348,7 +349,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( enum_form_string: typing.Union[enum_form_string, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py index 831241cba68..321959bf07e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/fake_health_get.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py index dc590cb9137..77bce3d6270 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/group_parameters.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py index 0acc3f4491e..3dcf988a1b7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/inline_additional_properties.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -70,7 +71,7 @@ class SchemaForRequestBodyApplicationJson( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyApplicationJson': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py index 591f9417e3b..917d5c7b7d7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/json_form_data.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -73,7 +74,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py index 4b402d4e961..40880fd1b09 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/mammal.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py index ac82ec1bca5..e2481118651 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/number_with_validations.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py index aaa919ec758..6e72d45b78d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/object_model_with_ref_props.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py index c355d0e1183..4ec604dd98c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/parameter_collisions.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py index 14076fea22b..8fd0b87cf6c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/query_parameter_collection_format.py @@ -13,7 +13,7 @@ import typing import urllib3 from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -31,6 +31,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py index 000d30c64ef..f1dda7d9754 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py index 51c9bd862e8..21d92e829df 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/string_enum.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py index 87fa4f8dbcc..73f707e268b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_download_file.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py index 8fbdf9bbdb8..f39892210cb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_file.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -76,7 +77,7 @@ class SchemaForRequestBodyMultipartFormData( additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py index 19c7745793a..6be2c17a026 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api_endpoints/upload_files.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -78,7 +79,7 @@ class SchemaForRequestBodyMultipartFormData( files: typing.Union[files, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py index d8157f7f4cf..1ccf89e848c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api_endpoints/classname.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py index 7f04e4cc3c8..80280363358 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/add_pet.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py index de6d86ed212..afb30b58048 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/delete_pet.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py index d6b31e361f5..ac4b7f3ad8c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_status.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py index a4c39c6ae34..5496b92cd55 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/find_pets_by_tags.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py index 533b2ae23cf..549fd2aa6fc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/get_pet_by_id.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py index 71bdf386bc9..fa1b5a1bb96 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py index 6535b584ac8..798b70c896a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/update_pet_with_form.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -99,7 +100,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded( status: typing.Union[status, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py index 214bf7a41b2..c137418e02d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_file_with_required_file.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -102,7 +103,7 @@ class SchemaForRequestBodyMultipartFormData( additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py index d4f494e25be..10c595a21ab 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api_endpoints/upload_image.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -100,7 +101,7 @@ class SchemaForRequestBodyMultipartFormData( additionalMetadata: typing.Union[additionalMetadata, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaForRequestBodyMultipartFormData': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py index 9dbbf03607f..1c4269d277b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/delete_order.py @@ -13,7 +13,7 @@ import typing import urllib3 from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -31,6 +31,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py index e5e5aca7eb0..9daf61b0c08 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_inventory.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -74,7 +75,7 @@ class SchemaFor200ResponseBodyApplicationJson( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py index 11f819f27b3..99f9ecbb28f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/get_order_by_id.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py index ef9f9c3ba63..ba961a9921e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api_endpoints/place_order.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py index 8627997a2fb..7cc7494687d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_user.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py index 8694e9582ff..d3ae4f85df7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_array_input.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py index d1c0a1e0e87..81553c66598 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/create_users_with_list_input.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py index 1d3b6530820..f337efa3480 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py @@ -13,7 +13,7 @@ import typing import urllib3 from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -31,6 +31,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py index 2a2af60d64b..fa01a390119 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/get_user_by_name.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py index c63a4e482d1..47447322ff0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/login_user.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py index 1e6f9443fce..99bcba58663 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/logout_user.py @@ -13,7 +13,7 @@ import typing import urllib3 from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -31,6 +31,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py index fcd3f6dcde4..472d3354b84 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/update_user.py @@ -14,7 +14,7 @@ import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -32,6 +32,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index 38220b88f5d..adad78a8e84 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -29,7 +29,6 @@ from petstore_api import rest from petstore_api.configuration import Configuration from petstore_api.exceptions import ApiTypeError, ApiValueError from petstore_api.schemas import ( - Decimal, NoneClass, BoolClass, Schema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index a9dbd2396f0..8301d14cf86 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -79,7 +80,7 @@ class AdditionalPropertiesClass( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'map_property': return super().__new__( cls, *args, @@ -104,7 +105,7 @@ class AdditionalPropertiesClass( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> '_additional_properties': return super().__new__( cls, *args, @@ -118,7 +119,7 @@ class AdditionalPropertiesClass( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'map_of_map_property': return super().__new__( cls, *args, @@ -141,7 +142,7 @@ class AdditionalPropertiesClass( cls, *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'empty_map': return super().__new__( cls, *args, @@ -160,7 +161,7 @@ class AdditionalPropertiesClass( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'map_with_undeclared_properties_string': return super().__new__( cls, *args, @@ -182,7 +183,7 @@ class AdditionalPropertiesClass( map_with_undeclared_properties_string: typing.Union[map_with_undeclared_properties_string, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'AdditionalPropertiesClass': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index e6b66637e22..90d612a857a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -83,7 +84,7 @@ class AdditionalPropertiesWithArrayOfEnums( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'AdditionalPropertiesWithArrayOfEnums': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index 255e88d8f05..95e55511dca 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -74,7 +75,7 @@ class Address( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Address': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index c5a1a74ddfe..f0dc6441d3e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,7 +91,7 @@ class Animal( color: typing.Union[color, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Animal': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 4a2b3dca68a..2bb3d0259c8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index b282cdccb5d..41f336ea8bc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -79,7 +80,7 @@ class ApiResponse( message: typing.Union[message, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ApiResponse': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index eef32e7fc2c..05b8485a74d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -104,7 +105,7 @@ class Apple( origin: typing.Union[origin, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Apple': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 907e5332a51..df315c8bf1c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -80,7 +81,7 @@ class AppleReq( cultivar: cultivar, mealy: typing.Union[mealy, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'AppleReq': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py index a87a3963bf0..51e9aeeb603 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_holding_any_type.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 0441017cce2..06912cc2194 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -85,7 +86,7 @@ class ArrayOfArrayOfNumberOnly( ArrayArrayNumber: typing.Union[ArrayArrayNumber, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ArrayOfArrayOfNumberOnly': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 84a16a901f4..19af3dc1e9f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index befe0446d4a..c2d568e4b80 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -80,7 +81,7 @@ class ArrayOfNumberOnly( ArrayNumber: typing.Union[ArrayNumber, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ArrayOfNumberOnly': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index 9d5ed1fe8f1..00d72319a69 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -108,7 +109,7 @@ class ArrayTest( array_array_of_model: typing.Union[array_array_of_model, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ArrayTest': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py index 0d8bd1f5f59..07b32f95f67 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_with_validations_in_items.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 2b745add0af..4cb4561abe2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -78,7 +79,7 @@ class Banana( lengthCm: lengthCm, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Banana': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 938ad1c8da9..b7012234a08 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -80,7 +81,7 @@ class BananaReq( lengthCm: lengthCm, sweet: typing.Union[sweet, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'BananaReq': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py index afbf24b8a22..61b13533570 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/bar.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index 5470dcaa409..f1e74bf1e46 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -92,7 +93,7 @@ class BasquePig( className: className, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'BasquePig': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py index e9f974616fc..3f35ab6a653 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py index 26b0d6fb5d8..cf75f7c9445 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/boolean_enum.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index daef598fe3a..e5987dc9559 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -85,7 +86,7 @@ class Capitalization( ATT_NAME: typing.Union[ATT_NAME, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Capitalization': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index 7ac8563f778..e0f0b0f2053 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class Cat( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Cat': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index ec36b96f9f8..82c20ec0769 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,7 +76,7 @@ class CatAllOf( declawed: typing.Union[declawed, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'CatAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index a3b9e2134d7..9f92d2b3a38 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -80,7 +81,7 @@ class Category( id: typing.Union[id, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Category': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index d165c485a8f..114bd2832d2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class ChildCat( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ChildCat': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index 108a5620181..791f3793cb5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,7 +76,7 @@ class ChildCatAllOf( name: typing.Union[name, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ChildCatAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index 432b40a385d..37c5b23285b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -72,11 +73,11 @@ class ClassModel( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _class: typing.Union[_class, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ClassModel': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index 372f5b8fe04..bc4ff7ffab3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,7 +76,7 @@ class Client( client: typing.Union[client, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Client': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index ef414f33d68..422ae90d3b8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class ComplexQuadrilateral( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ComplexQuadrilateral': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py index 128d50c3f03..d24b43d5ed6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,7 +90,7 @@ class ComplexQuadrilateralAllOf( quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ComplexQuadrilateralAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py index 67f71c76782..97f75c86dda 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_any_of_different_types_no_validations.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -125,10 +126,10 @@ class ComposedAnyOfDifferentTypesNoValidations( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ComposedAnyOfDifferentTypesNoValidations': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py index 197dc534477..8b20d7f0941 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_array.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py index 57d1a5862ee..5aa09239e14 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_bool.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -93,7 +94,7 @@ class ComposedBool( cls, *args: typing.Union[bool, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'ComposedBool': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py index 7ba7de5a523..534e1ce01ca 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_none.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -93,7 +94,7 @@ class ComposedNone( cls, *args: typing.Union[None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'ComposedNone': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py index f6725565fc8..c4e879ae995 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_number.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -93,7 +94,7 @@ class ComposedNumber( cls, *args: typing.Union[float, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'ComposedNumber': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py index 64435b68570..f7ba1546f97 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_object.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -94,7 +95,7 @@ class ComposedObject( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ComposedObject': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py index 9f42e28f2fa..0adf69e676e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_different_types.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -97,7 +98,7 @@ class ComposedOneOfDifferentTypes( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'oneOf_4': return super().__new__( cls, *args, @@ -143,10 +144,10 @@ class ComposedOneOfDifferentTypes( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ComposedOneOfDifferentTypes': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py index 75a01e3dee8..6efeb9a7872 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_string.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -93,7 +94,7 @@ class ComposedString( cls, *args: typing.Union[str, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'ComposedString': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py new file mode 100644 index 00000000000..1fd715f3f14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/currency.py @@ -0,0 +1,85 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Currency( + _SchemaEnumMaker( + enum_value_to_name={ + "eur": "EUR", + "usd": "USD", + } + ), + StrSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + @classmethod + @property + def EUR(cls): + return cls._enum_by_value["eur"]("eur") + + @classmethod + @property + def USD(cls): + return cls._enum_by_value["usd"]("usd") diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 559aefad1dc..af29f5c9e7a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -92,7 +93,7 @@ class DanishPig( className: className, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'DanishPig': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py index 837edc52f03..8b05311d14d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_test.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py index 800e2d5fa1d..c4365f56e89 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_time_with_validations.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py index 5c2886e4968..364759f48e2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/date_with_validations.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py new file mode 100644 index 00000000000..99f1f2e4735 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/decimal_payload.py @@ -0,0 +1,60 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) +DecimalPayload = DecimalSchema diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index 2556f7bab69..de0f9c174f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class Dog( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Dog': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index fac002ead0c..b527aedf20b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,7 +76,7 @@ class DogAllOf( breed: typing.Union[breed, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'DogAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index fa243f3bdf1..d61f6b07be1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -107,7 +108,7 @@ class Drawing( shapes: typing.Union[shapes, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Drawing': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index c5adca61568..a3fb56284bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -122,7 +123,7 @@ class EnumArrays( array_enum: typing.Union[array_enum, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'EnumArrays': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 371b7835062..45a9a512fc0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 6c0dd1eb4f9..7204328fc89 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -206,7 +207,7 @@ class EnumTest( IntegerEnumOneValue: typing.Union['IntegerEnumOneValue', Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'EnumTest': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 75d6046477f..9c433255529 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class EquilateralTriangle( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'EquilateralTriangle': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py index a6a6e6a494d..1e23482bd9c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,7 +90,7 @@ class EquilateralTriangleAllOf( triangleType: typing.Union[triangleType, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'EquilateralTriangleAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index a9306665853..3bb58da7067 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -77,7 +78,7 @@ class File( sourceURI: typing.Union[sourceURI, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'File': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 632b4be2e00..f55669e6993 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,7 +91,7 @@ class FileSchemaTestClass( files: typing.Union[files, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'FileSchemaTestClass': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 8ad604af2b6..47357f61588 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,7 +76,7 @@ class Foo( bar: typing.Union[bar, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Foo': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index e86ab8fc5da..4560f080ddd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -222,7 +223,7 @@ class FormatTest( noneProp: typing.Union[noneProp, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'FormatTest': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index c4d04e6f6fa..3fba42202fe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -91,11 +92,11 @@ class Fruit( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], color: typing.Union[color, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Fruit': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 5170901cec3..74414d77add 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -92,10 +93,10 @@ class FruitReq( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'FruitReq': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index 45a96f3718e..59d81989169 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -91,11 +92,11 @@ class GmFruit( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], color: typing.Union[color, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'GmFruit': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index fce1e5b8a45..47e282a63e8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -88,7 +89,7 @@ class GrandparentAnimal( pet_type: pet_type, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'GrandparentAnimal': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index 35a72109094..a0a1f019d81 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -77,7 +78,7 @@ class HasOnlyReadOnly( foo: typing.Union[foo, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'HasOnlyReadOnly': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index db0e3586671..3ea543b0004 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -81,7 +82,7 @@ class HealthCheckResult( cls, *args: typing.Union[str, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'NullableMessage': return super().__new__( cls, *args, @@ -95,7 +96,7 @@ class HealthCheckResult( NullableMessage: typing.Union[NullableMessage, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'HealthCheckResult': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index ae29e2cf1c7..146af3287ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -79,7 +80,7 @@ class InlineResponseDefault( string: typing.Union['Foo', Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'InlineResponseDefault': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 857b0cffa90..6227389dfb1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py index bcc9aa57f93..d9132eb2997 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_big.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index 17b1d599779..bf6c9452502 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 2916e4fcdff..48870526b65 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py index 8a57a1cdd5e..087d6c07427 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_max10.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py index 18a76f8e6ff..ef06e4d9e73 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_min15.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index 2f14974794e..fa8036ac0c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class IsoscelesTriangle( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'IsoscelesTriangle': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py index 96d8b286c0e..98351c3eb9d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,7 +90,7 @@ class IsoscelesTriangleAllOf( triangleType: typing.Union[triangleType, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'IsoscelesTriangleAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index 6868e7e2a8b..c46a3dde4ad 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -102,10 +103,10 @@ class Mammal( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Mammal': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 9fca5b0310b..c8e7a591f8c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -84,7 +85,7 @@ class MapTest( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> '_additional_properties': return super().__new__( cls, *args, @@ -98,7 +99,7 @@ class MapTest( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'map_map_of_string': return super().__new__( cls, *args, @@ -138,7 +139,7 @@ class MapTest( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'map_of_enum_string': return super().__new__( cls, *args, @@ -158,7 +159,7 @@ class MapTest( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'direct_map': return super().__new__( cls, *args, @@ -181,7 +182,7 @@ class MapTest( indirect_map: typing.Union['StringBooleanMap', Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'MapTest': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index fa0afeab0be..e8bb843a7c8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -85,7 +86,7 @@ class MixedPropertiesAndAdditionalPropertiesClass( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'map': return super().__new__( cls, *args, @@ -102,7 +103,7 @@ class MixedPropertiesAndAdditionalPropertiesClass( map: typing.Union[map, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'MixedPropertiesAndAdditionalPropertiesClass': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index a7fcdd30ad5..cf5dd3ae557 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,11 +76,11 @@ class Model200Response( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], name: typing.Union[name, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Model200Response': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index 8ca497627cc..5a9f2f5bb08 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -74,10 +75,10 @@ class ModelReturn( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ModelReturn': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py new file mode 100644 index 00000000000..603573e9f99 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/money.py @@ -0,0 +1,99 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class Money( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + _required_property_names = set(( + 'amount', + 'currency', + )) + amount = DecimalSchema + + @classmethod + @property + def currency(cls) -> typing.Type['Currency']: + return Currency + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + amount: amount, + currency: currency, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'Money': + return super().__new__( + cls, + *args, + amount=amount, + currency=currency, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.currency import Currency diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index c5700c9b763..08f1eacf23b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -79,12 +80,12 @@ class Name( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], name: name, snake_case: typing.Union[snake_case, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Name': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py index 2ec538c5dae..4e7724357e8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/no_additional_properties.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -80,7 +81,7 @@ class NoAdditionalProperties( id: id, petId: typing.Union[petId, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'NoAdditionalProperties': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index 329db7acc08..d3a24743246 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -69,7 +70,7 @@ class NullableClass( class integer_prop( - _SchemaTypeChecker(typing.Union[none_type, Decimal, ]), + _SchemaTypeChecker(typing.Union[none_type, decimal.Decimal, ]), IntBase, NoneBase, Schema @@ -79,7 +80,7 @@ class NullableClass( cls, *args: typing.Union[int, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'integer_prop': return super().__new__( cls, *args, @@ -88,7 +89,7 @@ class NullableClass( class number_prop( - _SchemaTypeChecker(typing.Union[none_type, Decimal, ]), + _SchemaTypeChecker(typing.Union[none_type, decimal.Decimal, ]), NumberBase, NoneBase, Schema @@ -98,7 +99,7 @@ class NullableClass( cls, *args: typing.Union[float, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'number_prop': return super().__new__( cls, *args, @@ -117,7 +118,7 @@ class NullableClass( cls, *args: typing.Union[bool, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'boolean_prop': return super().__new__( cls, *args, @@ -136,7 +137,7 @@ class NullableClass( cls, *args: typing.Union[str, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'string_prop': return super().__new__( cls, *args, @@ -155,7 +156,7 @@ class NullableClass( cls, *args: typing.Union[None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'date_prop': return super().__new__( cls, *args, @@ -174,7 +175,7 @@ class NullableClass( cls, *args: typing.Union[None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'datetime_prop': return super().__new__( cls, *args, @@ -193,7 +194,7 @@ class NullableClass( cls, *args: typing.Union[list, tuple, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'array_nullable_prop': return super().__new__( cls, *args, @@ -212,7 +213,7 @@ class NullableClass( cls, *args: typing.Union[list, tuple, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'array_and_items_nullable_prop': return super().__new__( cls, *args, @@ -237,7 +238,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> '_items': return super().__new__( cls, *args, @@ -259,7 +260,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'object_nullable_prop': return super().__new__( cls, *args, @@ -288,7 +289,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> '_additional_properties': return super().__new__( cls, *args, @@ -301,7 +302,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'object_and_items_nullable_prop': return super().__new__( cls, *args, @@ -327,7 +328,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> '_additional_properties': return super().__new__( cls, *args, @@ -341,7 +342,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'object_items_nullable': return super().__new__( cls, *args, @@ -362,7 +363,7 @@ class NullableClass( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> '_additional_properties': return super().__new__( cls, *args, @@ -388,7 +389,7 @@ class NullableClass( object_items_nullable: typing.Union[object_items_nullable, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'NullableClass': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index 8bf418c1445..2a0c429f54e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -104,10 +105,10 @@ class NullableShape( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'NullableShape': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py index db4a33d9be0..567a7fac160 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_string.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -74,7 +75,7 @@ class NullableString( cls, *args: typing.Union[str, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'NullableString': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py index c4c4695e8be..19c1626f487 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index d9e2b49aa81..52533d39e49 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -75,7 +76,7 @@ class NumberOnly( JustNumber: typing.Union[JustNumber, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'NumberOnly': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index fa87e19d3a4..c8108d4a107 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py index a5e32358a31..af87968d14a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_interface.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 005497a8fa4..14aeee17ba6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -85,7 +86,7 @@ class ObjectModelWithRefProps( myBoolean: typing.Union[myBoolean, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ObjectModelWithRefProps': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py new file mode 100644 index 00000000000..074cc52aaa4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_decimal_properties.py @@ -0,0 +1,98 @@ +# 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 +""" + +import re # noqa: F401 +import sys # noqa: F401 +import typing # noqa: F401 + +from frozendict import frozendict # noqa: F401 + +import decimal # noqa: F401 +from datetime import date, datetime # noqa: F401 +from frozendict import frozendict # noqa: F401 + +from petstore_api.schemas import ( # noqa: F401 + AnyTypeSchema, + ComposedSchema, + DictSchema, + ListSchema, + StrSchema, + IntSchema, + Int32Schema, + Int64Schema, + Float32Schema, + Float64Schema, + NumberSchema, + DateSchema, + DateTimeSchema, + DecimalSchema, + BoolSchema, + BinarySchema, + NoneSchema, + none_type, + InstantiationMetadata, + Unset, + unset, + ComposedBase, + ListBase, + DictBase, + NoneBase, + StrBase, + IntBase, + NumberBase, + DateBase, + DateTimeBase, + BoolBase, + BinaryBase, + Schema, + _SchemaValidator, + _SchemaTypeChecker, + _SchemaEnumMaker +) + + +class ObjectWithDecimalProperties( + DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + length = DecimalSchema + width = DecimalSchema + + @classmethod + @property + def cost(cls) -> typing.Type['Money']: + return Money + + + def __new__( + cls, + *args: typing.Union[dict, frozendict, ], + length: typing.Union[length, Unset] = unset, + width: typing.Union[width, Unset] = unset, + cost: typing.Union['Money', Unset] = unset, + _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, + **kwargs: typing.Type[Schema], + ) -> 'ObjectWithDecimalProperties': + return super().__new__( + cls, + *args, + length=length, + width=width, + cost=cost, + _instantiation_metadata=_instantiation_metadata, + **kwargs, + ) + +from petstore_api.model.money import Money diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py index 2beb1a96edf..2429a2205a2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_difficultly_named_props.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -87,7 +88,7 @@ class ObjectWithDifficultlyNamedProps( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ObjectWithDifficultlyNamedProps': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py index ff52e9e6a07..b0b588d04a1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_with_validations.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -76,7 +77,7 @@ class ObjectWithValidations( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ObjectWithValidations': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index e272d48cf0d..294687560d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -111,7 +112,7 @@ class Order( complete: typing.Union[complete, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Order': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 4946eb510dd..2775c77d79c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -102,7 +103,7 @@ class ParentPet( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ParentPet': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 3bd1fcadb75..038a4c6f701 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -135,7 +136,7 @@ class Pet( status: typing.Union[status, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Pet': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index e5dc2bb1710..438831aac74 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -100,10 +101,10 @@ class Pig( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Pig': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py index 817770d4455..e85504879ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/player.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -83,7 +84,7 @@ class Player( enemyPlayer: typing.Union['Player', Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Player': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index 85fa3e76334..7ce3ae227f9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -100,10 +101,10 @@ class Quadrilateral( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Quadrilateral': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index 52f17cf2ec8..ff7e85735b4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,12 +90,12 @@ class QuadrilateralInterface( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], shapeType: shapeType, quadrilateralType: quadrilateralType, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'QuadrilateralInterface': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index ebc9b3b5662..c3b568a7336 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -77,7 +78,7 @@ class ReadOnlyFirst( baz: typing.Union[baz, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ReadOnlyFirst': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 9bddbc85da5..721c27153e5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class ScaleneTriangle( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ScaleneTriangle': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py index f5c2edcb720..59552599264 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,7 +90,7 @@ class ScaleneTriangleAllOf( triangleType: typing.Union[triangleType, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ScaleneTriangleAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 4aaa6b6be13..f61207d5b57 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -100,10 +101,10 @@ class Shape( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Shape': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 121988a3def..f78ed803a59 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -104,10 +105,10 @@ class ShapeOrNull( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'ShapeOrNull': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index b326d1a5837..f6bf08a97e5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -90,10 +91,10 @@ class SimpleQuadrilateral( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SimpleQuadrilateral': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py index ff52c014531..8e4bea9b30e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral_all_of.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,7 +90,7 @@ class SimpleQuadrilateralAllOf( quadrilateralType: typing.Union[quadrilateralType, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SimpleQuadrilateralAllOf': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py index 2b7e243a476..3efa9b66074 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/some_object.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,10 +90,10 @@ class SomeObject( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SomeObject': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 967b02cb3d0..9a67034b34c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -77,7 +78,7 @@ class SpecialModelName( a: typing.Union[a, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'SpecialModelName': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py index 9b51e661bfd..f2f4e22231e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 14fb2216dad..a42d77f660d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -74,7 +75,7 @@ class StringBooleanMap( *args: typing.Union[dict, frozendict, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'StringBooleanMap': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index a8fa2a6c6ba..395d83d0f1e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -126,7 +127,7 @@ lines''') cls, *args: typing.Union[str, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, - ): + ) -> 'StringEnum': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index 52689f388b5..c51fbf77013 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py index 7b41acff15d..9eae261142d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_with_validation.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index 0316fce5b92..1b38c173ce0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -77,7 +78,7 @@ class Tag( name: typing.Union[name, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Tag': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index dae6c43d213..c312855b6bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -102,10 +103,10 @@ class Triangle( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Triangle': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index db721a77afb..a36fd79ef3f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,12 +90,12 @@ class TriangleInterface( def __new__( cls, - *args: typing.Union[dict, frozendict, str, date, datetime, int, float, Decimal, None, list, tuple, bytes], + *args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes], shapeType: shapeType, triangleType: triangleType, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'TriangleInterface': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index c55c2e0e687..cf29c50f64f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -89,7 +90,7 @@ class User( *args: typing.Union[dict, frozendict, None, ], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'objectWithNoDeclaredPropsNullable': return super().__new__( cls, *args, @@ -117,7 +118,7 @@ class User( anyTypePropNullable: typing.Union[anyTypePropNullable, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'User': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index dabdd735658..8d6de64ab2c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -96,7 +97,7 @@ class Whale( hasTeeth: typing.Union[hasTeeth, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Whale': return super().__new__( cls, *args, diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index 17d8746ce70..15bbe41e9b4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -15,7 +15,7 @@ import typing # noqa: F401 from frozendict import frozendict # noqa: F401 -from decimal import Decimal # noqa: F401 +import decimal # noqa: F401 from datetime import date, datetime # noqa: F401 from frozendict import frozendict # noqa: F401 @@ -33,6 +33,7 @@ from petstore_api.schemas import ( # noqa: F401 NumberSchema, DateSchema, DateTimeSchema, + DecimalSchema, BoolSchema, BinarySchema, NoneSchema, @@ -120,7 +121,7 @@ class Zebra( type: typing.Union[type, Unset] = unset, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Type[Schema], - ): + ) -> 'Zebra': return super().__new__( cls, *args, 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 9d3b94558c8..07e026d2c2f 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 @@ -49,10 +49,12 @@ from petstore_api.model.composed_number import ComposedNumber from petstore_api.model.composed_object import ComposedObject from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes from petstore_api.model.composed_string import ComposedString +from petstore_api.model.currency import Currency from petstore_api.model.danish_pig import DanishPig from petstore_api.model.date_time_test import DateTimeTest from petstore_api.model.date_time_with_validations import DateTimeWithValidations from petstore_api.model.date_with_validations import DateWithValidations +from petstore_api.model.decimal_payload import DecimalPayload from petstore_api.model.dog import Dog from petstore_api.model.dog_all_of import DogAllOf from petstore_api.model.drawing import Drawing @@ -85,6 +87,7 @@ 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.money import Money from petstore_api.model.name import Name from petstore_api.model.no_additional_properties import NoAdditionalProperties from petstore_api.model.nullable_class import NullableClass @@ -95,6 +98,7 @@ from petstore_api.model.number_only import NumberOnly from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.object_interface import ObjectInterface from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps from petstore_api.model.object_with_validations import ObjectWithValidations from petstore_api.model.order import Order diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py index e230675efaa..b896e4ebe4f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/schemas.py @@ -13,7 +13,7 @@ from collections import defaultdict from datetime import date, datetime, timedelta # noqa: F401 from dataclasses import dataclass import functools -from decimal import Decimal +import decimal import io import os import re @@ -119,12 +119,12 @@ class ValidatorBase: """Returns true if JSON schema validation is enabled for the specified validation keyword. This can be used to skip JSON schema structural validation as requested in the configuration. - + Args: schema_keyword (string): the name of a JSON schema validation keyword. configuration (Configuration): the configuration class. """ - + return (configuration is None or not hasattr(configuration, '_disabled_client_side_validations') or schema_keyword not in configuration._disabled_client_side_validations) @@ -263,7 +263,7 @@ class ValidatorBase: _instantiation_metadata.configuration) and 'multiple_of' in validations: multiple_of_values = validations['multiple_of'] for multiple_of_value in multiple_of_values: - if (isinstance(input_values, Decimal) and + if (isinstance(input_values, decimal.Decimal) and not (float(input_values) / multiple_of_value).is_integer() ): # Note 'multipleOf' will be as good as the floating point arithmetic. @@ -334,7 +334,7 @@ class ValidatorBase: cls.__check_tuple_validations(validations, input_values, _instantiation_metadata) elif isinstance(input_values, frozendict): cls.__check_dict_validations(validations, input_values, _instantiation_metadata) - elif isinstance(input_values, Decimal): + elif isinstance(input_values, decimal.Decimal): cls.__check_numeric_validations(validations, input_values, _instantiation_metadata) try: return super()._validate_validations_pass(input_values, _instantiation_metadata) @@ -431,7 +431,7 @@ class EnumMakerInterface(typing.Protocol): @property def _enum_value_to_name( cls - ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + ) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]: pass @classmethod @@ -442,13 +442,13 @@ class EnumMakerInterface(typing.Protocol): pass -def _SchemaEnumMaker(enum_value_to_name: typing.Dict[typing.Union[str, Decimal, bool, none_type], str]) -> EnumMakerInterface: +def _SchemaEnumMaker(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> EnumMakerInterface: class SchemaEnumMaker(EnumMakerBase): @classmethod @property def _enum_value_to_name( cls - ) -> typing.Dict[typing.Union[str, Decimal, bool, none_type], str]: + ) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]: pass try: super_enum_value_to_name = super()._enum_value_to_name @@ -545,6 +545,10 @@ class StrBase: def as_datetime(self) -> datetime: raise Exception('not implemented') + @property + def as_decimal(self) -> decimal.Decimal: + raise Exception('not implemented') + class CustomIsoparser(isoparser): @@ -636,6 +640,39 @@ class DateTimeBase: return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) +class DecimalBase(StrBase): + """ + A class for storing decimals that are sent over the wire as strings + These schemas must remain based on StrBase rather than NumberBase + because picking base classes must be deterministic + """ + + @property + @functools.cache + def as_decimal(self) -> decimal.Decimal: + return decimal.Decimal(self) + + @classmethod + def _validate_format(cls, arg: typing.Optional[str], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, str): + try: + decimal.Decimal(arg) + return True + except decimal.InvalidOperation: + raise ApiValueError( + "Value cannot be converted to a decimal. " + "Invalid value '{}' for type decimal at {}".format(arg, _instantiation_metadata.path_to_item) + ) + + @classmethod + def _validate(cls, *args, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + """ + DecimalBase _validate + """ + cls._validate_format(args[0], _instantiation_metadata=_instantiation_metadata) + return super()._validate(*args, _instantiation_metadata=_instantiation_metadata) + + class NumberBase: @property def as_int(self) -> int: @@ -1045,7 +1082,7 @@ class DictBase(Discriminable): return super().__getattribute__(name) -inheritable_primitive_types_set = {Decimal, str, tuple, frozendict, FileIO, bytes} +inheritable_primitive_types_set = {decimal.Decimal, str, tuple, frozendict, FileIO, bytes} class Schema: @@ -1152,8 +1189,8 @@ class Schema: new_cls = get_new_class(cls_name, (cls, BoolBase, BoolClass)) elif base_cls is str: new_cls = get_new_class(cls_name, (cls, StrBase, str)) - elif base_cls is Decimal: - new_cls = get_new_class(cls_name, (cls, NumberBase, Decimal)) + elif base_cls is decimal.Decimal: + new_cls = get_new_class(cls_name, (cls, NumberBase, decimal.Decimal)) elif base_cls is tuple: new_cls = get_new_class(cls_name, (cls, ListBase, tuple)) elif base_cls is frozendict: @@ -1175,7 +1212,7 @@ class Schema: - the returned instance is a serializable type (except for None, True, and False) which are enums Use cases: - 1. inheritable type: string/Decimal/frozendict/tuple + 1. inheritable type: string/decimal.Decimal/frozendict/tuple 2. enum value cases: 'hi', 1 -> no base_class set because the enum includes the base class 3. uninheritable type: True/False/None -> no base_class because the base class is not inheritable _enum_by_value will handle this use case @@ -1315,7 +1352,7 @@ class Schema: return super(Schema, cls).__new__(cls, properties) """ str = openapi str, date, and datetime - Decimal = openapi int and float + decimal.Decimal = openapi int and float FileIO = openapi binary type and the user inputs a file bytes = openapi binary type and the user inputs bytes """ @@ -1330,7 +1367,7 @@ class Schema: datetime, int, float, - Decimal, + decimal.Decimal, bool, None, 'Schema', @@ -1367,13 +1404,13 @@ class Schema: def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} - def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): + def __new__(cls, *args: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset]): """ Schema __new__ Args: - args (int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): the value - kwargs (str, int/float/Decimal/str/list/tuple/dict/frozendict/bool/None): dict values + args (int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): the value + kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict/bool/None): dict values _instantiation_metadata: contains the needed from_server, configuration, path_to_item """ kwargs = cls.__remove_unsets(kwargs) @@ -1397,10 +1434,10 @@ class Schema: def __init__( self, *args: typing.Union[ - dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema'], + dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema'], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None, **kwargs: typing.Union[ - dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset + dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, 'Schema', Unset ] ): """ @@ -1412,7 +1449,7 @@ class Schema: pass -def cast_to_allowed_types(arg: typing.Union[str, date, datetime, int, float, None, dict, frozendict, list, tuple, bytes, Schema], from_server=False) -> typing.Union[str, bytes, int, float, None, frozendict, tuple, Schema]: +def cast_to_allowed_types(arg: typing.Union[str, date, datetime, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema], from_server=False) -> typing.Union[str, bytes, decimal.Decimal, None, frozendict, tuple, Schema]: """ from_server=False date, datetime -> str int, float -> Decimal @@ -1429,16 +1466,16 @@ def cast_to_allowed_types(arg: typing.Union[str, date, datetime, int, float, Non because isinstance(True, int) is True """ return arg - elif isinstance(arg, Decimal): + elif isinstance(arg, decimal.Decimal): return arg elif isinstance(arg, int): - return Decimal(arg) + return decimal.Decimal(arg) elif isinstance(arg, float): - decimal_from_float = Decimal(arg) + decimal_from_float = decimal.Decimal(arg) if decimal_from_float.as_integer_ratio()[1] == 1: # 9.0 -> Decimal('9.0') # 3.4028234663852886e+38 -> Decimal('340282346638528859811704183484516925440.0') - return Decimal(str(decimal_from_float)+'.0') + return decimal.Decimal(str(decimal_from_float)+'.0') return decimal_from_float elif isinstance(arg, str): return arg @@ -1635,7 +1672,7 @@ class ComposedBase(Discriminable): # DictBase, ListBase, NumberBase, StrBase, BoolBase, NoneBase class ComposedSchema( - _SchemaTypeChecker(typing.Union[none_type, str, Decimal, bool, tuple, frozendict]), + _SchemaTypeChecker(typing.Union[none_type, str, decimal.Decimal, bool, tuple, frozendict]), ComposedBase, DictBase, ListBase, @@ -1687,7 +1724,7 @@ class NoneSchema( class NumberSchema( - _SchemaTypeChecker(typing.Union[Decimal]), + _SchemaTypeChecker(typing.Union[decimal.Decimal]), NumberBase, Schema ): @@ -1697,10 +1734,10 @@ class NumberSchema( """ @classmethod - def _from_openapi_data(cls, arg: typing.Union[int, float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) - def __new__(cls, arg: typing.Union[Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[InstantiationMetadata]): return super().__new__(cls, arg, **kwargs) @@ -1714,8 +1751,8 @@ class IntBase(NumberBase): return self._as_int @classmethod - def _validate_format(cls, arg: typing.Optional[Decimal], _instantiation_metadata: InstantiationMetadata): - if isinstance(arg, Decimal): + def _validate_format(cls, arg: typing.Optional[decimal.Decimal], _instantiation_metadata: InstantiationMetadata): + if isinstance(arg, decimal.Decimal): exponent = arg.as_tuple().exponent if exponent != 0: raise ApiValueError( @@ -1738,14 +1775,14 @@ class IntSchema(IntBase, NumberSchema): def _from_openapi_data(cls, arg: int, _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) - def __new__(cls, arg: typing.Union[Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): + def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[InstantiationMetadata]): return super().__new__(cls, arg, **kwargs) class Int32Schema( _SchemaValidator( - inclusive_minimum=Decimal(-2147483648), - inclusive_maximum=Decimal(2147483647) + inclusive_minimum=decimal.Decimal(-2147483648), + inclusive_maximum=decimal.Decimal(2147483647) ), IntSchema ): @@ -1753,8 +1790,8 @@ class Int32Schema( class Int64Schema( _SchemaValidator( - inclusive_minimum=Decimal(-9223372036854775808), - inclusive_maximum=Decimal(9223372036854775807) + inclusive_minimum=decimal.Decimal(-9223372036854775808), + inclusive_maximum=decimal.Decimal(9223372036854775807) ), IntSchema ): @@ -1763,28 +1800,28 @@ class Int64Schema( class Float32Schema( _SchemaValidator( - inclusive_minimum=Decimal(-3.4028234663852886e+38), - inclusive_maximum=Decimal(3.4028234663852886e+38) + inclusive_minimum=decimal.Decimal(-3.4028234663852886e+38), + inclusive_maximum=decimal.Decimal(3.4028234663852886e+38) ), NumberSchema ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): # todo check format return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) class Float64Schema( _SchemaValidator( - inclusive_minimum=Decimal(-1.7976931348623157E+308), - inclusive_maximum=Decimal(1.7976931348623157E+308) + inclusive_minimum=decimal.Decimal(-1.7976931348623157E+308), + inclusive_maximum=decimal.Decimal(1.7976931348623157E+308) ), NumberSchema ): @classmethod - def _from_openapi_data(cls, arg: typing.Union[float, Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): + def _from_openapi_data(cls, arg: typing.Union[float, decimal.Decimal], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): # todo check format return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) @@ -1821,6 +1858,20 @@ class DateTimeSchema(DateTimeBase, StrSchema): return super().__new__(cls, arg, **kwargs) +class DecimalSchema(DecimalBase, StrSchema): + + def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[InstantiationMetadata]): + """ + Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads + which can be simple (str) or complex (dicts or lists with nested values) + Because casting is only done once and recursively casts all values prior to validation then for a potential + client side Decimal input if Decimal was accepted as an input in DecimalSchema then one would not know + if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema + where it should stay as Decimal. + """ + return super().__new__(cls, arg, **kwargs) + + class BytesSchema( _SchemaTypeChecker(typing.Union[bytes]), Schema, @@ -1908,7 +1959,7 @@ class BoolSchema( class AnyTypeSchema( _SchemaTypeChecker( - typing.Union[frozendict, tuple, Decimal, str, bool, none_type, bytes, FileIO] + typing.Union[frozendict, tuple, decimal.Decimal, str, bool, none_type, bytes, FileIO] ), DictBase, ListBase, @@ -1931,7 +1982,7 @@ class DictSchema( def _from_openapi_data(cls, arg: typing.Dict[str, typing.Any], _instantiation_metadata: typing.Optional[InstantiationMetadata] = None): return super()._from_openapi_data(arg, _instantiation_metadata=_instantiation_metadata) - def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): + def __new__(cls, *args: typing.Union[dict, frozendict], **kwargs: typing.Union[dict, frozendict, list, tuple, decimal.Decimal, float, int, str, date, datetime, bool, None, bytes, Schema, Unset, InstantiationMetadata]): return super().__new__(cls, *args, **kwargs) 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 442b5ed138a..3e0f6a96aaa 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py index 076df41d63f..4e67ade9dde 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 78d67400748..2890381c264 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_address.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_address.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 572450a9704..7e244b29bae 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py index 3ee8615f57c..f3d8ff2fa8f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 c58dfa6202b..a2e3736712a 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 @@ -9,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import unittest import petstore_api 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 63dc0ede9b2..c75371329f0 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 e8abc62ef04..32f95fa8345 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 38edc7a55da..767c88cd8a6 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py index cee2263dd67..bcd5c9c3ec5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_holding_any_type.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 ebf1ad38367..2ac8010f06d 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py index 44a59bb5263..43e974c180d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 21bffad3329..b0098336e21 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 4528c568690..4efdf344f38 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py index 95a19cba751..ae9f92a9414 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_with_validations_in_items.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 77b1b2aaf30..693c03a89f4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 2bfbb9edb4c..683083c66cf 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_bar.py b/samples/openapi3/client/petstore/python-experimental/test/test_bar.py index 3d942938467..6c041955bb5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_bar.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_bar.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 4af8d8947ca..21c243e7d97 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py b/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py index c2e2faab188..2ae22b6a2bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_boolean.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py index 2d73bc707f5..ea61d7186ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_boolean_enum.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8cb68360735..1b60714649f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 7c2b75fe8af..571f3b9adca 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 84ebd083410..fc203c2dbaa 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8f19639fb51..a37846446aa 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_category.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 f4be6a52a8d..3537d0effcb 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 410ac2772ab..98839fa6748 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 6a472da41ae..fdbf0e7ff7c 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 70a26741f40..0222983fc21 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_client.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 95c68678521..e31da4be744 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py index 96fdc5103f3..d6d7fa4cba4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral_all_of.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py index 92263d13945..96691e8f9e8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_any_of_different_types_no_validations.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py index 3e48ed79fe5..a83aa868cdc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_array.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py index 790edcc16d3..8ccaed5ee13 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_bool.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py index 65c7dd5adb9..0669698ed2b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_none.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py index 66fdc3c591e..162b7bcaf8d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_number.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py index 6212b89f9bc..a2d8b85a34f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_object.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py index b15712de301..c33fd21e5e4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_different_types.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py index 2bfcf2f74d3..902d75278d4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_string.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_currency.py b/samples/openapi3/client/petstore/python-experimental/test/test_currency.py new file mode 100644 index 00000000000..06f8236b892 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_currency.py @@ -0,0 +1,35 @@ +# 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 +""" + +import unittest + +import petstore_api +from petstore_api.model.currency import Currency + + +class TestCurrency(unittest.TestCase): + """Currency unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Currency(self): + """Test Currency""" + # FIXME: construct object with mandatory attributes with example values + # model = Currency() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 1a46253ed9f..e1c66fdf6d2 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py index 275b74c92a2..597abd5ba8c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_test.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py index 0edf5c5e85b..7f8c4c3bb46 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_date_time_with_validations.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py index 866e5529225..2656d3b91fc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_date_with_validations.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_decimal_payload.py b/samples/openapi3/client/petstore/python-experimental/test/test_decimal_payload.py new file mode 100644 index 00000000000..b50d4fbc8a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_decimal_payload.py @@ -0,0 +1,35 @@ +# 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 +""" + +import unittest + +import petstore_api +from petstore_api.model.decimal_payload import DecimalPayload + + +class TestDecimalPayload(unittest.TestCase): + """DecimalPayload unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_DecimalPayload(self): + """Test DecimalPayload""" + # FIXME: construct object with mandatory attributes with example values + # model = DecimalPayload() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 caf174d6d4b..2af6b820e00 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 @@ -9,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import unittest import petstore_api 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 4643c7af835..4adcdd278cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 89526f7051f..3a11693e9b1 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 091d89c80e1..d08e8a6fbed 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 0b7e553a7d1..55b12169e27 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 298c740defa..18688309ecd 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 2022b10d5d5..9952acb6820 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 d85647271ce..62308d48c8a 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py index 9651e4efd43..8ff85083ffd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle_all_of.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 b7724aaed7d..63c46155bd6 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 @@ -9,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import unittest import petstore_api @@ -25,8 +24,8 @@ class TestFakeClassnameTags123Api(unittest.TestCase): def tearDown(self): pass - def test_test_classname(self): - """Test case for test_classname + def test_classname(self): + """Test case for classname To test class name in snake case # noqa: E501 """ 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 7154338bc7a..240760a67d3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 0b56063d59f..fc4828d0edb 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 69fbc69ba9e..4ee6344ea27 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 e5d081ceaa4..46d4794bbe6 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 43a58a870c3..490ce5cf952 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 3745b38f17e..ceae8a93424 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 487e5275516..c924c45e559 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8820ad5f253..34edef40063 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 0019338c2bc..8ed163b7621 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 e654924727b..2bf06af9a63 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 98b9b31821a..19408e88f66 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py index b94fef7543a..abd3db17c9c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py index 61052164aee..d905b1d6404 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_big.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py index 9c94769ef70..f3dee3f395b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py index bcdd005b2fb..48ffddb7b02 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py index 9a982a0cb28..fd4a0d07930 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_max10.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py index b54a5c3e1a1..05898df5126 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_min15.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 00a236f5544..c17549e2b1b 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py index ec2e16403f7..a9a8903953b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle_all_of.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 361f043de97..df83e514618 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 7239da64e29..21305dee99b 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8291a671896..9f54921c695 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 11caf2a0c0b..48f8ea5e01c 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 61841ab2acb..79b04d0931d 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_money.py b/samples/openapi3/client/petstore/python-experimental/test/test_money.py new file mode 100644 index 00000000000..2eb90df6644 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_money.py @@ -0,0 +1,35 @@ +# 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 +""" + +import unittest + +import petstore_api +from petstore_api.model.money import Money + + +class TestMoney(unittest.TestCase): + """Money unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_Money(self): + """Test Money""" + # FIXME: construct object with mandatory attributes with example values + # model = Money() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() 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 67b92d6ef0d..ec115ac670e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py b/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py index a7665403245..59ccb034d64 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_no_additional_properties.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8eeb087512f..5b4cfeb945b 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 7126a23ed42..697c8d66329 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py index fac8c8653bf..38fcd7262bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_string.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number.py b/samples/openapi3/client/petstore/python-experimental/test/test_number.py index 9dff8542047..6f7f55b9402 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 a1572ab7f9e..69073964b8e 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py index 919d7c0d5a6..b7dbd3ba66d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py index 42994360b37..45cd46414d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_interface.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index 6c8aaa4c9cf..0a1045ece2a 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_decimal_properties.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_decimal_properties.py new file mode 100644 index 00000000000..f8c4ff1a6c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_decimal_properties.py @@ -0,0 +1,35 @@ +# 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 +""" + +import unittest + +import petstore_api +from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties + + +class TestObjectWithDecimalProperties(unittest.TestCase): + """ObjectWithDecimalProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_ObjectWithDecimalProperties(self): + """Test ObjectWithDecimalProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = ObjectWithDecimalProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py index 6bd3ec317cd..c5959830948 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_difficultly_named_props.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api @@ -28,27 +26,9 @@ class TestObjectWithDifficultlyNamedProps(unittest.TestCase): def test_ObjectWithDifficultlyNamedProps(self): """Test ObjectWithDifficultlyNamedProps""" - kwargs = { - '$special[property.name]': 1, - '123-list': '', - '123Number': 2, - } - model = ObjectWithDifficultlyNamedProps(**kwargs) - self.assertEqual(model['$special[property.name]'], 1) - self.assertEqual(model['123-list'], '') - self.assertEqual(model['123Number'], 2) - self.assertEqual(model, kwargs) - - # without the required argument, an exception is raised - optional_kwargs = { - '$special[property.name]': 1, - '123Number': 2, - } - with self.assertRaisesRegex( - petstore_api.ApiTypeError, - r"ObjectWithDifficultlyNamedProps is missing 1 required argument: ['123-list']" - ): - ObjectWithDifficultlyNamedProps(**optional_kwargs) + # FIXME: construct object with mandatory attributes with example values + # model = ObjectWithDifficultlyNamedProps() # noqa: E501 + pass if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py index cfe0400fcee..128755642ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_with_validations.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 9463845b34a..bfed83072ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_order.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 d1507e114f0..0c9d1876520 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 dc34ae0012b..133ae47f409 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 d545f497297..494be2ebd84 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 @@ -9,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import unittest import petstore_api @@ -74,13 +73,6 @@ class TestPetApi(unittest.TestCase): """ pass - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - def test_upload_file_with_required_file(self): """Test case for upload_file_with_required_file @@ -88,6 +80,13 @@ class TestPetApi(unittest.TestCase): """ pass + def test_upload_image(self): + """Test case for upload_image + + uploads an image # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() 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 8c092a8465b..547a45679b6 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_player.py b/samples/openapi3/client/petstore/python-experimental/test/test_player.py index ba15e0f576a..b3d3d685d65 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_player.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_player.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 cc0c203d2ea..f21755a58ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 cec68e36cf5..e1d318d0311 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 d447437eb16..ce3245015e5 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8df06216926..8e20abb6457 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py index f81248b1517..8907e705a98 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle_all_of.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 f34053a9bcb..ac59550d539 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 ee182f6298c..e014a9f0b15 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8a6ce429abf..a06f65e3f18 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py index ad9d92251b4..af618a80517 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral_all_of.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py index f3b94113824..f1fe6af1581 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_some_object.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 b74b45db122..bfc1af2691c 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 3680a34b42a..14918e6e47d 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 @@ -9,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string.py b/samples/openapi3/client/petstore/python-experimental/test/test_string.py index 1c62f3606b8..d3b7bff446e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 bf39e456cf0..d211c69d25d 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py index c63cb8cba8f..9e464a1404d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py index 87073fe5be2..06aba4d7044 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py index 33876844024..df7fef9ecd2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_with_validation.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 a0325e55679..3638a780a82 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 e7978b7d1bf..5c51dc41ae8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 9e498660c0b..fa7414066b2 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 @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 8d6e394ecb3..24ef5a00970 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 abf57b0733d..3fa565f40fe 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 @@ -9,7 +9,6 @@ Generated by: https://openapi-generator.tech """ - import unittest import petstore_api 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 16cfebae337..e19eb56a55c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api 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 dc53745dea5..003ad25d878 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py index e10f99b44bc..059c5eaac60 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_any_type_schema.py @@ -11,6 +11,7 @@ import unittest +from decimal import Decimal import petstore_api from petstore_api.schemas import ( @@ -24,9 +25,9 @@ from petstore_api.schemas import ( NoneSchema, DateSchema, DateTimeSchema, + DecimalSchema, ComposedSchema, frozendict, - Decimal, NoneClass, BoolClass ) @@ -268,6 +269,31 @@ class TestAnyTypeSchema(unittest.TestCase): assert isinstance(m, str) assert m == '2020-01-01T00:00:00' + def testDecimalSchema(self): + class Model(ComposedSchema): + + @classmethod + @property + def _composed_schemas(cls): + return { + 'allOf': [ + AnyTypeSchema, + DecimalSchema, + ], + 'oneOf': [ + ], + 'anyOf': [ + ], + } + + m = Model('12.34') + assert isinstance(m, Model) + assert isinstance(m, AnyTypeSchema) + assert isinstance(m, DecimalSchema) + assert isinstance(m, str) + assert m == '12.34' + assert m.as_decimal == Decimal('12.34') + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_decimal_payload.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_decimal_payload.py new file mode 100644 index 00000000000..25122fc35f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_decimal_payload.py @@ -0,0 +1,46 @@ +# 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 +""" + +import decimal +import unittest + +import petstore_api +from petstore_api.schemas import DecimalSchema +from petstore_api.model.decimal_payload import DecimalPayload + + +class TestDecimalPayload(unittest.TestCase): + """DecimalPayload unit test stubs""" + + def test_DecimalPayload(self): + """Test DecimalPayload""" + + m = DecimalPayload('12') + assert isinstance(m, DecimalPayload) + assert isinstance(m, DecimalSchema) + assert isinstance(m, str) + assert m == '12' + assert m.as_decimal == decimal.Decimal('12') + + m = DecimalPayload('12.34') + assert isinstance(m, DecimalPayload) + assert isinstance(m, DecimalSchema) + assert isinstance(m, str) + assert m == '12.34' + assert m.as_decimal == decimal.Decimal('12.34') + + # passing in a Decimal does not work + with self.assertRaises(petstore_api.ApiTypeError): + DecimalPayload(decimal.Decimal('12.34')) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests_manual/test_money.py b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_money.py new file mode 100644 index 00000000000..a4bd764cc87 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests_manual/test_money.py @@ -0,0 +1,34 @@ +# 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 +""" +import decimal +import unittest + +from petstore_api.model.money import Money + + +class TestMoney(unittest.TestCase): + """Money unit test stubs""" + + def test_Money(self): + """Test Money""" + price = Money( + currency='usd', + amount='10.99' + ) + self.assertEqual(price.amount.as_decimal, decimal.Decimal('10.99')) + self.assertEqual( + price, + dict(currency='usd', amount='10.99') + ) + + +if __name__ == '__main__': + unittest.main() From 1bfed460c59814fc4a097a1064df9ef20939a419 Mon Sep 17 00:00:00 2001 From: Ashutosh Gangwar Date: Wed, 12 Jan 2022 16:52:24 +0530 Subject: [PATCH 030/113] Fix missing ApiKeyAuth import in 'jvm-retrofit2' Kotlin client template (#11286) * fix incorrect ApiKeyAuth import in jvm-retrofit2 kotlin-client template links to - https://github.com/OpenAPITools/openapi-generator/issues/10008 - https://github.com/OpenAPITools/openapi-generator/pull/10708 * update kotlin-retrofit2 samples --- .../jvm-retrofit2/infrastructure/ApiClient.kt.mustache | 4 +++- .../org/openapitools/client/infrastructure/ApiClient.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 2 +- .../org/openapitools/client/infrastructure/ApiClient.kt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index 3d0c640bf6a..248dc3718a4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -3,7 +3,6 @@ package {{packageName}}.infrastructure {{#hasOAuthMethods}} import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import {{packageName}}.auth.ApiKeyAuth import {{packageName}}.auth.OAuth import {{packageName}}.auth.OAuth.AccessTokenListener import {{packageName}}.auth.OAuthFlow @@ -18,6 +17,9 @@ import {{packageName}}.auth.HttpBasicAuth import {{packageName}}.auth.HttpBearerAuth {{/isBasicBearer}} {{/isBasic}} +{{#isApiKey}} +import {{packageName}}.auth.ApiKeyAuth +{{/isApiKey}} {{/authMethods}} {{/hasAuthMethods}} diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 46bb56cee10..9898e6001fb 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -2,10 +2,10 @@ package org.openapitools.client.infrastructure import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth import org.openapitools.client.auth.OAuth import org.openapitools.client.auth.OAuth.AccessTokenListener import org.openapitools.client.auth.OAuthFlow +import org.openapitools.client.auth.ApiKeyAuth import okhttp3.Call import okhttp3.Interceptor diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 11032f9f16c..ffc0e0eb58c 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -2,10 +2,10 @@ package org.openapitools.client.infrastructure import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth import org.openapitools.client.auth.OAuth import org.openapitools.client.auth.OAuth.AccessTokenListener import org.openapitools.client.auth.OAuthFlow +import org.openapitools.client.auth.ApiKeyAuth import okhttp3.Call import okhttp3.Interceptor diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 2197b6acb7a..1ca40216481 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -2,10 +2,10 @@ package org.openapitools.client.infrastructure import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth import org.openapitools.client.auth.OAuth import org.openapitools.client.auth.OAuth.AccessTokenListener import org.openapitools.client.auth.OAuthFlow +import org.openapitools.client.auth.ApiKeyAuth import okhttp3.Call import okhttp3.Interceptor From 69db8176b644ec469e66b21d2e4034e8c4a06e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=A7=84=EC=98=81?= Date: Thu, 13 Jan 2022 01:42:58 +0900 Subject: [PATCH 031/113] keyword conflict with zebos list_creat(), list_free() (#11190) * keyword conflict with zebos list_creat(), list_free() * keyword conflict in zebos list_create list_free --- .../languages/CLibcurlClientCodegen.java | 4 +- .../resources/C-libcurl/api-body.mustache | 34 +++++------ .../resources/C-libcurl/apiClient.c.mustache | 6 +- .../resources/C-libcurl/api_pet_test.mustache | 4 +- .../C-libcurl/api_store_test.mustache | 2 +- .../main/resources/C-libcurl/list.c.mustache | 6 +- .../main/resources/C-libcurl/list.h.mustache | 4 +- .../resources/C-libcurl/model-body.mustache | 12 ++-- .../cpp-tizen-client/api-body.mustache | 2 +- .../cpp-tizen-client/requestinfo.mustache | 2 +- samples/client/petstore/c/api/PetAPI.c | 56 +++++++++---------- samples/client/petstore/c/api/StoreAPI.c | 14 ++--- samples/client/petstore/c/api/UserAPI.c | 12 ++-- samples/client/petstore/c/include/list.h | 4 +- samples/client/petstore/c/model/pet.c | 8 +-- samples/client/petstore/c/src/apiClient.c | 6 +- samples/client/petstore/c/src/list.c | 6 +- .../client/petstore/c/unit-test/test_pet.c | 8 +-- .../petstore/c/unit-tests/manual-PetAPI.c | 4 +- .../petstore/c/unit-tests/manual-StoreAPI.c | 2 +- .../petstore/cpp-tizen/src/PetManager.cpp | 16 +++--- .../petstore/cpp-tizen/src/RequestInfo.h | 2 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 8 +-- .../petstore/cpp-tizen/src/UserManager.cpp | 16 +++--- 24 files changed, 119 insertions(+), 119 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index e7aa24c603d..da9b8d200be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -519,9 +519,9 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf } else if (ModelUtils.isBooleanSchema(schema)) { example = "1"; } else if (ModelUtils.isArraySchema(schema)) { - example = "list_create()"; + example = "list_createList()"; } else if (ModelUtils.isMapSchema(schema)) { - example = "list_create()"; + example = "list_createList()"; } else if (ModelUtils.isObjectSchema(schema)) { return null; // models are managed at moustache level } else { diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 9d73ff5591a..7ee11c71fbc 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -101,11 +101,11 @@ end: {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} {{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}{{dataType}}_t *{{/isArray}}{{#isMap}}{{dataType}}{{/isMap}}{{/isContainer}} {{{paramName}}} {{/allParams}}) { - list_t *localVarQueryParameters = {{#hasQueryParams}}list_create();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} - list_t *localVarHeaderParameters = {{#hasHeaderParams}}list_create();{{/hasHeaderParams}}{{^hasHeaderParams}}NULL;{{/hasHeaderParams}} - list_t *localVarFormParameters = {{#hasFormParams}}list_create();{{/hasFormParams}}{{^hasFormParams}}NULL;{{/hasFormParams}} - list_t *localVarHeaderType = {{#hasProduces}}list_create();{{/hasProduces}}{{^hasProduces}}NULL;{{/hasProduces}} - list_t *localVarContentType = {{#hasConsumes}}list_create();{{/hasConsumes}}{{^hasConsumes}}NULL;{{/hasConsumes}} + list_t *localVarQueryParameters = {{#hasQueryParams}}list_createList();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} + list_t *localVarHeaderParameters = {{#hasHeaderParams}}list_createList();{{/hasHeaderParams}}{{^hasHeaderParams}}NULL;{{/hasHeaderParams}} + list_t *localVarFormParameters = {{#hasFormParams}}list_createList();{{/hasFormParams}}{{^hasFormParams}}NULL;{{/hasFormParams}} + list_t *localVarHeaderType = {{#hasProduces}}list_createList();{{/hasProduces}}{{^hasProduces}}NULL;{{/hasProduces}} + list_t *localVarContentType = {{#hasConsumes}}list_createList();{{/hasConsumes}}{{^hasConsumes}}NULL;{{/hasConsumes}} char *localVarBodyParameters = NULL; // create the path @@ -341,7 +341,7 @@ end: //primitive return type not simple cJSON *{{paramName}}localVarJSON = cJSON_Parse(apiClient->dataReceived); cJSON *{{{paramName}}}VarJSON; - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON_ArrayForEach({{{paramName}}}VarJSON, {{paramName}}localVarJSON){ keyValuePair_t *keyPair = keyValuePair_create(strdup({{{paramName}}}VarJSON->string), cJSON_Print({{{paramName}}}VarJSON)); list_addElement(elementToReturn, keyPair); @@ -356,7 +356,7 @@ end: if(!cJSON_IsArray({{classname}}localVarJSON)) { return 0;//nonprimitive container } - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON *{{{paramName}}}VarJSON; cJSON_ArrayForEach({{{paramName}}}VarJSON, {{classname}}localVarJSON) { @@ -388,11 +388,11 @@ end: apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - {{#hasQueryParams}}list_free(localVarQueryParameters);{{/hasQueryParams}} - {{#hasHeaderParams}}list_free(localVarHeaderParameters);{{/hasHeaderParams}} - {{#hasFormParams}}list_free(localVarFormParameters);{{/hasFormParams}} - {{#hasProduces}}list_free(localVarHeaderType);{{/hasProduces}} - {{#hasConsumes}}list_free(localVarContentType);{{/hasConsumes}} + {{#hasQueryParams}}list_freeList(localVarQueryParameters);{{/hasQueryParams}} + {{#hasHeaderParams}}list_freeList(localVarHeaderParameters);{{/hasHeaderParams}} + {{#hasFormParams}}list_freeList(localVarFormParameters);{{/hasFormParams}} + {{#hasProduces}}list_freeList(localVarHeaderType);{{/hasProduces}} + {{#hasConsumes}}list_freeList(localVarContentType);{{/hasConsumes}} free(localVarPath); {{#pathParams}} free(localVarToReplace_{{paramName}}); @@ -526,11 +526,11 @@ end: apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - {{#hasQueryParams}}list_free(localVarQueryParameters);{{/hasQueryParams}} - {{#hasHeaderParams}}list_free(localVarHeaderParameters);{{/hasHeaderParams}} - {{#hasFormParams}}list_free(localVarFormParameters);{{/hasFormParams}} - {{#hasProduces}}list_free(localVarHeaderType);{{/hasProduces}} - {{#hasConsumes}}list_free(localVarContentType);{{/hasConsumes}} + {{#hasQueryParams}}list_freeList(localVarQueryParameters);{{/hasQueryParams}} + {{#hasHeaderParams}}list_freeList(localVarHeaderParameters);{{/hasHeaderParams}} + {{#hasFormParams}}list_freeList(localVarFormParameters);{{/hasFormParams}} + {{#hasProduces}}list_freeList(localVarHeaderType);{{/hasProduces}} + {{#hasConsumes}}list_freeList(localVarContentType);{{/hasConsumes}} free(localVarPath); {{#pathParams}} free(localVarToReplace_{{paramName}}); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache index 38656a5615b..e324c5f966c 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache @@ -74,7 +74,7 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath {{/isOAuth}} {{#isApiKey}} if(apiKeys_{{name}}!= NULL) { - apiClient->apiKeys_{{name}} = list_create(); + apiClient->apiKeys_{{name}} = list_createList(); listEntry_t *listEntry = NULL; list_ForEach(listEntry, apiKeys_{{name}}) { keyValuePair_t *pair = listEntry->data; @@ -126,7 +126,7 @@ void apiClient_free(apiClient_t *apiClient) { } keyValuePair_free(pair); } - list_free(apiClient->apiKeys_{{name}}); + list_freeList(apiClient->apiKeys_{{name}}); } {{/isApiKey}} {{/authMethods}} @@ -530,7 +530,7 @@ void apiClient_invoke(apiClient_t *apiClient, res = curl_easy_perform(handle); - curl_slist_free_all(headers); + curl_slist_freeList_all(headers); free(targetUrl); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache index 13014042f80..ffdb0363e47 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache @@ -42,7 +42,7 @@ int main() { char *exampleUrl2 = malloc(strlen(EXAMPLE_URL_2) + 1); strcpy(exampleUrl2, EXAMPLE_URL_2); - list_t *photoUrls = list_create(); + list_t *photoUrls = list_createList(); list_addElement(photoUrls, exampleUrl1); list_addElement(photoUrls, exampleUrl2); @@ -55,7 +55,7 @@ int main() { strcpy(exampleTag2Name, EXAMPLE_TAG_2_NAME); tag_t *exampleTag2 = tag_create(EXAMPLE_TAG_2_ID, exampleTag2Name); - list_t *tags = list_create(); + list_t *tags = list_createList(); list_addElement(tags, exampleTag1); list_addElement(tags, exampleTag2); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache index 159c02e5976..0f652aa09c0 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache @@ -89,6 +89,6 @@ int main() { list_ForEach(listEntry, elementToReturn) { keyValuePair_free(listEntry->data); } - list_free(elementToReturn); + list_freeList(elementToReturn); } diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache index dfa2e567501..786812158a2 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache @@ -23,7 +23,7 @@ void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { printf("%i\n", *((int *) (listEntry->data))); } -list_t *list_create() { +list_t *list_createList() { list_t *createdList = malloc(sizeof(list_t)); if(createdList == NULL) { // TODO Malloc Failure @@ -88,7 +88,7 @@ void list_iterateThroughListBackward(list_t *list, } } -void list_free(list_t *list) { +void list_freeList(list_t *list) { if(list){ list_iterateThroughListForward(list, listEntry_free, NULL); free(list); @@ -196,5 +196,5 @@ void clear_and_free_string_list(list_t *list) free(list_item); list_item = NULL; } - list_free(list); + list_freeList(list); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache index 4c613214094..96c5832b02b 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache @@ -23,8 +23,8 @@ typedef struct list_t { #define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) -list_t* list_create(); -void list_free(list_t* listToFree); +list_t* List(); +void list_freeListList(list_t* listToFree); void list_addElement(list_t* list, void* dataToAddInList); listEntry_t* list_getElementAt(list_t *list, long indexOfElement); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index 1f28e05e909..18968d2c7c0 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -294,7 +294,7 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { list_ForEach(listEntry, {{classname}}->{{name}}) { free(listEntry->data); } - list_free({{classname}}->{{name}}); + list_freeList({{classname}}->{{name}}); {{classname}}->{{name}} = NULL; } {{/isPrimitiveType}} @@ -303,7 +303,7 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { list_ForEach(listEntry, {{classname}}->{{name}}) { {{complexType}}_free(listEntry->data); } - list_free({{classname}}->{{name}}); + list_freeList({{classname}}->{{name}}); {{classname}}->{{name}} = NULL; } {{/isPrimitiveType}} @@ -316,7 +316,7 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { free (localKeyValue->value); keyValuePair_free(localKeyValue); } - list_free({{classname}}->{{name}}); + list_freeList({{classname}}->{{name}}); {{classname}}->{{name}} = NULL; } {{/isMap}} @@ -699,7 +699,7 @@ fail: if(!cJSON_IsArray({{{name}}})) { goto end;//primitive container } - {{{name}}}List = list_create(); + {{{name}}}List = list_createList(); cJSON_ArrayForEach({{{name}}}_local, {{{name}}}) { @@ -742,7 +742,7 @@ fail: goto end; //nonprimitive container } - {{{name}}}List = list_create(); + {{{name}}}List = list_createList(); cJSON_ArrayForEach({{{name}}}_local_nonprimitive,{{{name}}} ) { @@ -762,7 +762,7 @@ fail: if(!cJSON_IsObject({{{name}}})) { goto end;//primitive map container } - {{{name}}}List = list_create(); + {{{name}}}List = list_createList(); keyValuePair_t *localMapKeyPair; cJSON_ArrayForEach({{{name}}}_local_map, {{{name}}}) { diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache index a9b960e76eb..9239b3762f0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache @@ -299,7 +299,7 @@ static bool {{nickname}}Helper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = {{nickname}}Processor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache index eb47133b853..5966669be45 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache @@ -45,7 +45,7 @@ public: ~RequestInfo() { - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (this->p_chunk) { if((this->p_chunk)->memory) { free((this->p_chunk)->memory); diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index 28aab6c189d..b5d6f2d6180 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -64,7 +64,7 @@ PetAPI_addPet(apiClient_t *apiClient, pet_t * body ) list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -109,7 +109,7 @@ end: - list_free(localVarContentType); + list_freeList(localVarContentType); free(localVarPath); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); @@ -125,7 +125,7 @@ void PetAPI_deletePet(apiClient_t *apiClient, long petId , char * api_key ) { list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = list_create(); + list_t *localVarHeaderParameters = list_createList(); list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = NULL; list_t *localVarContentType = NULL; @@ -185,7 +185,7 @@ end: apiClient->dataReceivedLen = 0; } - list_free(localVarHeaderParameters); + list_freeList(localVarHeaderParameters); @@ -210,10 +210,10 @@ end: list_t* PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) { - list_t *localVarQueryParameters = list_create(); + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -252,7 +252,7 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) if(!cJSON_IsArray(PetAPIlocalVarJSON)) { return 0;//nonprimitive container } - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON *VarJSON; cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) { @@ -272,10 +272,10 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - list_free(localVarQueryParameters); + list_freeList(localVarQueryParameters); - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); return elementToReturn; @@ -292,10 +292,10 @@ end: list_t* PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) { - list_t *localVarQueryParameters = list_create(); + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -334,7 +334,7 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) if(!cJSON_IsArray(PetAPIlocalVarJSON)) { return 0;//nonprimitive container } - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON *VarJSON; cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) { @@ -354,10 +354,10 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - list_free(localVarQueryParameters); + list_freeList(localVarQueryParameters); - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); return elementToReturn; @@ -377,7 +377,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -440,7 +440,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); free(localVarToReplace_petId); @@ -460,7 +460,7 @@ PetAPI_updatePet(apiClient_t *apiClient, pet_t * body ) list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -511,7 +511,7 @@ end: - list_free(localVarContentType); + list_freeList(localVarContentType); free(localVarPath); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); @@ -528,9 +528,9 @@ PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId , char * name , char { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); + list_t *localVarFormParameters = list_createList(); list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -601,9 +601,9 @@ end: } - list_free(localVarFormParameters); + list_freeList(localVarFormParameters); - list_free(localVarContentType); + list_freeList(localVarContentType); free(localVarPath); free(localVarToReplace_petId); if (keyForm_name) { @@ -634,9 +634,9 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = list_create(); + list_t *localVarFormParameters = list_createList(); + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -715,9 +715,9 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata } - list_free(localVarFormParameters); - list_free(localVarHeaderType); - list_free(localVarContentType); + list_freeList(localVarFormParameters); + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); free(localVarPath); free(localVarToReplace_petId); if (keyForm_additionalMetadata) { diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index 80921ad0f07..8086a57a64c 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -86,7 +86,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -114,7 +114,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) //primitive return type not simple cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); cJSON *VarJSON; - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON_ArrayForEach(VarJSON, localVarJSON){ keyValuePair_t *keyPair = keyValuePair_create(strdup(VarJSON->string), cJSON_Print(VarJSON)); list_addElement(elementToReturn, keyPair); @@ -129,7 +129,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); return elementToReturn; @@ -149,7 +149,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -212,7 +212,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); free(localVarToReplace_orderId); @@ -231,7 +231,7 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -286,7 +286,7 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); if (localVarSingleItemJSON_body) { diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index 33e94203928..de32d2eef0d 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -328,7 +328,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -387,7 +387,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); free(localVarToReplace_username); @@ -403,10 +403,10 @@ end: char* UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ) { - list_t *localVarQueryParameters = list_create(); + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -467,10 +467,10 @@ UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - list_free(localVarQueryParameters); + list_freeList(localVarQueryParameters); - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); if(keyQuery_username){ diff --git a/samples/client/petstore/c/include/list.h b/samples/client/petstore/c/include/list.h index 4c613214094..06c1740dc11 100644 --- a/samples/client/petstore/c/include/list.h +++ b/samples/client/petstore/c/include/list.h @@ -23,8 +23,8 @@ typedef struct list_t { #define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) -list_t* list_create(); -void list_free(list_t* listToFree); +list_t* list_creatList(); +void list_freeList(list_t* listToFree); void list_addElement(list_t* list, void* dataToAddInList); listEntry_t* list_getElementAt(list_t *list, long indexOfElement); diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index 73e4f3505f8..a9f9c27ee47 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -62,14 +62,14 @@ void pet_free(pet_t *pet) { list_ForEach(listEntry, pet->photo_urls) { free(listEntry->data); } - list_free(pet->photo_urls); + list_freeList(pet->photo_urls); pet->photo_urls = NULL; } if (pet->tags) { list_ForEach(listEntry, pet->tags) { tag_free(listEntry->data); } - list_free(pet->tags); + list_freeList(pet->tags); pet->tags = NULL; } free(pet); @@ -210,7 +210,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ if(!cJSON_IsArray(photo_urls)) { goto end;//primitive container } - photo_urlsList = list_create(); + photo_urlsList = list_createList(); cJSON_ArrayForEach(photo_urls_local, photo_urls) { @@ -230,7 +230,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ goto end; //nonprimitive container } - tagsList = list_create(); + tagsList = list_createList(); cJSON_ArrayForEach(tags_local_nonprimitive,tags ) { diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index ce2f522cda2..4ecf10c2b8e 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -46,7 +46,7 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath apiClient->progress_data = NULL; apiClient->response_code = 0; if(apiKeys_api_key!= NULL) { - apiClient->apiKeys_api_key = list_create(); + apiClient->apiKeys_api_key = list_createList(); listEntry_t *listEntry = NULL; list_ForEach(listEntry, apiKeys_api_key) { keyValuePair_t *pair = listEntry->data; @@ -80,7 +80,7 @@ void apiClient_free(apiClient_t *apiClient) { } keyValuePair_free(pair); } - list_free(apiClient->apiKeys_api_key); + list_freeList(apiClient->apiKeys_api_key); } if(apiClient->accessToken) { free(apiClient->accessToken); @@ -447,7 +447,7 @@ void apiClient_invoke(apiClient_t *apiClient, res = curl_easy_perform(handle); - curl_slist_free_all(headers); + curl_slist_freeList_all(headers); free(targetUrl); diff --git a/samples/client/petstore/c/src/list.c b/samples/client/petstore/c/src/list.c index dfa2e567501..786812158a2 100644 --- a/samples/client/petstore/c/src/list.c +++ b/samples/client/petstore/c/src/list.c @@ -23,7 +23,7 @@ void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { printf("%i\n", *((int *) (listEntry->data))); } -list_t *list_create() { +list_t *list_createList() { list_t *createdList = malloc(sizeof(list_t)); if(createdList == NULL) { // TODO Malloc Failure @@ -88,7 +88,7 @@ void list_iterateThroughListBackward(list_t *list, } } -void list_free(list_t *list) { +void list_freeList(list_t *list) { if(list){ list_iterateThroughListForward(list, listEntry_free, NULL); free(list); @@ -196,5 +196,5 @@ void clear_and_free_string_list(list_t *list) free(list_item); list_item = NULL; } - list_free(list); + list_freeList(list); } \ No newline at end of file diff --git a/samples/client/petstore/c/unit-test/test_pet.c b/samples/client/petstore/c/unit-test/test_pet.c index ba45422f912..1b4f548729a 100644 --- a/samples/client/petstore/c/unit-test/test_pet.c +++ b/samples/client/petstore/c/unit-test/test_pet.c @@ -27,8 +27,8 @@ pet_t* instantiate_pet(int include_optional) { // false, not to have infinite recursion instantiate_category(0), "doggie", - list_create(), - list_create(), + list_createList(), + list_createList(), openapi_petstore_pet_STATUS_available ); } else { @@ -36,8 +36,8 @@ pet_t* instantiate_pet(int include_optional) { 56, NULL, "doggie", - list_create(), - list_create(), + list_createList(), + list_createList(), openapi_petstore_pet_STATUS_available ); } diff --git a/samples/client/petstore/c/unit-tests/manual-PetAPI.c b/samples/client/petstore/c/unit-tests/manual-PetAPI.c index f82c5353891..3090521dc62 100644 --- a/samples/client/petstore/c/unit-tests/manual-PetAPI.c +++ b/samples/client/petstore/c/unit-tests/manual-PetAPI.c @@ -36,7 +36,7 @@ int main() { char *exampleUrl2 = malloc(strlen(EXAMPLE_URL_2) + 1); strcpy(exampleUrl2, EXAMPLE_URL_2); - list_t *photoUrls = list_create(); + list_t *photoUrls = list_createList(); list_addElement(photoUrls, exampleUrl1); list_addElement(photoUrls, exampleUrl2); @@ -49,7 +49,7 @@ int main() { strcpy(exampleTag2Name, EXAMPLE_TAG_2_NAME); tag_t *exampleTag2 = tag_create(EXAMPLE_TAG_2_ID, exampleTag2Name); - list_t *tags = list_create(); + list_t *tags = list_createList(); list_addElement(tags, exampleTag1); list_addElement(tags, exampleTag2); diff --git a/samples/client/petstore/c/unit-tests/manual-StoreAPI.c b/samples/client/petstore/c/unit-tests/manual-StoreAPI.c index ce29f77b961..c6e3d3bacb4 100644 --- a/samples/client/petstore/c/unit-tests/manual-StoreAPI.c +++ b/samples/client/petstore/c/unit-tests/manual-StoreAPI.c @@ -98,7 +98,7 @@ int main() { free(pair->value); keyValuePair_free(pair); } - list_free(elementToReturn); + list_freeList(elementToReturn); apiClient_free(apiClient5); apiClient_unsetupGlobalEnv(); diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 2f273a21e10..01695962eeb 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -138,7 +138,7 @@ static bool addPetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = addPetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -274,7 +274,7 @@ static bool deletePetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deletePetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -418,7 +418,7 @@ static bool findPetsByStatusHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = findPetsByStatusProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -562,7 +562,7 @@ static bool findPetsByTagsHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = findPetsByTagsProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -714,7 +714,7 @@ static bool getPetByIdHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getPetByIdProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -852,7 +852,7 @@ static bool updatePetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updatePetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -982,7 +982,7 @@ static bool updatePetWithFormHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updatePetWithFormProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -1134,7 +1134,7 @@ static bool uploadFileHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = uploadFileProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/samples/client/petstore/cpp-tizen/src/RequestInfo.h b/samples/client/petstore/cpp-tizen/src/RequestInfo.h index 6424d6c856d..02b1f59df74 100644 --- a/samples/client/petstore/cpp-tizen/src/RequestInfo.h +++ b/samples/client/petstore/cpp-tizen/src/RequestInfo.h @@ -45,7 +45,7 @@ public: ~RequestInfo() { - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (this->p_chunk) { if((this->p_chunk)->memory) { free((this->p_chunk)->memory); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index e107ff84434..0ae59157af1 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -130,7 +130,7 @@ static bool deleteOrderHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deleteOrderProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -254,7 +254,7 @@ static bool getInventoryHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getInventoryProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -406,7 +406,7 @@ static bool getOrderByIdHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getOrderByIdProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -565,7 +565,7 @@ static bool placeOrderHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = placeOrderProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index ab3a7e40964..12b3633f5d4 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -137,7 +137,7 @@ static bool createUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -286,7 +286,7 @@ static bool createUsersWithArrayInputHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUsersWithArrayInputProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -435,7 +435,7 @@ static bool createUsersWithListInputHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUsersWithListInputProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -565,7 +565,7 @@ static bool deleteUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deleteUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -717,7 +717,7 @@ static bool getUserByNameHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getUserByNameProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -866,7 +866,7 @@ static bool loginUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = loginUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -990,7 +990,7 @@ static bool logoutUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = logoutUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -1133,7 +1133,7 @@ static bool updateUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updateUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); From 3ed9a8e53c10510237e7c4a25106f3f3c1f21f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sj=C3=B6blom?= Date: Wed, 12 Jan 2022 17:59:00 +0100 Subject: [PATCH 032/113] Make Kotlin client generate comma separated list for array path params (#11228) --- .../resources/kotlin-client/libraries/jvm-okhttp/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 7817289fa11..d7948cf6a75 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -217,7 +217,7 @@ import {{packageName}}.infrastructure.toMultiValue return RequestConfig( method = RequestMethod.{{httpMethod}}, - path = "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{{paramName}}}"){{/pathParams}}, + path = "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}"${{{paramName}}}"{{/isContainer}}){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders, body = localVariableBody From 69b64ebb0e72f938cece06daca220e486efde24a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 13 Jan 2022 01:26:07 +0800 Subject: [PATCH 033/113] [kotlin][client] add tests for comma separated list in array path params (#11293) * add tests for kotlin-array-simple-string * add new files * remove build fies * clean up --- .github/workflows/samples-kotlin.yaml | 1 + .gitignore | 8 +- bin/configs/kotlin-array-simple-string.yaml | 6 + .../3_0/issue_7199_array_simple_string.yaml | 19 ++ .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 26 ++ .../.openapi-generator/VERSION | 1 + .../kotlin-array-simple-string/README.md | 49 ++++ .../kotlin-array-simple-string/build.gradle | 37 +++ .../docs/DefaultApi.md | 53 ++++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../kotlin-array-simple-string/gradlew | 185 +++++++++++++ .../kotlin-array-simple-string/gradlew.bat | 89 +++++++ .../settings.gradle | 2 + .../openapitools/client/apis/DefaultApi.kt | 116 +++++++++ .../client/infrastructure/ApiAbstractions.kt | 23 ++ .../client/infrastructure/ApiClient.kt | 245 ++++++++++++++++++ .../client/infrastructure/ApiResponse.kt | 43 +++ .../infrastructure/BigDecimalAdapter.kt | 17 ++ .../infrastructure/BigIntegerAdapter.kt | 17 ++ .../client/infrastructure/ByteArrayAdapter.kt | 12 + .../client/infrastructure/Errors.kt | 18 ++ .../client/infrastructure/LocalDateAdapter.kt | 19 ++ .../infrastructure/LocalDateTimeAdapter.kt | 19 ++ .../infrastructure/OffsetDateTimeAdapter.kt | 19 ++ .../client/infrastructure/RequestConfig.kt | 17 ++ .../client/infrastructure/RequestMethod.kt | 8 + .../infrastructure/ResponseExtensions.kt | 24 ++ .../client/infrastructure/Serializer.kt | 23 ++ .../client/infrastructure/URIAdapter.kt | 13 + .../client/infrastructure/UUIDAdapter.kt | 13 + 32 files changed, 1144 insertions(+), 6 deletions(-) create mode 100644 bin/configs/kotlin-array-simple-string.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml create mode 100644 samples/client/petstore/kotlin-array-simple-string/.openapi-generator-ignore create mode 100644 samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-array-simple-string/.openapi-generator/VERSION create mode 100644 samples/client/petstore/kotlin-array-simple-string/README.md create mode 100644 samples/client/petstore/kotlin-array-simple-string/build.gradle create mode 100644 samples/client/petstore/kotlin-array-simple-string/docs/DefaultApi.md create mode 100644 samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/petstore/kotlin-array-simple-string/gradlew create mode 100644 samples/client/petstore/kotlin-array-simple-string/gradlew.bat create mode 100644 samples/client/petstore/kotlin-array-simple-string/settings.gradle create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt create mode 100644 samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index 83d748e9f06..ce20f98a346 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -41,6 +41,7 @@ jobs: - samples/client/petstore/kotlin-string - samples/client/petstore/kotlin-threetenbp - samples/client/petstore/kotlin-uppercase-enum + - samples/client/petstore/kotlin-array-simple-string steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 diff --git a/.gitignore b/.gitignore index 728a1667834..f04e4e087bf 100644 --- a/.gitignore +++ b/.gitignore @@ -201,15 +201,11 @@ samples/server/petstore/aspnetcore/.vs/ effective.pom # kotlin -samples/client/petstore/kotlin/src/main/kotlin/test/ -samples/client/petstore/kotlin-threetenbp/build -samples/client/petstore/kotlin-string/build samples/openapi3/client/petstore/kotlin/build samples/server/petstore/kotlin-server/ktor/build samples/server/petstore/kotlin-springboot/build -samples/client/petstore/kotlin-multiplatform/build/ -samples/client/petstore/kotlin-okhttp3/build/ -\? +samples/client/petstore/kotlin*/src/main/kotlin/test/ +samples/client/petstore/kotlin*/build/ # haskell .stack-work diff --git a/bin/configs/kotlin-array-simple-string.yaml b/bin/configs/kotlin-array-simple-string.yaml new file mode 100644 index 00000000000..68cbd8c42ff --- /dev/null +++ b/bin/configs/kotlin-array-simple-string.yaml @@ -0,0 +1,6 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-array-simple-string +inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-array-simple-string diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml new file mode 100644 index 00000000000..db0ee3463c3 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_7199_array_simple_string.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Demo +paths: + '/{ids}': + get: + parameters: + - name: ids + in: path + required: true + schema: + type: array + items: + type: string + style: simple + responses: + 200: + description: Successful operation diff --git a/samples/client/petstore/kotlin-array-simple-string/.openapi-generator-ignore b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/.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/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES new file mode 100644 index 00000000000..97e668afe5f --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES @@ -0,0 +1,26 @@ +.openapi-generator-ignore +README.md +build.gradle +docs/DefaultApi.md +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt diff --git a/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/README.md b/samples/client/petstore/kotlin-array-simple-string/README.md new file mode 100644 index 00000000000..833e3ab254f --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/README.md @@ -0,0 +1,49 @@ +# org.openapitools.client - Kotlin client library for Demo + +## Requires + +* Kotlin 1.4.30 +* Gradle 6.8.3 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**idsGet**](docs/DefaultApi.md#idsget) | **GET** /{ids} | + + + +## Documentation for Models + + + + +## Documentation for Authorization + +All endpoints do not require authorization. diff --git a/samples/client/petstore/kotlin-array-simple-string/build.gradle b/samples/client/petstore/kotlin-array-simple-string/build.gradle new file mode 100644 index 00000000000..3de8b45b135 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/build.gradle @@ -0,0 +1,37 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '6.8.3' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.5.10' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "com.squareup.moshi:moshi-kotlin:1.12.0" + implementation "com.squareup.moshi:moshi-adapters:1.12.0" + implementation "com.squareup.okhttp3:okhttp:4.9.1" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" +} diff --git a/samples/client/petstore/kotlin-array-simple-string/docs/DefaultApi.md b/samples/client/petstore/kotlin-array-simple-string/docs/DefaultApi.md new file mode 100644 index 00000000000..45b43113f19 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/docs/DefaultApi.md @@ -0,0 +1,53 @@ +# DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**idsGet**](DefaultApi.md#idsGet) | **GET** /{ids} | + + + +# **idsGet** +> idsGet(ids) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +val ids : kotlin.collections.List = // kotlin.collections.List | +try { + apiInstance.idsGet(ids) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#idsGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#idsGet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ids** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0cwPe9z9FAUSD9KC)7(n^lMWuayCfxzy8EZsns%OEblHFSzP=cL6}?J| z0U$H!4S_TVjj<`6dy^2j`V`)mC;cB%* z8{>_%E1^FH!*{>4a7*C1v>~1*@TMcLK{7nEQ!_igZC}ikJ$*<$yHy>7)oy79A~#xE zWavoJOIOC$5b6*q*F_qN1>2#MY)AXVyr$6x4b=$x^*aqF*L?vmj>Mgv+|ITnw_BoW zO?jwHvNy^prH{9$rrik1#fhyU^MpFqF2fYEt(;4`Q&XWOGDH8k6M=%@fics4ajI;st# zCU^r1CK&|jzUhRMv;+W~6N;u<;#DI6cCw-otsc@IsN3MoSD^O`eNflIoR~l4*&-%RBYk@gb^|-JXs&~KuSEmMxB}xSb z@K76cXD=Y|=I&SNC2E+>Zg?R6E%DGCH5J1nU!A|@eX9oS(WPaMm==k2s_ueCqdZw| z&hqHp)47`c{BgwgvY2{xz%OIkY1xDwkw!<0veB#yF4ZKJyabhyyVS`gZepcFIk%e2 zTcrmt2@-8`7i-@5Nz>oQWFuMC_KlroCl(PLSodswHqJ3fn<;gxg9=}~3x_L3P`9Sn zChIf}8vCHvTriz~T2~FamRi?rh?>3bX1j}%bLH+uFX+p&+^aXbOK7clZxdU~6Uxgy z8R=obwO4dL%pmVo*Ktf=lH6hnlz_5k3cG;m8lgaPp~?eD!Yn2kf)tU6PF{kLyn|oI@eQ`F z3IF7~Blqg8-uwUuWZScRKn%c2_}dXB6Dx_&xR*n9M9LXasJhtZdr$vBY!rP{c@=)& z#!?L$2UrkvClwQO>U*fSMs67oSj2mxiJ$t;E|>q%Kh_GzzWWO&3;ufU%2z%ucBU8H z3WIwr$n)cfCXR&>tyB7BcSInK>=ByZA%;cVEJhcg<#6N{aZC4>K41XF>ZgjG`z_u& zGY?;Ad?-sgiOnI`oppF1o1Gurqbi*;#x2>+SSV6|1^G@ooVy@fg?wyf@0Y!UZ4!}nGuLeC^l)6pwkh|oRY`s1Pm$>zZ3u-83T|9 zGaKJIV3_x+u1>cRibsaJpJqhcm%?0-L;2 zitBrdRxNmb0OO2J%Y&Ym(6*`_P3&&5Bw157{o7LFguvxC$4&zTy#U=W*l&(Q2MNO} zfaUwYm{XtILD$3864IA_nn34oVa_g^FRuHL5wdUd)+W-p-iWCKe8m_cMHk+=? zeKX)M?Dt(|{r5t7IenkAXo%&EXIb-i^w+0CX0D=xApC=|Xy(`xy+QG^UyFe z+#J6h_&T5i#sV)hj3D4WN%z;2+jJcZxcI3*CHXGmOF3^)JD5j&wfX)e?-|V0GPuA+ zQFot%aEqGNJJHn$!_}#PaAvQ^{3-Ye7b}rWwrUmX53(|~i0v{}G_sI9uDch_brX&6 zWl5Ndj-AYg(W9CGfQf<6!YmY>Ey)+uYd_JNXH=>|`OH-CDCmcH(0%iD_aLlNHKH z7bcW-^5+QV$jK?R*)wZ>r9t}loM@XN&M-Pw=F#xn(;u3!(3SXXY^@=aoj70;_=QE9 zGghsG3ekq#N||u{4We_25U=y#T*S{4I{++Ku)> zQ!DZW;pVcn>b;&g2;YE#+V`v*Bl&Y-i@X6D*OpNA{G@JAXho&aOk(_j^weW{#3X5Y z%$q_wpb07EYPdmyH(1^09i$ca{O<}7) zRWncXdSPgBE%BM#by!E>tdnc$8RwUJg1*x($6$}ae$e9Knj8gvVZe#bLi!<+&BkFj zg@nOpDneyc+hU9P-;jmOSMN|*H#>^Ez#?;%C3hg_65leSUm;iz)UkW)jX#p)e&S&M z1|a?wDzV5NVnlhRBCd_;F87wp>6c<&nkgvC+!@KGiIqWY4l}=&1w7|r6{oBN8xyzh zG$b#2=RJp_iq6)#t5%yLkKx(0@D=C3w+oiXtSuaQ%I1WIb-eiE$d~!)b@|4XLy!CZ z9p=t=%3ad@Ep+<9003D2KZ5VyP~_n$=;~r&YUg5UZ0KVD&tR1DHy9x)qWtKJp#Kq# zP*8p#W(8JJ_*h_3W}FlvRam?<4Z+-H77^$Lvi+#vmhL9J zJ<1SV45xi;SrO2f=-OB(7#iNA5)x1uNC-yNxUw|!00vcW2PufRm>e~toH;M0Q85MQLWd?3O{i8H+5VkR@l9Dg-ma ze2fZ%>G(u5(k9EHj2L6!;(KZ8%8|*-1V|B#EagbF(rc+5iL_5;Eu)L4Z-V;0HfK4d z*{utLse_rvHZeQ>V5H=f78M3Ntg1BPxFCVD{HbNA6?9*^YIq;B-DJd{Ca2L#)qWP? zvX^NhFmX?CTWw&Ns}lgs;r3i+Bq@y}Ul+U%pzOS0Fcv9~aB(0!>GT0)NO?p=25LjN z2bh>6RhgqD7bQj#k-KOm@JLgMa6>%-ok1WpOe)FS^XOU{c?d5shG(lIn3GiVBxmg`u%-j=)^v&pX1JecJics3&jvPI)mDut52? z3jEA)DM%}BYbxxKrizVYwq?(P&19EXlwD9^-6J+4!}9{ywR9Gk42jjAURAF&EO|~N z)?s>$Da@ikI4|^z0e{r`J8zIs>SpM~Vn^{3fArRu;?+43>lD+^XtUcY1HidJwnR6+ z!;oG2=B6Z_=M%*{z-RaHc(n|1RTKQdNjjV!Pn9lFt^4w|AeN06*j}ZyhqZ^!-=cyGP_ShV1rGxkx8t zB;8`h!S{LD%ot``700d0@Grql(DTt4Awgmi+Yr0@#jbe=2#UkK%rv=OLqF)9D7D1j z!~McAwMYkeaL$~kI~90)5vBhBzWYc3Cj1WI0RS`z000R8-@ET0dA~*r(gSiCJmQMN&4%1D zyVNf0?}sBH8zNbBLn>~(W{d3%@kL_eQ6jEcR{l>C|JK z(R-fA!z|TTRG40|zv}7E@PqCAXP3n`;%|SCQ|ZS%ym$I{`}t3KPL&^l5`3>yah4*6 zifO#{VNz3)?ZL$be;NEaAk9b#{tV?V7 zP|wf5YA*1;s<)9A4~l3BHzG&HH`1xNr#%){4xZ!jq%o=7nN*wMuXlFV{HaiQLJ`5G zBhDi#D(m`Q1pLh@Tq+L;OwuC52RdW7b8}~60WCOK5iYMUad9}7aWBuILb({5=z~YF zt?*Jr5NG+WadM{mDL>GyiByCuR)hd zA=HM?J6l1Xv0Dl+LW@w$OTcEoOda^nFCw*Sy^I@$sSuneMl{4ys)|RY#9&NxW4S)9 zq|%83IpslTLoz~&vTo!Ga@?rj_kw{|k{nv+w&Ku?fyk4Ki4I?);M|5Axm)t+BaE)D zm(`AQ#k^DWrjbuXoJf2{Aj^KT zFb1zMSqxq|vceV+Mf-)$oPflsO$@*A0n0Z!R{&(xh8s}=;t(lIy zv$S8x>m;vQNHuRzoaOo?eiWFe{0;$s`Bc+Osz~}Van${u;g(su`3lJ^TEfo~nERfP z)?aFzpDgnLYiERsKPu|0tq4l2wT)Atr6Qb%m-AUn6HnCue*yWICp7TjW$@sO zm5rm4aTcPQ(rfi7a`xP7cKCFrJD}*&_~xgLyr^-bmsL}y;A5P|al8J3WUoBSjqu%v zxC;mK!g(7r6RRJ852Z~feoC&sD3(6}^5-uLK8o)9{8L_%%rItZK9C){UxB|;G>JbP zsRRtS4-3B*5c+K2kvmgZK8472%l>3cntWUOVHxB|{Ay~aOg5RN;{PJgeVD*H%ac+y!h#wi%o2bF2Ca8IyMyH{>4#{E_8u^@+l-+n=V}Sq?$O z{091@v%Bd*3pk0^2UtiF9Z+(a@wy6 zUdw8J*ze$K#=$48IBi1U%;hmhO>lu!uU;+RS}p&6@rQila7WftH->*A4=5W|Fmtze z)7E}jh@cbmr9iup^i%*(uF%LG&!+Fyl@LFA-}Ca#bxRfDJAiR2dt6644TaYw1Ma79 zt8&DYj31j^5WPNf5P&{)J?WlCe@<3u^78wnd(Ja4^a>{^Tw}W>|Cjt^If|7l^l)^Q zbz|7~CF(k_9~n|h;ysZ+jHzkXf(*O*@5m zLzUmbHp=x!Q|!9NVXyipZ3)^GuIG$k;D)EK!a5=8MFLI_lpf`HPKl=-Ww%z8H_0$j ztJ||IfFG1lE9nmQ0+jPQy zCBdKkjArH@K7jVcMNz);Q(Q^R{d5G?-kk;Uu_IXSyWB)~KGIizZL(^&qF;|1PI7!E zTP`%l)gpX|OFn&)M%txpQ2F!hdA~hX1Cm5)IrdljqzRg!f{mN%G~H1&oqe`5eJCIF zHdD7O;AX-{XEV(a`gBFJ9ews#CVS2y!&>Cm_dm3C8*n3MA*e67(WC?uP@8TXuMroq z{#w$%z@CBIkRM7?}Xib+>hRjy?%G!fiw8! z8(gB+8J~KOU}yO7UGm&1g_MDJ$IXS!`+*b*QW2x)9>K~Y*E&bYMnjl6h!{17_8d!%&9D`a7r&LKZjC<&XOvTRaKJ1 zUY@hl5^R&kZl3lU3njk`3dPzxj$2foOL26r(9zsVF3n_F#v)s5vv3@dgs|lP#eylq62{<-vczqP!RpVBTgI>@O6&sU>W|do17+#OzQ7o5A$ICH z?GqwqnK^n2%LR;$^oZM;)+>$X3s2n}2jZ7CdWIW0lnGK-b#EG01)P@aU`pg}th&J-TrU`tIpb5t((0eu|!u zQz+3ZiOQ^?RxxK4;zs=l8q!-n7X{@jSwK(iqNFiRColuEOg}!7cyZi`iBX4g1pNBj zAPzL?P^Ljhn;1$r8?bc=#n|Ed7wB&oHcw()&*k#SS#h}jO?ZB246EGItsz*;^&tzp zu^YJ0=lwsi`eP_pU8}6JA7MS;9pfD;DsSsLo~ogzMNP70@@;Fm8f0^;>$Z>~}GWRw!W5J3tNX*^2+1f3hz{~rIzJo z6W%J(H!g-eI_J1>0juX$X4Cl6i+3wbc~k146UIX&G22}WE>0ga#WLsn9tY(&29zBvH1$`iWtTe zG2jYl@P!P)eb<5DsR72BdI7-zP&cZNI{7q3e@?N8IKc4DE#UVr->|-ryuJXk^u^>4 z$3wE~=q390;XuOQP~TNoDR?#|NSPJ%sTMInA6*rJ%go|=YjGe!B>z6u$IhgQSwoV* zjy3F2#I>uK{42{&IqP59)Y(1*Z>>#W8rCf4_eVsH)`v!P#^;BgzKDR`ARGEZzkNX+ zJUQu=*-ol=Xqqt5=`=pA@BIn@6a9G8C{c&`i^(i+BxQO9?YZ3iu%$$da&Kb?2kCCo zo7t$UpSFWqmydXf@l3bVJ=%K?SSw)|?srhJ-1ZdFu*5QhL$~-IQS!K1s@XzAtv6*Y zl8@(5BlWYLt1yAWy?rMD&bwze8bC3-GfNH=p zynNFCdxyX?K&G(ZZ)afguQ2|r;XoV^=^(;Cku#qYn4Lus`UeKt6rAlFo_rU`|Rq z&G?~iWMBio<78of-2X(ZYHx~=U0Vz4btyXkctMKdc9UM!vYr~B-(>)(Hc|D zMzkN4!PBg%tZoh+=Gba!0++d193gbMk2&krfDgcbx0jI92cq?FFESVg0D$>F+bil} zY~$)|>1HZsX=5sAZ2WgPB5P=8X#TI+NQ(M~GqyVB53c6IdX=k>Wu@A0Svf5#?uHaF zsYn|koIi3$(%GZ2+G+7Fv^lHTb#5b8sAHSTnL^qWZLM<(1|9|QFw9pnRU{svj}_Al zL)b9>fN{QiA($8peNEJyy`(a{&uh-T4_kdZFIVsKKVM(?05}76EEz?#W za^fiZOAd14IJ4zLX-n7Lq0qlQ^lW8Cvz4UKkV9~P}>sq0?xD3vg+$4vLm~C(+ zM{-3Z#qnZ09bJ>}j?6ry^h+@PfaD7*jZxBEY4)UG&daWb??6)TP+|3#Z&?GL?1i+280CFsE|vIXQbm| zM}Pk!U`U5NsNbyKzkrul-DzwB{X?n3E6?TUHr{M&+R*2%yOiXdW-_2Yd6?38M9Vy^ z*lE%gA{wwoSR~vN0=no}tP2Ul5Gk5M(Xq`$nw#ndFk`tcpd5A=Idue`XZ!FS>Q zG^0w#>P4pPG+*NC9gLP4x2m=cKP}YuS!l^?sHSFftZy{4CoQrb_ z^20(NnG`wAhMI=eq)SsIE~&Gp9Ne0nD4%Xiu|0Fj1UFk?6avDqjdXz{O1nKao*46y zT8~iA%Exu=G#{x=KD;_C&M+Zx4+n`sHT>^>=-1YM;H<72k>$py1?F3#T1*ef9mLZw z5naLQr?n7K;2l+{_uIw*_1nsTn~I|kkCgrn;|G~##hM;9l7Jy$yJfmk+&}W@JeKcF zx@@Woiz8qdi|D%aH3XTx5*wDlbs?dC1_nrFpm^QbG@wM=i2?Zg;$VK!c^Dp8<}BTI zyRhAq@#%2pGV49*Y5_mV4+OICP|%I(dQ7x=6Ob}>EjnB_-_18*xrY?b%-yEDT(wrO z9RY2QT0`_OpGfMObKHV;QLVnrK%mc?$WAdIT`kJQT^n%GuzE7|9@k3ci5fYOh(287 zuIbg!GB3xLg$YN=n)^pHGB0jH+_iIiC=nUcD;G6LuJsjn2VI1cyZx=a?ShCsF==QK z;q~*m&}L<-cb+mDDXzvvrRsybcgQ;Vg21P(uLv5I+eGc7o7tc6`;OA9{soHFOz zT~2?>Ts}gprIX$wRBb4yE>ot<8+*Bv`qbSDv*VtRi|cyWS>)Fjs>fkNOH-+PX&4(~ z&)T8Zam2L6puQl?;5zg9h<}k4#|yH9czHw;1jw-pwBM*O2hUR6yvHATrI%^mvs9q_ z&ccT0>f#eDG<^WG^q@oVqlJrhxH)dcq2cty@l3~|5#UDdExyXUmLQ}f4#;6fI{f^t zDCsgIJ~0`af%YR%Ma5VQq-p21k`vaBu6WE?66+5=XUd%Ay%D$irN>5LhluRWt7 zov-=f>QbMk*G##&DTQyou$s7UqjjW@k6=!I@!k+S{pP8R(2=e@io;N8E`EOB;OGoI zw6Q+{X1_I{OO0HPpBz!X!@`5YQ2)t{+!?M_iH25X(d~-Zx~cXnS9z>u?+If|iNJbx zyFU2d1!ITX64D|lE0Z{dLRqL1Ajj=CCMfC4lD3&mYR_R_VZ>_7_~|<^o*%_&jevU+ zQ4|qzci=0}Jydw|LXLCrOl1_P6Xf@c0$ieK2^7@A9UbF{@V_0p%lqW|L?5k>bVM8|p5v&2g;~r>B8uo<4N+`B zH{J)h;SYiIVx@#jI&p-v3dwL5QNV1oxPr8J%ooezTnLW>i*3Isb49%5i!&ac_dEXv zvXmVUck^QHmyrF8>CGXijC_R-y(Qr{3Zt~EmW)-nC!tiH`wlw5D*W7Pip;T?&j%kX z6DkZX4&}iw>hE(boLyjOoupf6JpvBG8}jIh!!VhnD0>}KSMMo{1#uU6kiFcA04~|7 zVO8eI&x1`g4CZ<2cYUI(n#wz2MtVFHx47yE5eL~8bot~>EHbevSt}LLMQX?odD{Ux zJMnam{d)W4da{l7&y-JrgiU~qY3$~}_F#G7|MxT)e;G{U`In&?`j<5D->}cb{}{T(4DF0BOk-=1195KB-E*o@c?`>y#4=dMtYtSY=&L{!TAjFVcq0y@AH`vH! z$41+u!Ld&}F^COPgL(EE{0X7LY&%D7-(?!kjFF7=qw<;`V{nwWBq<)1QiGJgUc^Vz ztMUlq1bZqKn17|6x6iAHbWc~l1HcmAxr%$Puv!znW)!JiukwIrqQ00|H$Z)OmGG@= zv%A8*4cq}(?qn4rN6o`$Y))(MyXr8R<2S^J+v(wmFmtac!%VOfN?&(8Nr!T@kV`N; z*Q33V3t`^rN&aBiHet)18wy{*wi1=W!B%B-Q6}SCrUl$~Hl{@!95ydml@FK8P=u4s z4e*7gV2s=YxEvskw2Ju!2%{8h01rx-3`NCPc(O zH&J0VH5etNB2KY6k4R@2Wvl^Ck$MoR3=)|SEclT2ccJ!RI9Nuter7u9@;sWf-%um;GfI!=eEIQ2l2p_YWUd{|6EG ze{yO6;lMc>;2tPrsNdi@&1K6(1;|$xe8vLgiouj%QD%gYk`4p{Ktv9|j+!OF-P?@p z;}SV|oIK)iwlBs+`ROXkhd&NK zzo__r!B>tOXpBJMDcv!Mq54P+n4(@dijL^EpO1wdg~q+!DT3lB<>9AANSe!T1XgC=J^)IP0XEZ()_vpu!!3HQyJhwh?r`Ae%Yr~b% zO*NY9t9#qWa@GCPYOF9aron7thfWT`eujS4`t2uG6)~JRTI;f(ZuoRQwjZjp5Pg34 z)rp$)Kr?R+KdJ;IO;pM{$6|2y=k_siqvp%)2||cHTe|b5Ht8&A{wazGNca zX$Ol?H)E_R@SDi~4{d-|8nGFhZPW;Cts1;08TwUvLLv&_2$O6Vt=M)X;g%HUr$&06 zISZb(6)Q3%?;3r~*3~USIg=HcJhFtHhIV(siOwV&QkQe#J%H9&E21!C*d@ln3E@J* zVqRO^<)V^ky-R|%{(9`l-(JXq9J)1r$`uQ8a}$vr9E^nNiI*thK8=&UZ0dsFN_eSl z(q~lnD?EymWLsNa3|1{CRPW60>DSkY9YQ;$4o3W7Ms&@&lv9eH!tk~N&dhqX&>K@} zi1g~GqglxkZ5pEFkllJ)Ta1I^c&Bt6#r(QLQ02yHTaJB~- zCcE=5tmi`UA>@P=1LBfBiqk)HB4t8D?02;9eXj~kVPwv?m{5&!&TFYhu>3=_ zsGmYZ^mo*-j69-42y&Jj0cBLLEulNRZ9vXE)8~mt9C#;tZs;=#M=1*hebkS;7(aGf zcs7zH(I8Eui9UU4L--))yy`&d&$In&VA2?DAEss4LAPCLd>-$i?lpXvn!gu^JJ$(DoUlc6wE98VLZ*z`QGQov5l4Fm_h?V-;mHLYDVOwKz7>e4+%AzeO>P6v}ndPW| zM>m#6Tnp7K?0mbK=>gV}=@k*0Mr_PVAgGMu$j+pWxzq4MAa&jpCDU&-5eH27Iz>m^ zax1?*HhG%pJ((tkR(V(O(L%7v7L%!_X->IjS3H5kuXQT2!ow(;%FDE>16&3r){!ex zhf==oJ!}YU89C9@mfDq!P3S4yx$aGB?rbtVH?sHpg?J5C->!_FHM%Hl3#D4eplxzQ zRA+<@LD%LKSkTk2NyWCg7u=$%F#;SIL44~S_OGR}JqX}X+=bc@swpiClB`Zbz|f!4 z7Ysah7OkR8liXfI`}IIwtEoL}(URrGe;IM8%{>b1SsqXh)~w}P>yiFRaE>}rEnNkT z!HXZUtxUp1NmFm)Dm@-{FI^aRQqpSkz}ZSyKR%Y}YHNzBk)ZIp} zMtS=aMvkgWKm9&oTcU0?S|L~CDqA+sHpOxwnswF-fEG)cXCzUR?ps@tZa$=O)=L+5 zf%m58cq8g_o}3?Bhh+c!w4(7AjxwQ3>WnVi<{{38g7yFboo>q|+7qs<$8CPXUFAN< zG&}BHbbyQ5n|qqSr?U~GY{@GJ{(Jny{bMaOG{|IkUj7tj^9pa9|FB_<+KHLxSxR;@ zHpS$4V)PP+tx}22fWx(Ku9y+}Ap;VZqD0AZW4gCDTPCG=zgJmF{|x;(rvdM|2|9a}cex6xrMkERnkE;}jvU-kmzd%_J50$M`lIPCKf+^*zL=@LW`1SaEc%=m zQ+lT06Gw+wVwvQ9fZ~#qd430v2HndFsBa9WjD0P}K(rZYdAt^5WQIvb%D^Q|pkVE^ zte$&#~zmULFACGfS#g=2OLOnIf2Of-k!(BIHjs77nr!5Q1*I9 z1%?=~#Oss!rV~?-6Gm~BWJiA4mJ5TY&iPm_$)H1_rTltuU1F3I(qTQ^U$S>%$l z)Wx1}R?ij0idp@8w-p!Oz{&*W;v*IA;JFHA9%nUvVDy7Q8woheC#|8QuDZb-L_5@R zOqHwrh|mVL9b=+$nJxM`3eE{O$sCt$UK^2@L$R(r^-_+z?lOo+me-VW=Zw z-Bn>$4ovfWd%SPY`ab-u9{INc*k2h+yH%toDHIyqQ zO68=u`N}RIIs7lsn1D){)~%>ByF<>i@qFb<-axvu(Z+6t7v<^z&gm9McRB~BIaDn$ z#xSGT!rzgad8o>~kyj#h1?7g96tOcCJniQ+*#=b7wPio>|6a1Z?_(TS{)KrPe}(8j z!#&A=k(&Pj^F;r)CI=Z{LVu>uj!_W1q4b`N1}E(i%;BWjbEcnD=mv$FL$l?zS6bW!{$7j1GR5ocn94P2u{ z70tAAcpqtQo<@cXw~@i-@6B23;317|l~S>CB?hR5qJ%J3EFgyBdJd^fHZu7AzHF(BQ!tyAz^L0`X z23S4Fe{2X$W0$zu9gm%rg~A>ijaE#GlYlrF9$ds^QtaszE#4M(OLVP2O-;XdT(XIC zatwzF*)1c+t~c{L=fMG8Z=k5lv>U0;C{caN1NItnuSMp)6G3mbahu>E#sj&oy94KC zpH}8oEw{G@N3pvHhp{^-YaZeH;K+T_1AUv;IKD<=mv^&Ueegrb!yf`4VlRl$M?wsl zZyFol(2|_QM`e_2lYSABpKR{{NlxlDSYQNkS;J66aT#MSiTx~;tUmvs-b*CrR4w=f z8+0;*th6kfZ3|5!Icx3RV11sp=?`0Jy3Fs0N4GZQMN=8HmT6%x9@{Dza)k}UwL6JT zHRDh;%!XwXr6yuuy`4;Xsn0zlR$k%r%9abS1;_v?`HX_hI|+EibVnlyE@3aL5vhQq zlIG?tN^w@0(v9M*&L+{_+RQZw=o|&BRPGB>e5=ys7H`nc8nx)|-g;s7mRc7hg{GJC zAe^vCIJhajmm7C6g! zL&!WAQ~5d_5)00?w_*|*H>3$loHrvFbitw#WvLB!JASO?#5Ig5$Ys10n>e4|3d;tS zELJ0|R4n3Az(Fl3-r^QiV_C;)lQ1_CW{5bKS15U|E9?ZgLec@%kXr84>5jV2a5v=w z?pB1GPdxD$IQL4)G||B_lI+A=08MUFFR4MxfGOu07vfIm+j=z9tp~5i_6jb`tR>qV z$#`=BQ*jpCjm$F0+F)L%xRlnS%#&gro6PiRfu^l!EVan|r3y}AHJQOORGx4~ z&<)3=K-tx518DZyp%|!EqpU!+X3Et7n2AaC5(AtrkW>_57i}$eqs$rupubg0a1+WO zGHZKLN2L0D;ab%{_S1Plm|hx8R?O14*w*f&2&bB050n!R2by zw!@XOQx$SqZ5I<(Qu$V6g>o#A!JVwErWv#(Pjx=KeS0@hxr4?13zj#oWwPS(7Ro|v z>Mp@Kmxo79q|}!5qtX2-O@U&&@6s~!I&)1WQIl?lTnh6UdKT_1R640S4~f=_xoN3- zI+O)$R@RjV$F=>Ti7BlnG1-cFKCC(t|Qjm{SalS~V-tX#+2ekRhwmN zZr`8{QF6y~Z!D|{=1*2D-JUa<(1Z=;!Ei!KiRNH?o{p5o3crFF=_pX9O-YyJchr$~ zRC`+G+8kx~fD2k*ZIiiIGR<8r&M@3H?%JVOfE>)})7ScOd&?OjgAGT@WVNSCZ8N(p zuQG~76GE3%(%h1*vUXg$vH{ua0b`sQ4f0*y=u~lgyb^!#CcPJa2mkSEHGLsnO^kb$ zru5_l#nu=Y{rSMWiYx?nO{8I!gH+?wEj~UM?IrG}E|bRIBUM>UlY<`T1EHpRr36vv zBi&dG8oxS|J$!zoaq{+JpJy+O^W(nt*|#g32bd&K^w-t>!Vu9N!k9eA8r!Xc{utY> zg9aZ(D2E0gL#W0MdjwES-7~Wa8iubPrd?8-$C4BP?*wok&O8+ykOx{P=Izx+G~hM8 z*9?BYz!T8~dzcZr#ux8kS7u7r@A#DogBH8km8Ry4slyie^n|GrTbO|cLhpqgMdsjX zJ_LdmM#I&4LqqsOUIXK8gW;V0B(7^$y#h3h>J0k^WJfAMeYek%Y-Dcb_+0zPJez!GM zAmJ1u;*rK=FNM0Nf}Y!!P9c4)HIkMnq^b;JFd!S3?_Qi2G#LIQ)TF|iHl~WKK6JmK zbv7rPE6VkYr_%_BT}CK8h=?%pk@3cz(UrZ{@h40%XgThP*-Oeo`T0eq9 zA8BnWZKzCy5e&&_GEsU4*;_k}(8l_&al5K-V*BFM=O~;MgRkYsOs%9eOY6s6AtE*<7GQAR2ulC3RAJrG_P1iQK5Z~&B z&f8X<>yJV6)oDGIlS$Y*D^Rj(cszTy5c81a5IwBr`BtnC6_e`ArI8CaTX_%rx7;cn zR-0?J_LFg*?(#n~G8cXut(1nVF0Oka$A$1FGcERU<^ggx;p@CZc?3UB41RY+wLS`LWFNSs~YP zuw1@DNN3lTd|jDL7gjBsd9}wIw}4xT2+8dBQzI00m<@?c2L%>}QLfK5%r!a-iII`p zX@`VEUH)uj^$;7jVUYdADQ2k*!1O3WdfgF?OMtUXNpQ1}QINamBTKDuv19^{$`8A1 zeq%q*O0mi@(%sZU>Xdb0Ru96CFqk9-L3pzLVsMQ`Xpa~N6CR{9Rm2)A|CI21L(%GW zh&)Y$BNHa=FD+=mBw3{qTgw)j0b!Eahs!rZnpu)z!!E$*eXE~##yaXz`KE5(nQM`s zD!$vW9XH)iMxu9R>r$VlLk9oIR%HxpUiW=BK@4U)|1WNQ=mz9a z^!KkO=>GaJ!GBXm{KJj^;kh-MkUlEQ%lza`-G&}C5y1>La1sR6hT=d*NeCnuK%_LV zOXt$}iP6(YJKc9j-Fxq~*ItVUqljQ8?oaysB-EYtFQp9oxZ|5m0^Hq(qV!S+hq#g( z?|i*H2MIr^Kxgz+3vIljQ*Feejy6S4v~jKEPTF~Qhq!(ms5>NGtRgO5vfPPc4Z^AM zTj!`5xEreIN)vaNxa|q6qWdg>+T`Ol0Uz)ckXBXEGvPNEL3R8hB3=C5`@=SYgAju1 z!)UBr{2~=~xa{b8>x2@C7weRAEuatC)3pkRhT#pMPTpSbA|tan%U7NGMvzmF?c!V8 z=pEWxbdXbTAGtWTyI?Fml%lEr-^AE}w#l(<7OIw;ctw}imYax&vR4UYNJZK6P7ZOd zP87XfhnUHxCUHhM@b*NbTi#(-8|wcv%3BGNs#zRCVV(W?1Qj6^PPQa<{yaBwZ`+<`w|;rqUY_C z&AeyKwwf*q#OW-F()lir=T^<^wjK65Lif$puuU5+tk$;e_EJ;Lu+pH>=-8=PDhkBg z8cWt%@$Sc#C6F$Vd+0507;{OOyT7Hs%nKS88q-W!$f~9*WGBpHGgNp}=C*7!RiZ5s zn1L_DbKF@B8kwhDiLKRB@lsXVVLK|ph=w%_`#owlf@s@V(pa`GY$8h%;-#h@TsO|Y8V=n@*!Rog7<7Cid%apR|x zOjhHCyfbIt%+*PCveTEcuiDi%Wx;O;+K=W?OFUV%)%~6;gl?<0%)?snDDqIvkHF{ zyI02)+lI9ov42^hL>ZRrh*HhjF9B$A@=H94iaBESBF=eC_KT$8A@uB^6$~o?3Wm5t1OIaqF^~><2?4e3c&)@wKn9bD? zoeCs;H>b8DL^F&>Xw-xjZEUFFTv>JD^O#1E#)CMBaG4DX9bD(Wtc8Rzq}9soQ8`jf zeSnHOL}<+WVSKp4kkq&?SbETjq6yr@4%SAqOG=9E(3YeLG9dtV+8vmzq+6PFPk{L; z(&d++iu=^F%b+ea$i2UeTC{R*0Isk;vFK!no<;L+(`y`3&H-~VTdKROkdyowo1iqR zbVW(3`+(PQ2>TKY>N!jGmGo7oeoB8O|P_!Ic@ zZ^;3dnuXo;WJ?S+)%P>{Hcg!Jz#2SI(s&dY4QAy_vRlmOh)QHvs_7c&zkJCmJGVvV zX;Mtb>QE+xp`KyciG$Cn*0?AK%-a|=o!+7x&&yzHQOS>8=B*R=niSnta^Pxp1`=md z#;$pS$4WCT?mbiCYU?FcHGZ#)kHVJTTBt^%XE(Q};aaO=Zik0UgLcc0I(tUpt(>|& zcxB_|fxCF7>&~5eJ=Dpn&5Aj{A^cV^^}(7w#p;HG&Q)EaN~~EqrE1qKrMAc&WXIE;>@<&)5;gD2?={Xf@Mvn@OJKw=8Mgn z!JUFMwD+s==JpjhroT&d{$kQAy%+d`a*XxDEVxy3`NHzmITrE`o!;5ClXNPb4t*8P zzAivdr{j_v!=9!^?T3y?gzmqDWX6mkzhIzJ-3S{T5bcCFMr&RPDryMcdwbBuZbsgN zGrp@^i?rcfN7v0NKGzDPGE#4yszxu=I_`MI%Z|10nFjU-UjQXXA?k8Pk|OE<(?ae) zE%vG#eZAlj*E7_3dx#Zz4kMLj>H^;}33UAankJiDy5ZvEhrjr`!9eMD8COp}U*hP+ zF}KIYx@pkccIgyxFm#LNw~G&`;o&5)2`5aogs`1~7cMZQ7zj!%L4E`2yzlQN6REX20&O<9 zKV6fyr)TScJPPzNTC2gL+0x#=u>(({{D7j)c-%tvqls3#Y?Z1m zV5WUE)zdJ{$p>yX;^P!UcXP?UD~YM;IRa#Rs5~l+*$&nO(;Ers`G=0D!twR(0GF@c zHl9E5DQI}Oz74n zfKP>&$q0($T4y$6w(p=ERAFh+>n%iaeRA%!T%<^+pg?M)@ucY<&59$x9M#n+V&>}=nO9wCV{O~lg&v#+jcUj(tQ z`0u1YH)-`U$15a{pBkGyPL0THv1P|4e@pf@3IBZS4dVJPo#H>pWq%Lr0YS-SeWash z8R7=jb28KPMI|_lo#GEO|5B?N_e``H*23{~a!AmUJ+fb4HX-%QI@lSEUxKlGV7z7Q zSKw@-TR>@1RL%w{x}dW#k1NgW+q4yt2Xf1J62Bx*O^WG8OJ|FqI4&@d3_o8Id@*)4 zYrk=>@!wv~mh7YWv*bZhxqSmFh2Xq)o=m;%n$I?GSz49l1$xRpPu_^N(vZ>*>Z<04 z2+rP70oM=NDysd!@fQdM2OcyT?3T^Eb@lIC-UG=Bw{BjQ&P`KCv$AcJ;?`vdZ4){d z&gkoUK{$!$$K`3*O-jyM1~p-7T*qb)Ys>Myt^;#1&a%O@x8A+E>! zY8=eD`ZG)LVagDLBeHg>=atOG?Kr%h4B%E6m@J^C+U|y)XX@f z8oyJDW|9g=<#f<{JRr{y#~euMnv)`7j=%cHWLc}ngjq~7k**6%4u>Px&W%4D94(r* z+akunK}O0DC2A%Xo9jyF;DobX?!1I(7%}@7F>i%&nk*LMO)bMGg2N+1iqtg+r(70q zF5{Msgsm5GS7DT`kBsjMvOrkx&|EU!{{~gL4d2MWrAT=KBQ-^zQCUq{5PD1orxlIL zq;CvlWx#f1NWvh`hg011I%?T_s!e38l*lWVt|~z-PO4~~1g)SrJ|>*tXh=QfXT)%( z+ex+inPvD&O4Ur;JGz>$sUOnWdpSLcm1X%aQDw4{dB!cnj`^muI$CJ2%p&-kULVCE z>$eMR36kN$wCPR+OFDM3-U(VOrp9k3)lI&YVFqd;Kpz~K)@Fa&FRw}L(SoD z9B4a+hQzZT-BnVltst&=kq6Y(f^S4hIGNKYBgMxGJ^;2yrO}P3;r)(-I-CZ)26Y6? z&rzHI_1GCvGkgy-t1E;r^3Le30|%$ebDRu2+gdLG)r=A~Qz`}~&L@aGJ{}vVs_GE* zVUjFnzHiXfKQbpv&bR&}l2bzIjAooB)=-XNcYmrGmBh(&iu@o!^hn0^#}m2yZZUK8 zufVm7Gq0y`Mj;9b>`c?&PZkU0j4>IL=UL&-Lp3j&47B5pAW4JceG{!XCA)kT<%2nqCxj<)uy6XR_uws~>_MEKPOpAQ!H zkn>FKh)<9DwwS*|Y(q?$^N!6(51O0 z^JM~Ax{AI1Oj$fs-S5d4T7Z_i1?{%0SsIuQ&r8#(JA=2iLcTN+?>wOL532%&dMYkT z*T5xepC+V6zxhS@vNbMoi|i)=rpli@R9~P!39tWbSSb904ekv7D#quKbgFEMTb48P zuq(VJ+&L8aWU(_FCD$3^uD!YM%O^K(dvy~Wm2hUuh6bD|#(I39Xt>N1Y{ZqXL`Fg6 zKQ?T2htHN!(Bx;tV2bfTtIj7e)liN-29s1kew>v(D^@)#v;}C4-G=7x#;-dM4yRWm zyY`cS21ulzMK{PoaQ6xChEZ}o_#}X-o}<&0)$1#3we?+QeLt;aVCjeA)hn!}UaKt< zat1fHEx13y-rXNMvpUUmCVzocPmN~-Y4(YJvQ#db)4|%B!rBsgAe+*yor~}FrNH08 z3V!97S}D7d$zbSD{$z;@IYMxM6aHdypIuS*pr_U6;#Y!_?0i|&yU*@16l z*dcMqDQgfNBf}?quiu4e>H)yTVfsp#f+Du0@=Kc41QockXkCkvu>FBd6Q+@FL!(Yx z2`YuX#eMEiLEDhp+9uFqME_E^faV&~9qjBHJkIp~%$x^bN=N)K@kvSVEMdDuzA0sn z88CBG?`RX1@#hQNd`o^V{37)!w|nA)QfiYBE^m=yQKv-fQF+UCMcuEe1d4BH7$?>b zJl-r9@0^Ie=)guO1vOd=i$_4sz>y3x^R7n4ED!5oXL3@5**h(xr%Hv)_gILarO46q+MaDOF%ChaymKoI6JU5Pg;7#2n9-18|S1;AK+ zgsn6;k6-%!QD>D?cFy}8F;r@z8H9xN1jsOBw2vQONVqBVEbkiNUqgw~*!^##ht>w0 zUOykwH=$LwX2j&nLy=@{hr)2O&-wm-NyjW7n~Zs9UlH;P7iP3 zI}S(r0YFVYacnKH(+{*)Tbw)@;6>%=&Th=+Z6NHo_tR|JCI8TJiXv2N7ei7M^Q+RM z?9o`meH$5Yi;@9XaNR#jIK^&{N|DYNNbtdb)XW1Lv2k{E>;?F`#Pq|&_;gm~&~Zc9 zf+6ZE%{x4|{YdtE?a^gKyzr}dA>OxQv+pq|@IXL%WS0CiX!V zm$fCePA%lU{%pTKD7|5NJHeXg=I0jL@$tOF@K*MI$)f?om)D63K*M|r`gb9edD1~Y zc|w7N)Y%do7=0{RC|AziW7#am$)9jciRJ?IWl9PE{G3U+$%FcyKs_0Cgq`=K3@ttV z9g;M!3z~f_?P%y3-ph%vBMeS@p7P&Ea8M@97+%XEj*(1E6vHj==d zjsoviB>j^$_^OI_DEPvFkVo(BGRo%cJeD){6Uckei=~1}>sp299|IRjhXe)%?uP0I zF5+>?0#Ye}T^Y$u_rc4=lPcq4K^D(TZG-w30-YiEM=dcK+4#o*>lJ8&JLi+3UcpZk z!^?95S^C0ja^jwP`|{<+3cBVog$(mRdQmadS+Vh~z zS@|P}=|z3P6uS+&@QsMp0no9Od&27O&14zHXGAOEy zh~OKpymK5C%;LLb467@KgIiVwYbYd6wFxI{0-~MOGfTq$nBTB!{SrWmL9Hs}C&l&l#m?s*{tA?BHS4mVKHAVMqm63H<|c5n0~k)-kbg zXidai&9ZUy0~WFYYKT;oe~rytRk?)r8bptITsWj(@HLI;@=v5|XUnSls7$uaxFRL+ zRVMGuL3w}NbV1`^=Pw*0?>bm8+xfeY(1PikW*PB>>Tq(FR`91N0c2&>lL2sZo5=VD zQY{>7dh_TX98L2)n{2OV=T10~*YzX27i2Q7W86M4$?gZIXZaBq#sA*{PH8){|GUi;oM>e?ua7eF4WFuFYZSG| zze?srg|5Ti8Og{O zeFxuw9!U+zhyk?@w zjsA6(oKD=Ka;A>Ca)oPORxK+kxH#O@zhC!!XS4@=swnuMk>t+JmLmFiE^1aX3f<)D@`%K0FGK^gg1a1j>zi z2KhV>sjU7AX3F$SEqrXSC}fRx64GDoc%!u2Yag68Lw@w9v;xOONf@o)Lc|Uh3<21ctTYu-mFZuHk*+R{GjXHIGq3p)tFtQp%TYqD=j1&y)>@zxoxUJ!G@ zgI0XKmP6MNzw>nRxK$-Gbzs}dyfFzt>#5;f6oR27ql!%+{tr+(`(>%51|k`ML} zY4eE)Lxq|JMas(;JibNQds1bUB&r}ydMQXBY4x(^&fY_&LlQC)3hylc$~8&~|06-D z#T+%66rYbHX%^KuqJED_wuGB+=h`nWA!>1n0)3wZrBG3%`b^Ozv6__dNa@%V14|!D zQ?o$z5u0^8`giv%qE!BzZ!3j;BlDlJDk)h@9{nSQeEk!z9RGW) z${RSF3phEM*ce*>Xdp}585vj$|40=&S{S-GTiE?Op*vY&Lvr9}BO$XWy80IF+6@%n z5*2ueT_g@ofP#u5pxb7n*fv^Xtt7&?SRc{*2Ka-*!BuOpf}neHGCiHy$@Ka1^Dint z;DkmIL$-e)rj4o2WQV%Gy;Xg(_Bh#qeOsTM2f@KEe~4kJ8kNLQ+;(!j^bgJMcNhvklP5Z6I+9Fq@c&D~8Fb-4rmDT!MB5QC{Dsb;BharP*O;SF4& zc$wj-7Oep7#$WZN!1nznc@Vb<_Dn%ga-O#J(l=OGB`dy=Sy&$(5-n3zzu%d7E#^8`T@}V+5B;PP8J14#4cCPw-SQTdGa2gWL0*zKM z#DfSXs_iWOMt)0*+Y>Lkd=LlyoHjublNLefhKBv@JoC>P7N1_#> zv=mLWe96%EY;!ZGSQDbZWb#;tzqAGgx~uk+-$+2_8U`!ypbwXl z^2E-FkM1?lY@yt8=J3%QK+xaZ6ok=-y%=KXCD^0r!5vUneW>95PzCkOPO*t}p$;-> ze5j-BLT_;)cZQzR2CEsm@rU7GZfFtdp*a|g4wDr%8?2QkIGasRfDWT-Dvy*U{?IHT z*}wGnzdlSptl#ZF^sf)KT|BJs&kLG91^A6ls{CzFprZ6-Y!V0Xysh%9p%iMd7HLsS zN+^Un$tDV)T@i!v?3o0Fsx2qI(AX_$dDkBzQ@fRM%n zRXk6hb9Py#JXUs+7)w@eo;g%QQ95Yq!K_d=z{0dGS+pToEI6=Bo8+{k$7&Z zo4>PH(`ce8E-Ps&uv`NQ;U$%t;w~|@E3WVOCi~R4oj5wP?%<*1C%}Jq%a^q~T7u>K zML5AKfQDv6>PuT`{SrKHRAF+^&edg6+5R_#H?Lz3iGoWo#PCEd0DS;)2U({{X#zU^ zw_xv{4x7|t!S)>44J;KfA|DC?;uQ($l+5Vp7oeqf7{GBF9356nx|&B~gs+@N^gSdd zvb*>&W)|u#F{Z_b`f#GVtQ`pYv3#||N{xj1NgB<#=Odt6{eB%#9RLt5v zIi|0u70`#ai}9fJjKv7dE!9ZrOIX!3{$z_K5FBd-Kp-&e4(J$LD-)NMTp^_pB`RT; zftVVlK2g@+1Ahv2$D){@Y#cL#dUj9*&%#6 zd2m9{1NYp>)6=oAvqdCn5#cx{AJ%S8skUgMglu2*IAtd+z1>B&`MuEAS(D(<6X#Lj z?f4CFx$)M&$=7*>9v1ER4b6!SIz-m0e{o0BfkySREchp?WdVPpQCh!q$t>?rL!&Jg zd#heM;&~A}VEm8Dvy&P|J*eAV&w!&Nx6HFV&B8jJFVTmgLaswn!cx$&%JbTsloz!3 zMEz1d`k==`Ueub_JAy_&`!ogbwx27^ZXgFNAbx=g_I~5nO^r)}&myw~+yY*cJl4$I znNJ32M&K=0(2Dj_>@39`3=FX!v3nZHno_@q^!y}%(yw0PqOo=);6Y@&ylVe>nMOZ~ zd>j#QQSBn3oaWd;qy$&5(5H$Ayi)0haAYO6TH>FR?rhqHmNOO+(})NB zLI@B@v0)eq!ug`>G<@htRlp3n!EpU|n+G+AvXFrWSUsLMBfL*ZB`CRsIVHNTR&b?K zxBgsN0BjfB>UVcJ|x%=-zb%OV7lmZc& zxiupadZVF7)6QuhoY;;FK2b*qL0J-Rn-8!X4ZY$-ZSUXV5DFd7`T41c(#lAeLMoeT z4%g655v@7AqT!i@)Edt5JMbN(=Q-6{=L4iG8RA%}w;&pKmtWvI4?G9pVRp|RTw`g0 zD5c12B&A2&P6Ng~8WM2eIW=wxd?r7A*N+&!Be7PX3s|7~z=APxm=A?5 zt>xB4WG|*Td@VX{Rs)PV0|yK`oI3^xn(4c_j&vgxk_Y3o(-`_5o`V zRTghg6%l@(qodXN;dB#+OKJEEvhfcnc#BeO2|E(5df-!fKDZ!%9!^BJ_4)9P+9Dq5 zK1=(v?KmIp34r?z{NEWnLB3Px{XYwy-akun4F7xTRr2^zeYW{gcK9)>aJDdU5;w5@ zak=<+-PLH-|04pelTb%ULpuuuJC7DgyT@D|p{!V!0v3KpDnRjANN12q6SUR3mb9<- z>2r~IApQGhstZ!3*?5V z8#)hJ0TdZg0M-BK#nGFP>$i=qk82DO z7h;Ft!D5E15OgW)&%lej*?^1~2=*Z5$2VX>V{x8SC+{i10BbtUk9@I#Vi&hX)q
Q!LwySI{Bnv%Sm)yh{^sSVJ8&h_D-BJ_YZe5eCaAWU9b$O2c z$T|{vWVRtOL!xC0DTc(Qbe`ItNtt5hr<)VijD0{U;T#bUEp381_y`%ZIav?kuYG{iyYdEBPW=*xNSc;Rlt6~F4M`5G+VtOjc z*0qGzCb@gME5udTjJA-9O<&TWd~}ysBd(eVT1-H82-doyH9RST)|+Pb{o*;$j9Tjs zhU!IlsPsj8=(x3bAKJTopW3^6AKROHR^7wZ185wJGVhA~hEc|LP;k7NEz-@4p5o}F z`AD6naG3(n=NF9HTH81=F+Q|JOz$7wm9I<+#BSmB@o_cLt2GkW9|?7mM;r!JZp89l zbo!Hp8=n!XH1{GwaDU+k)pGp`C|cXkCU5%vcH)+v@0eK>%7gWxmuMu9YLlChA|_D@ zi#5zovN_!a-0?~pUV-Rj*1P)KwdU-LguR>YM&*Nen+ln8Q$?WFCJg%DY%K}2!!1FE zDv-A%Cbwo^p(lzac&_TZ-l#9kq`mhLcY3h9ZTUVCM(Ad&=EriQY5{jJv<5K&g|*Lk zgV%ILnf1%8V2B0E&;Sp4sYbYOvvMebLwYwzkRQ#F8GpTQq#uv=J`uaSJ34OWITeSGo6+-8Xw znCk*n{kdDEi)Hi&u^)~cs@iyCkFWB2SWZU|Uc%^43ZIZQ-vWNExCCtDWjqHs;;tWf$v{}0{p0Rvxkq``)*>+Akq%|Na zA`@~-Vfe|+(AIlqru+7Ceh4nsVmO9p9jc8}HX^W&ViBDXT+uXbT#R#idPn&L>+#b6 zflC-4C5-X;kUnR~L>PSLh*gvL68}RBsu#2l`s_9KjUWRhiqF`j)`y`2`YU(>3bdBj z?>iyjEhe-~$^I5!nn%B6Wh+I`FvLNvauve~eX<+Ipl&04 zT}};W&1a3%W?dJ2=N#0t?e+aK+%t}5q%jSLvp3jZ%?&F}nOOWr>+{GFIa%wO_2`et z=JzoRR~}iKuuR+azPI8;Gf9)z3kyA4EIOSl!sRR$DlW}0>&?GbgPojmjmnln;cTqCt=ADbE zZ8GAnoM+S1(5$i8^O4t`ue;vO4i}z0wz-QEIVe5_u03;}-!G1NyY8;h^}y;tzY}i5 zqQr#Ur3Fy8sSa$Q0ys+f`!`+>9WbvU_I`Sj;$4{S>O3?#inLHCrtLy~!s#WXV=oVP zeE93*Nc`PBi4q@%Ao$x4lw9vLHM!6mn3-b_cebF|n-2vt-zYVF_&sDE--J-P;2WHo z+@n2areE0o$LjvjlV2X7ZU@j+`{*8zq`JR3gKF#EW|#+{nMyo-a>nFFTg&vhyT=b} zDa8+v0(Dgx0yRL@ZXOYIlVSZ0|MFizy0VPW8;AfA5|pe!#j zX}Py^8fl5SyS4g1WSKKtnyP+_PoOwMMwu`(i@Z)diJp~U54*-miOchy7Z35eL>^M z4p<-aIxH4VUZgS783@H%M7P9hX>t{|RU7$n4T(brCG#h9e9p! z+o`i;EGGq3&pF;~5V~eBD}lC)>if$w%Vf}AFxGqO88|ApfHf&Bvu+xdG)@vuF}Yvk z)o;~k-%+0K0g+L`Wala!$=ZV|z$e%>f0%XoLib%)!R^RoS+{!#X?h-6uu zF&&KxORdZU&EwQFITIRLo(7TA3W}y6X{?Y%y2j0It!ekU#<)$qghZtpcS>L3uh`Uj z7GY;6f$9qKynP#oS3$$a{p^{D+0oJQ71`1?OAn_m8)UGZmj3l*ZI)`V-a>MKGGFG< z&^jg#Ok%(hhm>hSrZ5;Qga4u(?^i>GiW_j9%_7M>j(^|Om$#{k+^*ULnEgzW_1gCICtAD^WpC`A z{9&DXkG#01Xo)U$OC(L5Y$DQ|Q4C6CjUKk1UkPj$nXH##J{c8e#K|&{mA*;b$r0E4 zUNo0jthwA(c&N1l=PEe8Rw_8cEl|-eya9z&H3#n`B$t#+aJ03RFMzrV@gowbe8v(c zIFM60^0&lCFO10NU4w@|61xiZ4CVXeaKjd;d?sv52XM*lS8XiVjgWpRB;&U_C0g+`6B5V&w|O6B*_q zsATxL!M}+$He)1eOWECce#eS@2n^xhlB4<_Nn?yCVEQWDs(r`|@2GqLe<#(|&P0U? z$7V5IgpWf09uIf_RazRwC?qEqRaHyL?iiS05UiGesJy%^>-C{{ypTBI&B0-iUYhk> zIk<5xpsuV@g|z(AZD+C-;A!fTG=df1=<%nxy(a(IS+U{ME4ZbDEBtcD_3V=icT6*_ z)>|J?>&6%nvHhZERBtjK+s4xnut*@>GAmA5m*OTp$!^CHTr}vM4n(X1Q*;{e-Rd2BCF-u@1ZGm z!S8hJ6L=Gl4T_SDa7Xx|-{4mxveJg=ctf`BJ*fy!yF6Dz&?w(Q_6B}WQVtNI!BVBC zKfX<>7vd6C96}XAQmF-Jd?1Q4eTfRB3q7hCh0f!(JkdWT5<{iAE#dKy*Jxq&3a1@~ z8C||Dn2mFNyrUV|<-)C^_y7@8c2Fz+2jrae9deBDu;U}tJ{^xAdxCD248(k;dCJ%o z`y3sADe>U%suxwwv~8A1+R$VB=Q?%U?4joI$um;aH+eCrBqpn- z%79D_7rb;R-;-9RTrwi9dPlg8&@tfWhhZ(Vx&1PQ+6(huX`;M9x~LrW~~#3{j0Bh2kDU$}@!fFQej4VGkJv?M4rU^x!RU zEwhu$!CA_iDjFjrJa`aocySDX16?~;+wgav;}Zut6Mg%C4>}8FL?8)Kgwc(Qlj{@#2Pt0?G`$h7P#M+qoXtlV@d}%c&OzO+QYKK`kyXaK{U(O^2DyIXCZlNQjt0^8~8JzNGrIxhj}}M z&~QZlbx%t;MJ(Vux;2tgNKGlAqphLq%pd}JG9uoVHUo?|hN{pLQ6Em%r*+7t^<);X zm~6=qChlNAVXNN*Sow->*4;}T;l;D1I-5T{Bif@4_}=>l`tK;qqDdt5zvisCKhMAH z#r}`)7VW?LZqfdmXQ%zo5bJ00{Xb9^YKrk0Nf|oIW*K@(=`o2Vndz}ZDyk{!u}PVx zzd--+_WC*U{~DH3{?GI64IB+@On&@9X>EUAo&L+G{L^dozaI4C3G#2wr~hseW@K&g zKWs{uHu-9Je!3;4pE>eBltKUXb^*hG8I&413)$J&{D4N%7PcloU6bn%jPxJyQL?g* z9g+YFFEDiE`8rW^laCNzQmi7CTnPfwyg3VDHRAl>h=In6jeaVOP@!-CP60j3+#vpL zEYmh_oP0{-gTe7Or`L6x)6w?77QVi~jD8lWN@3RHcm80iV%M1A!+Y6iHM)05iC64tb$X2lV_%Txk@0l^hZqi^%Z?#- zE;LE0uFx)R08_S-#(wC=dS&}vj6P4>5ZWjhthP=*Hht&TdLtKDR;rXEX4*z0h74FA zMCINqrh3Vq;s%3MC1YL`{WjIAPkVL#3rj^9Pj9Ss7>7duy!9H0vYF%>1jh)EPqvlr6h%R%CxDsk| z!BACz7E%j?bm=pH6Eaw{+suniuY7C9Ut~1cWfOX9KW9=H><&kQlinPV3h9R>3nJvK z4L9(DRM=x;R&d#a@oFY7mB|m8h4692U5eYfcw|QKwqRsshN(q^v$4$)HgPpAJDJ`I zkqjq(8Cd!K!+wCd=d@w%~e$=gdUgD&wj$LQ1r>-E=O@c ze+Z$x{>6(JA-fNVr)X;*)40Eym1TtUZI1Pwwx1hUi+G1Jlk~vCYeXMNYtr)1?qwyg zsX_e*$h?380O00ou?0R@7-Fc59o$UvyVs4cUbujHUA>sH!}L54>`e` zHUx#Q+Hn&Og#YVOuo*niy*GU3rH;%f``nk#NN5-xrZ34NeH$l`4@t);4(+0|Z#I>Y z)~Kzs#exIAaf--65L0UHT_SvV8O2WYeD>Mq^Y6L!Xu8%vnpofG@w!}R7M28?i1*T&zp3X4^OMCY6(Dg<-! zXmcGQrRgHXGYre7GfTJ)rhl|rs%abKT_Nt24_Q``XH{88NVPW+`x4ZdrMuO0iZ0g` z%p}y};~T5gbb9SeL8BSc`SO#ixC$@QhXxZ=B}L`tP}&k?1oSPS=4%{UOHe0<_XWln zwbl5cn(j-qK`)vGHY5B5C|QZd5)W7c@{bNVXqJ!!n$^ufc?N9C-BF2QK1(kv++h!>$QbAjq)_b$$PcJdV+F7hz0Hu@ zqj+}m0qn{t^tD3DfBb~0B36|Q`bs*xs|$i^G4uNUEBl4g;op-;Wl~iThgga?+dL7s zUP(8lMO?g{GcYpDS{NM!UA8Hco?#}eNEioRBHy4`mq!Pd-9@-97|k$hpEX>xoX+dY zDr$wfm^P&}Wu{!%?)U_(%Mn79$(ywvu*kJ9r4u|MyYLI_67U7%6Gd_vb##Nerf@>& z8W11z$$~xEZt$dPG}+*IZky+os5Ju2eRi;1=rUEeIn>t-AzC_IGM-IXWK3^6QNU+2pe=MBn4I*R@A%-iLDCOHTE-O^wo$sL_h{dcPl=^muAQb`_BRm};=cy{qSkui;`WSsj9%c^+bIDQ z0`_?KX0<-=o!t{u(Ln)v>%VGL z0pC=GB7*AQ?N7N{ut*a%MH-tdtNmNC+Yf$|KS)BW(gQJ*z$d{+{j?(e&hgTy^2|AR9vx1Xre2fagGv0YXWqtNkg*v%40v?BJBt|f9wX5 z{QTlCM}b-0{mV?IG>TW_BdviUKhtosrBqdfq&Frdz>cF~yK{P@(w{Vr7z2qKFwLhc zQuogKO@~YwyS9%+d-zD7mJG~@?EFJLSn!a&mhE5$_4xBl&6QHMzL?CdzEnC~C3$X@ zvY!{_GR06ep5;<#cKCSJ%srxX=+pn?ywDwtJ2{TV;0DKBO2t++B(tIO4)Wh`rD13P z4fE$#%zkd=UzOB74gi=-*CuID&Z3zI^-`4U^S?dHxK8fP*;fE|a(KYMgMUo`THIS1f!*6dOI2 zFjC3O=-AL`6=9pp;`CYPTdVX z8(*?V&%QoipuH0>WKlL8A*zTKckD!paN@~hh zmXzm~qZhMGVdQGd=AG8&20HW0RGV8X{$9LldFZYm zE?}`Q3i?xJRz43S?VFMmqRyvWaS#(~Lempg9nTM$EFDP(Gzx#$r)W&lpFKqcAoJh-AxEw$-bjW>`_+gEi z2w`99#UbFZGiQjS8kj~@PGqpsPX`T{YOj`CaEqTFag;$jY z8_{Wzz>HXx&G*Dx<5skhpETxIdhKH?DtY@b9l8$l?UkM#J-Snmts7bd7xayKTFJ(u zyAT&@6cAYcs{PBfpqZa%sxhJ5nSZBPji?Zlf&}#L?t)vC4X5VLp%~fz2Sx<*oN<7` z?ge=k<=X7r<~F7Tvp9#HB{!mA!QWBOf%EiSJ6KIF8QZNjg&x~-%e*tflL(ji_S^sO ztmib1rp09uon}RcsFi#k)oLs@$?vs(i>5k3YN%$T(5Or(TZ5JW9mA6mIMD08=749$ z!d+l*iu{Il7^Yu}H;lgw=En1sJpCKPSqTCHy4(f&NPelr31^*l%KHq^QE>z>Ks_bH zjbD?({~8Din7IvZeJ>8Ey=e;I?thpzD=zE5UHeO|neioJwG;IyLk?xOz(yO&0DTU~ z^#)xcs|s>Flgmp;SmYJ4g(|HMu3v7#;c*Aa8iF#UZo7CvDq4>8#qLJ|YdZ!AsH%^_7N1IQjCro

K7UpUK$>l@ zw`1S}(D?mUXu_C{wupRS-jiX~w=Uqqhf|Vb3Cm9L=T+w91Cu^ z*&Ty%sN?x*h~mJc4g~k{xD4ZmF%FXZNC;oVDwLZ_WvrnzY|{v8hc1nmx4^}Z;yriXsAf+Lp+OFLbR!&Ox?xABwl zu8w&|5pCxmu#$?Cv2_-Vghl2LZ6m7}VLEfR5o2Ou$x02uA-%QB2$c(c1rH3R9hesc zfpn#oqpbKuVsdfV#cv@5pV4^f_!WS+F>SV6N0JQ9E!T90EX((_{bSSFv9ld%I0&}9 zH&Jd4MEX1e0iqDtq~h?DBrxQX1iI0lIs<|kB$Yrh&cpeK0-^K%=FBsCBT46@h#yi!AyDq1V(#V}^;{{V*@T4WJ&U-NTq43w=|K>z8%pr_nC>%C(Wa_l78Ufib$r8Od)IIN=u>417 z`Hl{9A$mI5A(;+-Q&$F&h-@;NR>Z<2U;Y21>>Z;s@0V@SbkMQQj%_;~+qTuQ?c|AV zcWm3XZQHhP&R%QWarS%mJ!9R^&!_)*s(v+VR@I#QrAT}`17Y+l<`b-nvmDNW`De%y zrwTZ9EJrj1AFA>B`1jYDow}~*dfPs}IZMO3=a{Fy#IOILc8F0;JS4x(k-NSpbN@qM z`@aE_e}5{!$v3+qVs7u?sOV(y@1Os*Fgu`fCW9=G@F_#VQ%xf$hj0~wnnP0$hFI+@ zkQj~v#V>xn)u??YutKsX>pxKCl^p!C-o?+9;!Nug^ z{rP!|+KsP5%uF;ZCa5F;O^9TGac=M|=V z_H(PfkV1rz4jl?gJ(ArXMyWT4y(86d3`$iI4^l9`vLdZkzpznSd5Ikfrs8qcSy&>z zTIZgWZGXw0n9ibQxYWE@gI0(3#KA-dAdPcsL_|hg2@~C!VZDM}5;v_Nykfq!*@*Zf zE_wVgx82GMDryKO{U{D>vSzSc%B~|cjDQrt5BN=Ugpsf8H8f1lR4SGo#hCuXPL;QQ z#~b?C4MoepT3X`qdW2dNn& zo8)K}%Lpu>0tQei+{>*VGErz|qjbK#9 zvtd8rcHplw%YyQCKR{kyo6fgg!)6tHUYT(L>B7er5)41iG`j$qe*kSh$fY!PehLcD zWeKZHn<492B34*JUQh=CY1R~jT9Jt=k=jCU2=SL&&y5QI2uAG2?L8qd2U(^AW#{(x zThSy=C#>k+QMo^7caQcpU?Qn}j-`s?1vXuzG#j8(A+RUAY})F@=r&F(8nI&HspAy4 z4>(M>hI9c7?DCW8rw6|23?qQMSq?*Vx?v30U%luBo)B-k2mkL)Ljk5xUha3pK>EEj z@(;tH|M@xkuN?gsz;*bygizwYR!6=(Xgcg^>WlGtRYCozY<rFX2E>kaZo)O<^J7a`MX8Pf`gBd4vrtD|qKn&B)C&wp0O-x*@-|m*0egT=-t@%dD zgP2D+#WPptnc;_ugD6%zN}Z+X4=c61XNLb7L1gWd8;NHrBXwJ7s0ce#lWnnFUMTR& z1_R9Fin4!d17d4jpKcfh?MKRxxQk$@)*hradH2$3)nyXep5Z;B z?yX+-Bd=TqO2!11?MDtG0n(*T^!CIiF@ZQymqq1wPM_X$Iu9-P=^}v7npvvPBu!d$ z7K?@CsA8H38+zjA@{;{kG)#AHME>Ix<711_iQ@WWMObXyVO)a&^qE1GqpP47Q|_AG zP`(AD&r!V^MXQ^e+*n5~Lp9!B+#y3#f8J^5!iC@3Y@P`;FoUH{G*pj*q7MVV)29+j z>BC`a|1@U_v%%o9VH_HsSnM`jZ-&CDvbiqDg)tQEnV>b%Ptm)T|1?TrpIl)Y$LnG_ zzKi5j2Fx^K^PG1=*?GhK;$(UCF-tM~^=Z*+Wp{FSuy7iHt9#4n(sUuHK??@v+6*|10Csdnyg9hAsC5_OrSL;jVkLlf zHXIPukLqbhs~-*oa^gqgvtpgTk_7GypwH><53riYYL*M=Q@F-yEPLqQ&1Sc zZB%w}T~RO|#jFjMWcKMZccxm-SL)s_ig?OC?y_~gLFj{n8D$J_Kw%{r0oB8?@dWzn zB528d-wUBQzrrSSLq?fR!K%59Zv9J4yCQhhDGwhptpA5O5U?Hjqt>8nOD zi{)0CI|&Gu%zunGI*XFZh(ix)q${jT8wnnzbBMPYVJc4HX*9d^mz|21$=R$J$(y7V zo0dxdbX3N#=F$zjstTf*t8vL)2*{XH!+<2IJ1VVFa67|{?LP&P41h$2i2;?N~RA30LV`BsUcj zfO9#Pg1$t}7zpv#&)8`mis3~o+P(DxOMgz-V*(?wWaxi?R=NhtW}<#^Z?(BhSwyar zG|A#Q7wh4OfK<|DAcl9THc-W4*>J4nTevsD%dkj`U~wSUCh15?_N@uMdF^Kw+{agk zJ`im^wDqj`Ev)W3k3stasP`88-M0ZBs7;B6{-tSm3>I@_e-QfT?7|n0D~0RRqDb^G zyHb=is;IwuQ&ITzL4KsP@Z`b$d%B0Wuhioo1CWttW8yhsER1ZUZzA{F*K=wmi-sb#Ju+j z-l@In^IKnb{bQG}Ps>+Vu_W#grNKNGto+yjA)?>0?~X`4I3T@5G1)RqGUZuP^NJCq&^HykuYtMDD8qq+l8RcZNJsvN(10{ zQ1$XcGt}QH-U^WU!-wRR1d--{B$%vY{JLWIV%P4-KQuxxDeJaF#{eu&&r!3Qu{w}0f--8^H|KwE>)ORrcR+2Qf zb})DRcH>k0zWK8@{RX}NYvTF;E~phK{+F;MkIP$)T$93Ba2R2TvKc>`D??#mv9wg$ zd~|-`Qx5LwwsZ2hb*Rt4S9dsF%Cny5<1fscy~)d;0m2r$f=83<->c~!GNyb!U)PA; zq^!`@@)UaG)Ew(9V?5ZBq#c%dCWZrplmuM`o~TyHjAIMh0*#1{B>K4po-dx$Tk-Cq z=WZDkP5x2W&Os`N8KiYHRH#UY*n|nvd(U>yO=MFI-2BEp?x@=N<~CbLJBf6P)}vLS?xJXYJ2^<3KJUdrwKnJnTp{ zjIi|R=L7rn9b*D#Xxr4*R<3T5AuOS+#U8hNlfo&^9JO{VbH!v9^JbK=TCGR-5EWR@ zN8T-_I|&@A}(hKeL4_*eb!1G8p~&_Im8|wc>Cdir+gg90n1dw?QaXcx6Op_W1r=axRw>4;rM*UOpT#Eb9xU1IiWo@h?|5uP zka>-XW0Ikp@dIe;MN8B01a7+5V@h3WN{J=HJ*pe0uwQ3S&MyWFni47X32Q7SyCTNQ z+sR!_9IZa5!>f&V$`q!%H8ci!a|RMx5}5MA_kr+bhtQy{-^)(hCVa@I!^TV4RBi zAFa!Nsi3y37I5EK;0cqu|9MRj<^r&h1lF}u0KpKQD^5Y+LvFEwM zLU@@v4_Na#Axy6tn3P%sD^5P#<7F;sd$f4a7LBMk zGU^RZHBcxSA%kCx*eH&wgA?Qwazm8>9SCSz_!;MqY-QX<1@p$*T8lc?@`ikEqJ>#w zcG``^CoFMAhdEXT9qt47g0IZkaU)4R7wkGs^Ax}usqJ5HfDYAV$!=6?>J6+Ha1I<5 z|6=9soU4>E))tW$<#>F ziZ$6>KJf0bPfbx_)7-}tMINlc=}|H+$uX)mhC6-Hz+XZxsKd^b?RFB6et}O#+>Wmw9Ec9) z{q}XFWp{3@qmyK*Jvzpyqv57LIR;hPXKsrh{G?&dRjF%Zt5&m20Ll?OyfUYC3WRn{cgQ?^V~UAv+5 z&_m#&nIwffgX1*Z2#5^Kl4DbE#NrD&Hi4|7SPqZ}(>_+JMz=s|k77aEL}<=0Zfb)a z%F(*L3zCA<=xO)2U3B|pcTqDbBoFp>QyAEU(jMu8(jLA61-H!ucI804+B!$E^cQQa z)_ERrW3g!B9iLb3nn3dlkvD7KsY?sRvls3QC0qPi>o<)GHx%4Xb$5a3GBTJ(k@`e@ z$RUa^%S15^1oLEmA=sayrP5;9qtf!Z1*?e$ORVPsXpL{jL<6E)0sj&swP3}NPmR%FM?O>SQgN5XfHE< zo(4#Cv11(%Nnw_{_Ro}r6=gKd{k?NebJ~<~Kv0r(r0qe4n3LFx$5%x(BKvrz$m?LG zjLIc;hbj0FMdb9aH9Lpsof#yG$(0sG2%RL;d(n>;#jb!R_+dad+K;Ccw!|RY?uS(a zj~?=&M!4C(5LnlH6k%aYvz@7?xRa^2gml%vn&eKl$R_lJ+e|xsNfXzr#xuh(>`}9g zLHSyiFwK^-p!;p$yt7$F|3*IfO3Mlu9e>Dpx8O`37?fA`cj`C0B-m9uRhJjs^mRp# zWB;Aj6|G^1V6`jg7#7V9UFvnB4((nIwG?k%c7h`?0tS8J3Bn0t#pb#SA}N-|45$-j z$R>%7cc2ebAClXc(&0UtHX<>pd)akR3Kx_cK+n<}FhzmTx!8e9^u2e4%x{>T6pQ`6 zO182bh$-W5A3^wos0SV_TgPmF4WUP-+D25KjbC{y_6W_9I2_vNKwU(^qSdn&>^=*t z&uvp*@c8#2*paD!ZMCi3;K{Na;I4Q35zw$YrW5U@Kk~)&rw;G?d7Q&c9|x<Hg|CNMsxovmfth*|E*GHezPTWa^Hd^F4!B3sF;)? z(NaPyAhocu1jUe(!5Cy|dh|W2=!@fNmuNOzxi^tE_jAtzNJ0JR-avc_H|ve#KO}#S z#a(8secu|^Tx553d4r@3#6^MHbH)vmiBpn0X^29xEv!Vuh1n(Sr5I0V&`jA2;WS|Y zbf0e}X|)wA-Pf5gBZ>r4YX3Mav1kKY(ulAJ0Q*jB)YhviHK)w!TJsi3^dMa$L@^{` z_De`fF4;M87vM3Ph9SzCoCi$#Fsd38u!^0#*sPful^p5oI(xGU?yeYjn;Hq1!wzFk zG&2w}W3`AX4bxoVm03y>ts{KaDf!}b&7$(P4KAMP=vK5?1In^-YYNtx1f#}+2QK@h zeSeAI@E6Z8a?)>sZ`fbq9_snl6LCu6g>o)rO;ijp3|$vig+4t} zylEo7$SEW<_U+qgVcaVhk+4k+C9THI5V10qV*dOV6pPtAI$)QN{!JRBKh-D zk2^{j@bZ}yqW?<#VVuI_27*cI-V~sJiqQv&m07+10XF+#ZnIJdr8t`9s_EE;T2V;B z4UnQUH9EdX%zwh-5&wflY#ve!IWt0UE-My3?L#^Bh%kcgP1q{&26eXLn zTkjJ*w+(|_>Pq0v8{%nX$QZbf)tbJaLY$03;MO=Ic-uqYUmUCuXD>J>o6BCRF=xa% z3R4SK9#t1!K4I_d>tZgE>&+kZ?Q}1qo4&h%U$GfY058s%*=!kac{0Z+4Hwm!)pFLR zJ+5*OpgWUrm0FPI2ib4NPJ+Sk07j(`diti^i#kh&f}i>P4~|d?RFb#!JN)~D@)beox}bw?4VCf^y*`2{4`-@%SFTry2h z>9VBc9#JxEs1+0i2^LR@B1J`B9Ac=#FW=(?2;5;#U$0E0UNag_!jY$&2diQk_n)bT zl5Me_SUvqUjwCqmVcyb`igygB_4YUB*m$h5oeKv3uIF0sk}~es!{D>4r%PC*F~FN3owq5e0|YeUTSG#Vq%&Gk7uwW z0lDo#_wvflqHeRm*}l?}o;EILszBt|EW*zNPmq#?4A+&i0xx^?9obLyY4xx=Y9&^G;xYXYPxG)DOpPg!i_Ccl#3L}6xAAZzNhPK1XaC_~ z!A|mlo?Be*8Nn=a+FhgpOj@G7yYs(Qk(8&|h@_>w8Y^r&5nCqe0V60rRz?b5%J;GYeBqSAjo|K692GxD4` zRZyM2FdI+-jK2}WAZTZ()w_)V{n5tEb@>+JYluDozCb$fA4H)$bzg(Ux{*hXurjO^ zwAxc+UXu=&JV*E59}h3kzQPG4M)X8E*}#_&}w*KEgtX)cU{vm9b$atHa;s>| z+L6&cn8xUL*OSjx4YGjf6{Eq+Q3{!ZyhrL&^6Vz@jGbI%cAM9GkmFlamTbcQGvOlL zmJ?(FI)c86=JEs|*;?h~o)88>12nXlpMR4@yh%qdwFNpct;vMlc=;{FSo*apJ;p}! zAX~t;3tb~VuP|ZW;z$=IHf->F@Ml)&-&Bnb{iQyE#;GZ@C$PzEf6~q}4D>9jic@mTO5x76ulDz@+XAcm35!VSu zT*Gs>;f0b2TNpjU_BjHZ&S6Sqk6V1370+!eppV2H+FY!q*n=GHQ!9Rn6MjY!Jc77A zG7Y!lFp8?TIHN!LXO?gCnsYM-gQxsm=Ek**VmZu7vnuufD7K~GIxfxbsQ@qv2T zPa`tvHB$fFCyZl>3oYg?_wW)C>^_iDOc^B7klnTOoytQH18WkOk)L2BSD0r%xgRSW zQS9elF^?O=_@|58zKLK;(f77l-Zzu}4{fXed2saq!5k#UZAoDBqYQS{sn@j@Vtp|$ zG%gnZ$U|9@u#w1@11Sjl8ze^Co=)7yS(}=;68a3~g;NDe_X^}yJj;~s8xq9ahQ5_r zxAlTMnep*)w1e(TG%tWsjo3RR;yVGPEO4V{Zp?=a_0R#=V^ioQu4YL=BO4r0$$XTX zZfnw#_$V}sDAIDrezGQ+h?q24St0QNug_?{s-pI(^jg`#JRxM1YBV;a@@JQvH8*>> zIJvku74E0NlXkYe_624>znU0J@L<-c=G#F3k4A_)*;ky!C(^uZfj%WB3-*{*B$?9+ zDm$WFp=0(xnt6`vDQV3Jl5f&R(Mp};;q8d3I%Kn>Kx=^;uSVCw0L=gw53%Bp==8Sw zxtx=cs!^-_+i{2OK`Q;913+AXc_&Z5$@z3<)So0CU3;JAv=H?@Zpi~riQ{z-zLtVL z!oF<}@IgJp)Iyz1zVJ42!SPHSkjYNS4%ulVVIXdRuiZ@5Mx8LJS}J#qD^Zi_xQ@>DKDr-_e#>5h3dtje*NcwH_h;i{Sx7}dkdpuW z(yUCjckQsagv*QGMSi9u1`Z|V^}Wjf7B@q%j2DQXyd0nOyqg%m{CK_lAoKlJ7#8M} z%IvR?Vh$6aDWK2W!=i?*<77q&B8O&3?zP(Cs@kapc)&p7En?J;t-TX9abGT#H?TW? ztO5(lPKRuC7fs}zwcUKbRh=7E8wzTsa#Z{a`WR}?UZ%!HohN}d&xJ=JQhpO1PI#>X zHkb>pW04pU%Bj_mf~U}1F1=wxdBZu1790>3Dm44bQ#F=T4V3&HlOLsGH)+AK$cHk6 zia$=$kog?)07HCL*PI6}DRhpM^*%I*kHM<#1Se+AQ!!xyhcy6j7`iDX7Z-2i73_n# zas*?7LkxS-XSqv;YBa zW_n*32D(HTYQ0$feV_Fru1ZxW0g&iwqixPX3=9t4o)o|kOo79V$?$uh?#8Q8e>4e)V6;_(x&ViUVxma+i25qea;d-oK7ouuDsB^ab{ zu1qjQ%`n56VtxBE#0qAzb7lph`Eb-}TYpXB!H-}3Ykqyp`otprp7{VEuW*^IR2n$Fb99*nAtqT&oOFIf z@w*6>YvOGw@Ja?Pp1=whZqydzx@9X4n^2!n83C5{C?G@|E?&$?p*g68)kNvUTJ)I6 z1Q|(#UuP6pj78GUxq11m-GSszc+)X{C2eo-?8ud9sB=3(D47v?`JAa{V(IF zPZQ_0AY*9M97>Jf<o%#O_%Wq}8>YM=q0|tGY+hlXcpE=Z4Od z`NT7Hu2hnvRoqOw@g1f=bv`+nba{GwA$Ak0INlqI1k<9!x_!sL()h?hEWoWrdU3w` zZ%%)VR+Bc@_v!C#koM1p-3v_^L6)_Ktj4HE>aUh%2XZE@JFMOn)J~c`_7VWNb9c-N z2b|SZMR4Z@E7j&q&9(6H3yjEu6HV7{2!1t0lgizD;mZ9$r(r7W5G$ky@w(T_dFnOD z*p#+z$@pKE+>o@%eT(2-p_C}wbQ5s(%Sn_{$HDN@MB+Ev?t@3dPy`%TZ!z}AThZSu zN<1i$siJhXFdjV zP*y|V<`V8t=h#XTRUR~5`c`Z9^-`*BZf?WAehGdg)E2Je)hqFa!k{V(u+(hTf^Yq& zoruUh2(^3pe)2{bvt4&4Y9CY3js)PUHtd4rVG57}uFJL)D(JfSIo^{P=7liFXG zq5yqgof0V8paQcP!gy+;^pp-DA5pj=gbMN0eW=-eY+N8~y+G>t+x}oa!5r>tW$xhI zPQSv=pi;~653Gvf6~*JcQ%t1xOrH2l3Zy@8AoJ+wz@daW@m7?%LXkr!bw9GY@ns3e zSfuWF_gkWnesv?s3I`@}NgE2xwgs&rj?kH-FEy82=O8`+szN ziHch`vvS`zNfap14!&#i9H@wF7}yIPm=UB%(o(}F{wsZ(wA0nJ2aD^@B41>>o-_U6 zUqD~vdo48S8~FTb^+%#zcbQiiYoDKYcj&$#^;Smmb+Ljp(L=1Kt_J!;0s%1|JK}Wi z;={~oL!foo5n8=}rs6MmUW~R&;SIJO3TL4Ky?kh+b2rT9B1Jl4>#Uh-Bec z`Hsp<==#UEW6pGPhNk8H!!DUQR~#F9jEMI6T*OWfN^Ze&X(4nV$wa8QUJ>oTkruH# zm~O<`J7Wxseo@FqaZMl#Y(mrFW9AHM9Kb|XBMqaZ2a)DvJgYipkDD_VUF_PKd~dT7 z#02}bBfPn9a!X!O#83=lbJSK#E}K&yx-HI#T6ua)6o0{|={*HFusCkHzs|Fn&|C3H zBck1cmfcWVUN&i>X$YU^Sn6k2H;r3zuXbJFz)r5~3$d$tUj(l1?o={MM){kjgqXRO zc5R*#{;V7AQh|G|)jLM@wGAK&rm2~@{Pewv#06pHbKn#wL0P6F1!^qw9g&cW3Z=9} zj)POhOlwsh@eF=>z?#sIs*C-Nl(yU!#DaiaxhEs#iJqQ8w%(?+6lU02MYSeDkr!B- zPjMv+on6OLXgGnAtl(ao>|X2Y8*Hb}GRW5}-IzXnoo-d0!m4Vy$GS!XOLy>3_+UGs z2D|YcQx@M#M|}TDOetGi{9lGo9m-=0-^+nKE^*?$^uHkxZh}I{#UTQd;X!L+W@jm( zDg@N4+lUqI92o_rNk{3P>1gxAL=&O;x)ZT=q1mk0kLlE$WeWuY_$0`0jY-Kkt zP*|m3AF}Ubd=`<>(Xg0har*_@x2YH}bn0Wk*OZz3*e5;Zc;2uBdnl8?&XjupbkOeNZsNh6pvsq_ydmJI+*z**{I{0K)-;p1~k8cpJXL$^t!-`E}=*4G^-E8>H!LjTPxSx zcF+cS`ommfKMhNSbas^@YbTpH1*RFrBuATUR zt{oFWSk^$xU&kbFQ;MCX22RAN5F6eq9UfR$ut`Jw--p2YX)A*J69m^!oYfj2y7NYcH6&r+0~_sH^c^nzeN1AU4Ga7=FlR{S|Mm~MpzY0$Z+p2W(a={b-pR9EO1Rs zB%KY|@wLcAA@)KXi!d2_BxrkhDn`DT1=Dec}V!okd{$+wK z4E{n8R*xKyci1(CnNdhf$Dp2(Jpof0-0%-38X=Dd9PQgT+w%Lshx9+loPS~MOm%ZT zt%2B2iL_KU_ita%N>xjB!#71_3=3c}o zgeW~^U_ZTJQ2!PqXulQd=3b=XOQhwATK$y(9$#1jOQ4}4?~l#&nek)H(04f(Sr=s| zWv7Lu1=%WGk4FSw^;;!8&YPM)pQDCY9DhU`hMty1@sq1=Tj7bFsOOBZOFlpR`W>-J$-(kezWJj;`?x-v>ev{*8V z8p|KXJPV$HyQr1A(9LVrM47u-XpcrIyO`yWvx1pVYc&?154aneRpLqgx)EMvRaa#|9?Wwqs2+W8n5~79G z(}iCiLk;?enn}ew`HzhG+tu+Ru@T+K5juvZN)wY;x6HjvqD!&!)$$;1VAh~7fg0K| zEha#aN=Yv|3^~YFH}cc38ovVb%L|g@9W6fo(JtT6$fa?zf@Ct88e}m?i)b*Jgc{fl zExfdvw-BYDmH6>(4QMt#p0;FUIQqkhD}aH?a7)_%JtA~soqj{ppP_82yi9kaxuK>~ ze_)Zt>1?q=ZH*kF{1iq9sr*tVuy=u>Zev}!gEZx@O6-fjyu9X00gpIl-fS_pzjpqJ z1yqBmf9NF!jaF<+YxgH6oXBdK)sH(>VZ)1siyA$P<#KDt;8NT*l_0{xit~5j1P)FN zI8hhYKhQ)i z37^aP13B~u65?sg+_@2Kr^iWHN=U;EDSZ@2W2!5ALhGNWXnFBY%7W?1 z=HI9JzQ-pLKZDYTv<0-lt|6c-RwhxZ)mU2Os{bsX_i^@*fKUj8*aDO5pks=qn3Dv6 zwggpKLuyRCTVPwmw1r}B#AS}?X7b837UlXwp~E2|PJw2SGVueL7){Y&z!jL!XN=0i zU^Eig`S2`{+gU$68aRdWx?BZ{sU_f=8sn~>s~M?GU~`fH5kCc; z8ICp+INM3(3{#k32RZdv6b9MQYdZXNuk7ed8;G?S2nT+NZBG=Tar^KFl2SvhW$bGW#kdWL-I)s_IqVnCDDM9fm8g;P;8 z7t4yZn3^*NQfx7SwmkzP$=fwdC}bafQSEF@pd&P8@H#`swGy_rz;Z?Ty5mkS%>m#% zp_!m9e<()sfKiY(nF<1zBz&&`ZlJf6QLvLhl`_``%RW&{+O>Xhp;lwSsyRqGf=RWd zpftiR`={2(siiPAS|p}@q=NhVc0ELprt%=fMXO3B)4ryC2LT(o=sLM7hJC!}T1@)E zA3^J$3&1*M6Xq>03FX`R&w*NkrZE?FwU+Muut;>qNhj@bX17ZJxnOlPSZ=Zeiz~T_ zOu#yc3t6ONHB;?|r4w+pI)~KGN;HOGC)txxiUN8#mexj+W(cz%9a4sx|IRG=}ia zuEBuba3AHsV2feqw-3MvuL`I+2|`Ud4~7ZkN=JZ;L20|Oxna5vx1qbIh#k2O4$RQF zo`tL()zxaqibg^GbB+BS5#U{@K;WWQj~GcB1zb}zJkPwH|5hZ9iH2308!>_;%msji zJHSL~s)YHBR=Koa1mLEOHos*`gp=s8KA-C zu0aE+W!#iJ*0xqKm3A`fUGy#O+X+5W36myS>Uh2!R*s$aCU^`K&KKLCCDkejX2p=5 z%o7-fl03x`gaSNyr?3_JLv?2RLS3F*8ub>Jd@^Cc17)v8vYEK4aqo?OS@W9mt%ITJ z9=S2%R8M){CugT@k~~0x`}Vl!svYqX=E)c_oU6o}#Hb^%G1l3BudxA{F*tbjG;W_>=xV73pKY53v%>I)@D36I_@&p$h|Aw zonQS`07z_F#@T-%@-Tb|)7;;anoD_WH>9ewFy(ZcEOM$#Y)8>qi7rCnsH9GO-_7zF zu*C87{Df1P4TEOsnzZ@H%&lvV(3V@;Q!%+OYRp`g05PjY^gL$^$-t0Y>H*CDDs?FZly*oZ&dxvsxaUWF!{em4{A>n@vpXg$dwvt@_rgmHF z-MER`ABa8R-t_H*kv>}CzOpz;!>p^^9ztHMsHL|SRnS<-y5Z*r(_}c4=fXF`l^-i}>e7v!qs_jv zqvWhX^F=2sDNWA9c@P0?lUlr6ecrTKM%pNQ^?*Lq?p-0~?_j50xV%^(+H>sMul#Tw zeciF*1=?a7cI(}352%>LO96pD+?9!fNyl^9v3^v&Y4L)mNGK0FN43&Xf8jUlxW1Bw zyiu2;qW-aGNhs=zbuoxnxiwZ3{PFZM#Kw)9H@(hgX23h(`Wm~m4&TvoZoYp{plb^> z_#?vXcxd>r7K+1HKJvhed>gtK`TAbJUazUWQY6T~t2af%#<+Veyr%7-#*A#@&*;@g58{i|E%6yC_InGXCOd{L0;$)z#?n7M`re zh!kO{6=>7I?*}czyF7_frt#)s1CFJ_XE&VrDA?Dp3XbvF{qsEJgb&OLSNz_5g?HpK z9)8rsr4JN!Af3G9!#Qn(6zaUDqLN(g2g8*M)Djap?WMK9NKlkC)E2|-g|#-rp%!Gz zAHd%`iq|81efi93m3yTBw3g0j#;Yb2X{mhRAI?&KDmbGqou(2xiRNb^sV}%%Wu0?< z?($L>(#BO*)^)rSgyNRni$i`R4v;GhlCZ8$@e^ROX(p=2_v6Y!%^As zu022)fHdv_-~Yu_H6WVPLpHQx!W%^6j)cBhS`O3QBW#x(eX54d&I22op(N59b*&$v zFiSRY6rOc^(dgSV1>a7-5C;(5S5MvKcM2Jm-LD9TGqDpP097%52V+0>Xqq!! zq4e3vj53SE6i8J`XcQB|MZPP8j;PAOnpGnllH6#Ku~vS42xP*Nz@~y%db7Xi8s09P z1)e%8ys6&M8D=Dt6&t`iKG_4X=!kgRQoh%Z`dc&mlOUqXk-k`jKv9@(a^2-Upw>?< zt5*^DV~6Zedbec4NVl($2T{&b)zA@b#dUyd>`2JC0=xa_fIm8{5um zr-!ApXZhC8@=vC2WyxO|!@0Km)h8ep*`^he92$@YwP>VcdoS5OC^s38e#7RPsg4j+ zbVGG}WRSET&ZfrcR(x~k8n1rTP%CnfUNKUonD$P?FtNFF#cn!wEIab-;jU=B1dHK@ z(;(yAQJ`O$sMn>h;pf^8{JISW%d+@v6@CnXh9n5TXGC}?FI9i-D0OMaIg&mAg=0Kn zNJ7oz5*ReJukD55fUsMuaP+H4tDN&V9zfqF@ zr=#ecUk9wu{0;!+gl;3Bw=Vn^)z$ahVhhw)io!na&9}LmWurLb0zubxK=UEnU*{5P z+SP}&*(iBKSO4{alBHaY^)5Q=mZ+2OwIooJ7*Q5XJ+2|q`9#f?6myq!&oz?klihLq z4C)$XP!BNS0G_Z1&TM>?Jk{S~{F3n83ioli=IO6f%wkvCl(RFFw~j0tb{GvXTx>*sB0McY0s&SNvj4+^h`9nJ_wM>F!Uc>X}9PifQekn0sKI2SAJP!a4h z5cyGTuCj3ZBM^&{dRelIlT^9zcfaAuL5Y~bl!ppSf`wZbK$z#6U~rdclk``e+!qhe z6Qspo*%<)eu6?C;Bp<^VuW6JI|Ncvyn+LlSl;Mp22Bl7ARQ0Xc24%29(ZrdsIPw&-=yHQ7_Vle|5h>AST0 zUGX2Zk34vp?U~IHT|;$U86T+UUHl_NE4m|}>E~6q``7hccCaT^#y+?wD##Q%HwPd8 zV3x4L4|qqu`B$4(LXqDJngNy-{&@aFBvVsywt@X^}iH7P%>bR?ciC$I^U-4Foa`YKI^qDyGK7k%E%c_P=yzAi`YnxGA%DeNd++j3*h^ z=rn>oBd0|~lZ<6YvmkKY*ZJlJ;Im0tqgWu&E92eqt;+NYdxx`eS(4Hw_Jb5|yVvBg z*tbdY^!AN;luEyN4VRhS@-_DC{({ziH{&Z}iGElSV~qvT>L-8G%+yEL zX#MFOhj{InyKG=mvW-<1B@c-}x$vA(nU?>S>0*eN#!SLzQ)Ex7fvQ)S4D<8|I#N$3 zT5Ei`Z?cxBODHX8(Xp73v`IsAYC@9b;t}z0wxVuQSY1J^GRwDPN@qbM-ZF48T$GZ< z8WU+;Pqo?{ghI-KZ-i*ydXu`Ep0Xw^McH_KE9J0S7G;x8Fe`DVG?j3Pv=0YzJ}yZR z%2=oqHiUjvuk0~Ca>Kol4CFi0_xQT~;_F?=u+!kIDl-9g`#ZNZ9HCy17Ga1v^Jv9# z{T4Kb1-AzUxq*MutfOWWZgD*HnFfyYg0&e9f(5tZ>krPF6{VikNeHoc{linPPt#Si z&*g>(c54V8rT_AX!J&bNm-!umPvOR}vDai#`CX___J#=zeB*{4<&2WpaDncZsOkp* zsg<%@@rbrMkR_ux9?LsQxzoBa1s%$BBn6vk#{&&zUwcfzeCBJUwFYSF$08qDsB;gWQN*g!p8pxjofWbqNSZOEKOaTx@+* zwdt5*Q47@EOZ~EZL9s?1o?A%9TJT=Ob_13yyugvPg*e&ZU(r6^k4=2+D-@n=Hv5vu zSXG|hM(>h9^zn=eQ=$6`JO&70&2|%V5Lsx>)(%#;pcOfu>*nk_3HB_BNaH$`jM<^S zcSftDU1?nL;jy)+sfonQN}(}gUW?d_ikr*3=^{G)=tjBtEPe>TO|0ddVB zTklrSHiW+!#26frPXQQ(YN8DG$PZo?(po(QUCCf_OJC`pw*uey00%gmH!`WJkrKXj2!#6?`T25mTu9OJp2L8z3! z=arrL$ZqxuE{%yV)14Kd>k}j7pxZ6#$Dz8$@WV5p8kTqN<-7W)Q7Gt2{KoOPK_tZ| zf2WG~O5@{qPI+W<4f_;reuFVdO^5`ADC1!JQE|N`s3cq@(0WB!n0uh@*c{=LAd;~} zyGK@hbF-Oo+!nN)@i*O(`@FA#u?o=~e{`4O#5}z&=UkU*50fOrzi11D^&FOqe>wii z?*k+2|EcUs;Gx{!@KBT~>PAwLrIDT7Th=Utu?~?np@t^gFs?zgX=D${RwOY^WGh-+ z+#4$066ISh8eYW#FXWp~S`<*%O^ZuItL1Tyqt8#tZ zY120E;^VG`!lZn&3sPd$RkdHpU#|w+bYV)pJC|SH9g%|5IkxVTQcBA4CL0}$&}ef@ zW^Vtj%M;;_1xxP9x#ex17&4N*{ksO*_4O}xYu(p*JkL#yr}@7b)t5X?%CY<+s5_MJ zuiqt+N_;A(_)%lumoyRFixWa-M7qK_9s6<1X?JDa9fP!+_6u~~M$5L=ipB=7(j#f< zZ34J%=bs549%~_mA(|={uZNs_0?o7;-LBP(ZRnkd{-^|2|=4vUTmtByHL8 zEph`(LSEzQj68a+`d$V<45J7cyv^#|^|%fD#si1Nx!4NW*`l*{->HEWNh6-|g>-=r zXmQ|-i}Ku$ndUeHQ^&ieT!Lf}vf6GaqW9$DJ2NWrqwPY%%4nip$@vK$nRp*_C-v<| zuKz~ZyN&<%!NS26&x?jhy+@awJipMQ-8(X4#Ae5??U<1QMt1l9R=w9fAnEF}NYu$2 z>6}Vkc zIb*A?G*z8^IvibmBKn_u^5&T_1oey0gZS2~obf(#xk=erZGTEdQnt3DMGM+0oPwss zj5zXD;(oWhB_T@~Ig#9@v)AKtXu3>Inmgf@A|-lD-1U>cNyl3h?ADD9)GG4}zUGPk zZzaXe!~Kf?<~@$G?Uql3t8jy9{2!doq4=J}j9ktTxss{p6!9UdjyDERlA*xZ!=Q)KDs5O)phz>Vq3BNGoM(H|=1*Q4$^2fTZw z(%nq1P|5Rt81}SYJpEEzMPl5VJsV5&4e)ZWKDyoZ>1EwpkHx-AQVQc8%JMz;{H~p{=FXV>jIxvm4X*qv52e?Y-f%DJ zxEA165GikEASQ^fH6K#d!Tpu2HP{sFs%E=e$gYd$aj$+xue6N+Wc(rAz~wUsk2`(b z8Kvmyz%bKQxpP}~baG-rwYcYCvkHOi zlkR<=>ZBTU*8RF_d#Bl@zZsRIhx<%~Z@Z=ik z>adw3!DK(8R|q$vy{FTxw%#xliD~6qXmY^7_9kthVPTF~Xy1CfBqbU~?1QmxmU=+k z(ggxvEuA;0e&+ci-zQR{-f7aO{O(Pz_OsEjLh_K>MbvoZ4nxtk5u{g@nPv)cgW_R} z9}EA4K4@z0?7ue}Z(o~R(X&FjejUI2g~08PH1E4w>9o{)S(?1>Z0XMvTb|;&EuyOE zGvWNpYX)Nv<8|a^;1>bh#&znEcl-r!T#pn= z4$?Yudha6F%4b>*8@=BdtXXY4N+`U4Dmx$}>HeVJk-QdTG@t!tVT#0(LeV0gvqyyw z2sEp^9eY0N`u10Tm4n8No&A=)IeEC|gnmEXoNSzu!1<4R<%-9kY_8~5Ej?zRegMn78wuMs#;i&eUA0Zk_RXQ3b&TT} z;SCI=7-FUB@*&;8|n>(_g^HGf3@QODE3LpmX~ELnymQm{Sx9xrKS zK29p~?v@R$0=v6Dr5aW>-!{+h@?Q58|Kz8{{W`%J+lDAdb&M5VHrX_mDY;1-JLnf)ezmPau$)1;=`-FU=-r-83tX=C`S#}GZufju zQ>sXNT0Ny=k@nc%cFnvA_i4SC)?_ORXHq8B4D%el1uPX`c~uG#S1M7C+*MMqLw78E zhY2dI8@+N^qrMI1+;TUda(vGqGSRyU{Fnm`aqrr7bz42c5xsOO-~oZpkzorD1g}Y<6rk&3>PsSGy}W?MtqFky@A(X# zIuNZK0cK?^=;PUAu>j0#HtjbHCV*6?jzA&OoE$*Jlga*}LF`SF?WLhv1O|zqC<>*> zYB;#lsYKx0&kH@BFpW8n*yDcc6?;_zaJs<-jPSkCsSX-!aV=P5kUgF@Nu<{a%#K*F z134Q{9|YX7X(v$62_cY3^G%t~rD>Q0z@)1|zs)vjJ6Jq9;7#Ki`w+eS**En?7;n&7 zu==V3T&eFboN3ZiMx3D8qYc;VjFUk_H-WWCau(VFXSQf~viH0L$gwD$UfFHqNcgN`x}M+YQ6RnN<+@t>JUp#)9YOkqst-Ga?{FsDpEeX0(5v{0J~SEbWiL zXC2}M4?UH@u&|;%0y`eb33ldo4~z-x8zY!oVmV=c+f$m?RfDC35mdQ2E>Pze7KWP- z>!Bh<&57I+O_^s}9Tg^k)h7{xx@0a0IA~GAOt2yy!X%Q$1rt~LbTB6@Du!_0%HV>N zlf)QI1&gvERKwso23mJ!Ou6ZS#zCS5W`gxE5T>C#E|{i<1D35C222I33?Njaz`On7 zi<+VWFP6D{e-{yiN#M|Jgk<44u1TiMI78S5W`Sdb5f+{zu34s{CfWN7a3Cf^@L%!& zN$?|!!9j2c)j$~+R6n#891w-z8(!oBpL2K=+%a$r2|~8-(vQj5_XT`<0Ksf;oP+tz z9CObS!0m)Tgg`K#xBM8B(|Z)Wb&DYL{WTYv`;A=q6~Nnx2+!lTIXtj8J7dZE!P_{z z#f8w6F}^!?^KE#+ZDv+xd5O&3EmomZzsv?>E-~ygGum45fk!SBN&|eo1rKw^?aZJ4 E2O(~oYXATM literal 0 HcmV?d00001 diff --git a/samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..8cf6eb5ad22 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-array-simple-string/gradlew b/samples/client/petstore/kotlin-array-simple-string/gradlew new file mode 100644 index 00000000000..4f906e0c811 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/gradlew @@ -0,0 +1,185 @@ +#!/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/client/petstore/kotlin-array-simple-string/gradlew.bat b/samples/client/petstore/kotlin-array-simple-string/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/gradlew.bat @@ -0,0 +1,89 @@ +@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 Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@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 execute + +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 execute + +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 + +: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 %* + +: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/client/petstore/kotlin-array-simple-string/settings.gradle b/samples/client/petstore/kotlin-array-simple-string/settings.gradle new file mode 100644 index 00000000000..646809e89a5 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-array-simple-string' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..3a686204890 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,116 @@ +/** + * Demo + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + + +import com.squareup.moshi.Json + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiResponse +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(ApiClient.baseUrlKey, "http://localhost") + } + } + + /** + * + * + * @param ids + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun idsGet(ids: kotlin.collections.List) : Unit { + val localVarResponse = idsGetWithHttpInfo(ids = ids) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * + * + * @param ids + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun idsGetWithHttpInfo(ids: kotlin.collections.List) : ApiResponse { + val localVariableConfig = idsGetRequestConfig(ids = ids) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation idsGet + * + * @param ids + * @return RequestConfig + */ + fun idsGetRequestConfig(ids: kotlin.collections.List) : RequestConfig { + val localVariableBody = null + val localVariableQuery: MultiValueMap = mutableMapOf() + val localVariableHeaders: MutableMap = mutableMapOf() + + return RequestConfig( + method = RequestMethod.GET, + path = "/{ids}".replace("{"+"ids"+"}", ids.joinToString(",")), + query = localVariableQuery, + headers = localVariableHeaders, + body = localVariableBody + ) + } + +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..dc423d8a17d --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,245 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.asRequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import okhttp3.FormBody +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull +import okhttp3.ResponseBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.Request +import okhttp3.Headers +import okhttp3.MultipartBody +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Response +import okhttp3.internal.EMPTY_REQUEST +import java.io.BufferedWriter +import java.io.File +import java.io.FileWriter +import java.io.IOException +import java.net.URLConnection +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.LocalTime +import java.time.OffsetDateTime +import java.time.OffsetTime +import java.util.Locale +import com.squareup.moshi.adapter + +open class ApiClient(val baseUrl: String) { + companion object { + protected const val ContentType = "Content-Type" + protected const val Accept = "Accept" + protected const val Authorization = "Authorization" + protected const val JsonMediaType = "application/json" + protected const val FormDataMediaType = "multipart/form-data" + protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" + protected const val XmlMediaType = "application/xml" + + val apiKey: MutableMap = mutableMapOf() + val apiKeyPrefix: MutableMap = mutableMapOf() + var username: String? = null + var password: String? = null + var accessToken: String? = null + const val baseUrlKey = "org.openapitools.client.baseUrl" + + @JvmStatic + val client: OkHttpClient by lazy { + builder.build() + } + + @JvmStatic + val builder: OkHttpClient.Builder = OkHttpClient.Builder() + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + protected fun guessContentTypeFromFile(file: File): String { + val contentType = URLConnection.guessContentTypeFromName(file.name) + return contentType ?: "application/octet-stream" + } + + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = + when { + content is File -> content.asRequestBody(mediaType.toMediaTypeOrNull()) + mediaType == FormDataMediaType -> { + MultipartBody.Builder() + .setType(MultipartBody.FORM) + .apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + if (value is File) { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"; filename=\"${value.name}\"" + ) + val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() + addPart(partHeaders, value.asRequestBody(fileMediaType)) + } else { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"" + ) + addPart( + partHeaders, + parameterToString(value).toRequestBody(null) + ) + } + } + }.build() + } + mediaType == FormUrlEncMediaType -> { + FormBody.Builder().apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + add(key, parameterToString(value)) + } + }.build() + } + mediaType.startsWith("application/") && mediaType.endsWith("json") -> + if (content == null) { + EMPTY_REQUEST + } else { + Serializer.moshi.adapter(T::class.java).toJson(content) + .toRequestBody( + mediaType.toMediaTypeOrNull() + ) + } + mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") + // TODO: this should be extended with other serializers + else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") + } + + @OptIn(ExperimentalStdlibApi::class) + protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { + if(body == null) { + return null + } + val bodyContent = body.string() + if (bodyContent.isEmpty()) { + return null + } + if (T::class.java == File::class.java) { + // return tempfile + val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile() + f.deleteOnExit() + val out = BufferedWriter(FileWriter(f)) + out.write(bodyContent) + out.close() + return f as T + } + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + + protected inline fun request(requestConfig: RequestConfig): ApiResponse { + val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") + + val url = httpUrl.newBuilder() + .addPathSegments(requestConfig.path.trimStart('/')) + .apply { + requestConfig.query.forEach { query -> + query.value.forEach { queryValue -> + addQueryParameter(query.key, queryValue) + } + } + }.build() + + // take content-type/accept from spec or set to default (application/json) if not defined + if (requestConfig.headers[ContentType].isNullOrEmpty()) { + requestConfig.headers[ContentType] = JsonMediaType + } + if (requestConfig.headers[Accept].isNullOrEmpty()) { + requestConfig.headers[Accept] = JsonMediaType + } + val headers = requestConfig.headers + + if(headers[ContentType].isNullOrEmpty()) { + throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") + } + + if(headers[Accept].isNullOrEmpty()) { + throw kotlin.IllegalStateException("Missing Accept header. This is required.") + } + + // TODO: support multiple contentType options here. + val contentType = (headers[ContentType] as String).substringBefore(";").lowercase(Locale.getDefault()) + + val request = when (requestConfig.method) { + RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) + RequestMethod.GET -> Request.Builder().url(url) + RequestMethod.HEAD -> Request.Builder().url(url).head() + RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) + RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) + RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) + RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) + }.apply { + headers.forEach { header -> addHeader(header.key, header.value) } + }.build() + + val response = client.newCall(request).execute() + + val accept = response.header(ContentType)?.substringBefore(";")?.lowercase(Locale.getDefault()) + + // TODO: handle specific mapping types. e.g. Map> + return when { + response.isRedirect -> Redirection( + response.code, + response.headers.toMultimap() + ) + response.isInformational -> Informational( + response.message, + response.code, + response.headers.toMultimap() + ) + response.isSuccessful -> Success( + responseBody(response.body, accept), + response.code, + response.headers.toMultimap() + ) + response.isClientError -> ClientError( + response.message, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + else -> ServerError( + response.message, + response.body?.string(), + response.code, + response.headers.toMultimap() + ) + } + } + + protected fun parameterToString(value: Any?): String = when (value) { + null -> "" + is Array<*> -> toMultiValue(value, "csv").toString() + is Iterable<*> -> toMultiValue(value, "csv").toString() + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> + parseDateToQueryString(value) + else -> value.toString() + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") + } +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 00000000000..cf2cfaa95d9 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt new file mode 100644 index 00000000000..fb2c972cf8d --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.math.BigDecimal + +class BigDecimalAdapter { + @ToJson + fun toJson(value: BigDecimal): String { + return value.toPlainString() + } + + @FromJson + fun fromJson(value: String): BigDecimal { + return BigDecimal(value) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt new file mode 100644 index 00000000000..4b6963110c9 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.math.BigInteger + +class BigIntegerAdapter { + @ToJson + fun toJson(value: BigInteger): String { + return value.toString() + } + + @FromJson + fun fromJson(value: String): BigInteger { + return BigInteger(value) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..ff5e2a81ee8 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..b5310e71f13 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..b2e1654479a --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..e082db94811 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..87437871a31 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter { + @ToJson + fun toJson(value: OffsetDateTime): String { + return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): OffsetDateTime { + return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..7e948e1dd07 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf(), + val body: T? = null +) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..931b12b8bd7 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt new file mode 100644 index 00000000000..9bd2790dc14 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import okhttp3.Response + +/** + * Provides an extension to evaluation whether the response is a 1xx code + */ +val Response.isInformational : Boolean get() = this.code in 100..199 + +/** + * Provides an extension to evaluation whether the response is a 3xx code + */ +@Suppress("EXTENSION_SHADOWED_BY_MEMBER") +val Response.isRedirect : Boolean get() = this.code in 300..399 + +/** + * Provides an extension to evaluation whether the response is a 4xx code + */ +val Response.isClientError : Boolean get() = this.code in 400..499 + +/** + * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code + */ +val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..e22592e47d7 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory + +object Serializer { + @JvmStatic + val moshiBuilder: Moshi.Builder = Moshi.Builder() + .add(OffsetDateTimeAdapter()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(URIAdapter()) + .add(KotlinJsonAdapterFactory()) + .add(BigDecimalAdapter()) + .add(BigIntegerAdapter()) + + @JvmStatic + val moshi: Moshi by lazy { + moshiBuilder.build() + } +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt new file mode 100644 index 00000000000..927522757da --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.net.URI + +class URIAdapter { + @ToJson + fun toJson(uri: URI) = uri.toString() + + @FromJson + fun fromJson(s: String): URI = URI.create(s) +} diff --git a/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 00000000000..7ccf7dc25d2 --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String): UUID = UUID.fromString(s) +} From 2e6e82161fcd3a13832d8194e80b5ceeff427397 Mon Sep 17 00:00:00 2001 From: Giacomo Date: Wed, 12 Jan 2022 18:28:02 +0100 Subject: [PATCH 034/113] Apache Camel Server Generator (#11162) * Created Apache Camel language * Added unit test * Fix template dir * Fix description api * Camel Dataformat Properties * Apache Camel Doc * Apache Camel Doc * Apache Camel Doc * Apache Camel maven plugin example * Fix LOGGER * Samples * Camel 3.14 * Samples * samples * up to date * Rename camel to java-camel * up to date * Fix SerializedName in modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache --- bin/configs/java-camel-petstore-new.yaml | 17 + docs/generators.md | 1 + docs/generators/java-camel.md | 314 ++++++++++++++++++ .../examples/camel.xml | 198 +++++++++++ .../languages/JavaCamelServerCodegen.java | 186 +++++++++++ .../org.openapitools.codegen.CodegenConfig | 2 + .../java-camel-server/README.mustache | 7 + .../resources/java-camel-server/api.mustache | 95 ++++++ .../java-camel-server/application.mustache | 8 + .../java-camel-server/errorProcessor.mustache | 33 ++ .../java-camel-server/exampleString.mustache | 1 + .../exampleStringArray.mustache | 1 + .../resources/java-camel-server/pom.mustache | 193 +++++++++++ .../restConfiguration.mustache | 22 ++ .../java-camel-server/routesImpl.mustache | 34 ++ .../resources/java-camel-server/test.mustache | 63 ++++ .../java-camel-server/validation.mustache | 28 ++ .../java-camel/.openapi-generator-ignore | 23 ++ .../java-camel/.openapi-generator/FILES | 22 ++ .../java-camel/.openapi-generator/VERSION | 1 + samples/server/petstore/java-camel/README.md | 7 + samples/server/petstore/java-camel/pom.xml | 185 +++++++++++ .../org/openapitools/OpenAPI2SpringBoot.java | 64 ++++ .../org/openapitools/RFC3339DateFormat.java | 38 +++ .../org/openapitools/RestConfiguration.java | 22 ++ .../ValidationErrorProcessor.java | 30 ++ .../java/org/openapitools/api/PetApi.java | 268 +++++++++++++++ .../openapitools/api/PetApiRoutesImpl.java | 112 +++++++ .../org/openapitools/api/PetApiValidator.java | 64 ++++ .../java/org/openapitools/api/StoreApi.java | 97 ++++++ .../openapitools/api/StoreApiRoutesImpl.java | 64 ++++ .../openapitools/api/StoreApiValidator.java | 42 +++ .../java/org/openapitools/api/UserApi.java | 206 ++++++++++++ .../openapitools/api/UserApiRoutesImpl.java | 102 ++++++ .../openapitools/api/UserApiValidator.java | 60 ++++ .../java/org/openapitools/model/Category.java | 117 +++++++ .../openapitools/model/ModelApiResponse.java | 143 ++++++++ .../java/org/openapitools/model/Order.java | 262 +++++++++++++++ .../main/java/org/openapitools/model/Pet.java | 282 ++++++++++++++++ .../main/java/org/openapitools/model/Tag.java | 117 +++++++ .../java/org/openapitools/model/User.java | 273 +++++++++++++++ .../src/main/resources/application.properties | 8 + .../java/org/openapitools/api/PetApiTest.java | 145 ++++++++ .../org/openapitools/api/StoreApiTest.java | 84 +++++ .../org/openapitools/api/UserApiTest.java | 51 +++ 45 files changed, 4092 insertions(+) create mode 100644 bin/configs/java-camel-petstore-new.yaml create mode 100644 docs/generators/java-camel.md create mode 100644 modules/openapi-generator-maven-plugin/examples/camel.xml create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/application.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/errorProcessor.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/exampleString.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/exampleStringArray.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/pom.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/restConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/routesImpl.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-camel-server/validation.mustache create mode 100644 samples/server/petstore/java-camel/.openapi-generator-ignore create mode 100644 samples/server/petstore/java-camel/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-camel/.openapi-generator/VERSION create mode 100644 samples/server/petstore/java-camel/README.md create mode 100644 samples/server/petstore/java-camel/pom.xml create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/RFC3339DateFormat.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/RestConfiguration.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/ValidationErrorProcessor.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiRoutesImpl.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiValidator.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiRoutesImpl.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiValidator.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiRoutesImpl.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiValidator.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java create mode 100644 samples/server/petstore/java-camel/src/main/resources/application.properties create mode 100644 samples/server/petstore/java-camel/src/test/java/org/openapitools/api/PetApiTest.java create mode 100644 samples/server/petstore/java-camel/src/test/java/org/openapitools/api/StoreApiTest.java create mode 100644 samples/server/petstore/java-camel/src/test/java/org/openapitools/api/UserApiTest.java diff --git a/bin/configs/java-camel-petstore-new.yaml b/bin/configs/java-camel-petstore-new.yaml new file mode 100644 index 00000000000..51f66553da7 --- /dev/null +++ b/bin/configs/java-camel-petstore-new.yaml @@ -0,0 +1,17 @@ +generatorName: java-camel +outputDir: samples/server/petstore/java-camel +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/java-camel-server +additionalProperties: + oas3: "true" + hideGenerationTimestamp: true + camelRestBindingMode: "auto" + performBeanValidation: true + #dateLibrary: "java8-localdatetime" + camelDataformatProperties: "json.out.disableFeatures=WRITE_DATES_AS_TIMESTAMPS" + library: "spring-boot" + withXml: true + jackson: true + camelUseDefaulValidationtErrorProcessor: true + camelRestClientRequestValidation: true + camelSecurityDefinitions: true diff --git a/docs/generators.md b/docs/generators.md index 5bd6cadfa00..dc04b6f7452 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -97,6 +97,7 @@ The following generators are available: * [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md) * [haskell](generators/haskell.md) * [haskell-yesod (beta)](generators/haskell-yesod.md) +* [java-camel](generators/java-camel.md) * [java-inflector](generators/java-inflector.md) * [java-msf4j](generators/java-msf4j.md) * [java-pkmst](generators/java-pkmst.md) diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md new file mode 100644 index 00000000000..0f2631991b6 --- /dev/null +++ b/docs/generators/java-camel.md @@ -0,0 +1,314 @@ +--- +title: Config Options for java-camel +sidebar_label: java-camel +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false| +|apiPackage|package for generated api classes| |org.openapitools.api| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-spring| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|async|use async Callable controllers| |false| +|basePackage|base package (invokerPackage) for generated code| |org.openapitools| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelDataformatProperties|list of dataformat properties separated by comma (propertyName1=propertyValue2,...| || +|camelRestBindingMode|binding mode to be used by the REST consumer| |auto| +|camelRestClientRequestValidation|enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration| |false| +|camelRestComponent|name of the Camel component to use as the REST consumer| |servlet| +|camelSecurityDefinitions|generate camel security definitions| |true| +|camelUseDefaulValidationtErrorProcessor|generate default validation error processor| |true| +|camelValidationErrorProcessor|validation error processor bean name| |validationErrorProcessor| +|configPackage|configuration package for generated code| |org.openapitools.configuration| +|dateLibrary|Option. Date library to use|

**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date (if you really have a good reason not to use threetenbp
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
**threetenbp**
Backport of JSR310 (preferred for jdk < 1.8)
|threetenbp| +|delegatePattern|Whether to generate the server files using the delegate pattern| |false| +|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| +|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| +|invokerPackage|root package for generated code| |org.openapitools.api| +|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used. IMPORTANT: This option has been deprecated as Java 8 is the default.
**false**
Various third party libraries as needed
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|library|library template (sub-template)|
**spring-boot**
Spring-boot Server application using the SpringFox integration.
**spring-mvc**
Spring-MVC Server application using the SpringFox integration.
**spring-cloud**
Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
|spring-boot| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| +|oas3|Use OAS 3 Swagger annotations instead of OAS 2 annotations| |false| +|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|performBeanValidation|Use Bean Validation Impl. to perform BeanValidation| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|reactive|wrap responses in Mono/Flux Reactor types (spring-boot only)| |false| +|responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| +|returnSuccessCode|Generated server returns 2xx code| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false| +|skipDefaultInterface|Whether to generate default implementations for java8 interfaces| |false| +|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/main/java| +|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| +|title|server title name or client service name| |OpenAPI Spring| +|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| +|useBeanValidation|Use BeanValidation API annotations| |true| +|useOptional|Use Optional container for optional parameters| |false| +|useSpringController|Annotate the generated API as a Spring Controller| |false| +|useTags|use tags for creating interface and controller classnames| |false| +|virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|BigDecimal|java.math.BigDecimal| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ArrayList| +|map|HashMap| +|set|LinkedHashSet| + + +## LANGUAGE PRIMITIVES + +
    +
  • Boolean
  • +
  • Double
  • +
  • Float
  • +
  • Integer
  • +
  • Long
  • +
  • Object
  • +
  • String
  • +
  • boolean
  • +
  • byte[]
  • +
+ +## RESERVED WORDS + +
    +
  • abstract
  • +
  • apiclient
  • +
  • apiexception
  • +
  • apiresponse
  • +
  • assert
  • +
  • boolean
  • +
  • break
  • +
  • byte
  • +
  • case
  • +
  • catch
  • +
  • char
  • +
  • class
  • +
  • configuration
  • +
  • const
  • +
  • continue
  • +
  • default
  • +
  • do
  • +
  • double
  • +
  • else
  • +
  • enum
  • +
  • extends
  • +
  • final
  • +
  • finally
  • +
  • float
  • +
  • for
  • +
  • goto
  • +
  • if
  • +
  • implements
  • +
  • import
  • +
  • instanceof
  • +
  • int
  • +
  • interface
  • +
  • localreturntype
  • +
  • localvaraccept
  • +
  • localvaraccepts
  • +
  • localvarauthnames
  • +
  • localvarcollectionqueryparams
  • +
  • localvarcontenttype
  • +
  • localvarcontenttypes
  • +
  • localvarcookieparams
  • +
  • localvarformparams
  • +
  • localvarheaderparams
  • +
  • localvarpath
  • +
  • localvarpostbody
  • +
  • localvarqueryparams
  • +
  • long
  • +
  • native
  • +
  • new
  • +
  • null
  • +
  • object
  • +
  • package
  • +
  • private
  • +
  • protected
  • +
  • public
  • +
  • return
  • +
  • short
  • +
  • static
  • +
  • strictfp
  • +
  • stringutil
  • +
  • super
  • +
  • switch
  • +
  • synchronized
  • +
  • this
  • +
  • throw
  • +
  • throws
  • +
  • transient
  • +
  • try
  • +
  • void
  • +
  • volatile
  • +
  • while
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✓|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✗|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✓|OAS2,OAS3 diff --git a/modules/openapi-generator-maven-plugin/examples/camel.xml b/modules/openapi-generator-maven-plugin/examples/camel.xml new file mode 100644 index 00000000000..afcc2632bc3 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/examples/camel.xml @@ -0,0 +1,198 @@ + + 4.0.0 + org.openapitools + sample-project + jar + 1.0-SNAPSHOT + sample-project + https://maven.apache.org + + + + + + + org.openapitools + openapi-generator-maven-plugin + + 5.3.1-SNAPSHOT + + + + camel-server + + generate + + + + ${project.basedir}/swagger.yaml + + + camel + + + + + + auto + true + true + json.out.disableFeatures=WRITE_DATES_AS_TIMESTAMPS + true + true + true + + true + true + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + none + + + + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + + + + + org.apache.camel + camel-bom + 3.13.0 + pom + import + + + org.apache.camel.springboot + camel-spring-boot-bom + 3.13.0 + pom + import + + + org.springframework.boot + spring-boot-dependencies + 2.6.1 + pom + import + + + + + + + org.apache.camel.springboot + camel-spring-boot-starter + + + + org.apache.camel.springboot + camel-servlet-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.openapitools + jackson-databind-nullable + 0.2.1 + + + io.swagger + swagger-annotations + 1.6.3 + + + io.swagger.core.v3 + swagger-annotations + 2.1.11 + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.13.0 + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + 2.13.0 + + + org.apache.camel + camel-jackson + + + org.apache.camel + camel-jacksonxml + + + + org.apache.camel + camel-jaxb + + + org.apache.camel + camel-direct + + + + org.apache.camel + camel-bean-validator + + + + + com.mashape.unirest + unirest-java + 1.4.9 + test + + + + org.apache.camel + camel-test-spring-junit5 + test + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + 1.5.8 + + 2.2.1.RELEASE + 2.8.0 + + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java new file mode 100644 index 00000000000..39240ff329e --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java @@ -0,0 +1,186 @@ +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.Operation; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.languages.features.OptionalFeatures; +import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidationFeatures, PerformBeanValidationFeatures, OptionalFeatures { + private static final String APPLICATION_JSON = "application/json"; + private static final String APPLICATION_XML = "application/xml"; + + public static final String PROJECT_NAME = "projectName"; + public static final String CAMEL_REST_COMPONENT = "camelRestComponent"; + public static final String CAMEL_REST_BINDING_MODE = "camelRestBindingMode"; + public static final String CAMEL_REST_CLIENT_REQUEST_VALIDATION = "camelRestClientRequestValidation"; + public static final String CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR = "camelUseDefaulValidationtErrorProcessor"; + public static final String CAMEL_VALIDATION_ERROR_PROCESSOR = "camelValidationErrorProcessor"; + public static final String CAMEL_SECURITY_DEFINITIONS = "camelSecurityDefinitions"; + public static final String CAMEL_DATAFORMAT_PROPERTIES = "camelDataformatProperties"; + + private String camelRestComponent = "servlet"; + private String camelRestBindingMode = "auto"; + private boolean camelRestClientRequestValidation = false; + private boolean camelUseDefaulValidationtErrorProcessor = true; + private String camelValidationErrorProcessor = "validationErrorProcessor"; + private boolean camelSecurityDefinitions = true; + private String camelDataformatProperties = ""; + + private final Logger LOGGER = LoggerFactory.getLogger(JavaCamelServerCodegen.class); + + public CodegenType getTag() { + return CodegenType.SERVER; + } + + public String getName() { + return "java-camel"; + } + + public String getHelp() { + return "Generates a camel server."; + } + + public JavaCamelServerCodegen() { + super(); + templateDir = "java-camel-server"; + addCliOptions(); + artifactId = "openapi-camel"; + super.library = ""; + } + + @Override + public void processOpts() { + if (!additionalProperties.containsKey(DATE_LIBRARY)) { + additionalProperties.put(DATE_LIBRARY, "legacy"); + } + super.processOpts(); + super.apiTemplateFiles.remove("apiController.mustache"); + LOGGER.info("***** Java Apache Camel Server Generator *****"); + supportingFiles.clear(); + manageAdditionalProperties(); + + Map dataFormatProperties = new HashMap<>(); + if (!"off".equals(camelRestBindingMode)) { + Arrays.stream(camelDataformatProperties.split(",")).forEach(property -> { + String[] dataFormatProperty = property.split("="); + if (dataFormatProperty.length == 2) { + dataFormatProperties.put(dataFormatProperty[0].trim(), dataFormatProperty[1].trim()); + } + }); + } + additionalProperties.put(CAMEL_DATAFORMAT_PROPERTIES, dataFormatProperties.entrySet()); + + supportingFiles.add(new SupportingFile("restConfiguration.mustache", + (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), + "RestConfiguration.java")); + if (performBeanValidation) { + apiTemplateFiles.put("validation.mustache", "Validator.java"); + if (camelUseDefaulValidationtErrorProcessor) { + supportingFiles.add(new SupportingFile("errorProcessor.mustache", + (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), + "ValidationErrorProcessor.java")); + } + } + if (SPRING_BOOT.equals(library)) { + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("openapi2SpringBoot.mustache", + (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), + "OpenAPI2SpringBoot.java")); + + if (!interfaceOnly) { + apiTemplateFiles.put("routesImpl.mustache", "RoutesImpl.java"); + } + + supportingFiles.add(new SupportingFile("application.mustache", + ("src.main.resources").replace(".", java.io.File.separator), "application.properties")); + supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); + supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", + (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), + "RFC3339DateFormat.java")); + apiTestTemplateFiles.put("test.mustache", ".java"); + } + } + + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { + boolean bindingModeOff = false; + if (co.hasProduces) { + for (Map produces : co.produces) { + String mediaType = produces.get("mediaType"); + if (!APPLICATION_JSON.equals(mediaType) && !APPLICATION_XML.equals(mediaType)) { + bindingModeOff = true; + } + if (APPLICATION_JSON.equals(mediaType)) { + produces.put("isJson", "true"); + } + if (APPLICATION_XML.equals(mediaType)) { + produces.put("isXml", "true"); + } + } + } + if (co.hasConsumes) { + for (Map consumes : co.consumes) { + String mediaType = consumes.get("mediaType"); + if (!APPLICATION_JSON.equals(mediaType) && !APPLICATION_XML.equals(mediaType)) { + bindingModeOff = true; + } + if (APPLICATION_JSON.equals(mediaType)) { + consumes.put("isJson", "true"); + } + if (APPLICATION_XML.equals(mediaType)) { + consumes.put("isXml", "true"); + } + } + } + co.vendorExtensions.put(CAMEL_REST_BINDING_MODE, bindingModeOff); + super.addOperationToGroup(tag, resourcePath, operation, co, operations); + } + + private void addCliOptions() { + cliOptions.add(new CliOption(CAMEL_REST_COMPONENT, "name of the Camel component to use as the REST consumer").defaultValue(camelRestComponent)); + cliOptions.add(new CliOption(CAMEL_REST_BINDING_MODE, "binding mode to be used by the REST consumer").defaultValue(camelRestBindingMode)); + cliOptions.add(CliOption.newBoolean(CAMEL_REST_CLIENT_REQUEST_VALIDATION, "enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration", camelRestClientRequestValidation)); + cliOptions.add(CliOption.newBoolean(CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR, "generate default validation error processor", camelUseDefaulValidationtErrorProcessor)); + cliOptions.add(new CliOption(CAMEL_VALIDATION_ERROR_PROCESSOR, "validation error processor bean name").defaultValue(camelValidationErrorProcessor)); + cliOptions.add(CliOption.newBoolean(CAMEL_SECURITY_DEFINITIONS, "generate camel security definitions", camelSecurityDefinitions)); + cliOptions.add(new CliOption(CAMEL_DATAFORMAT_PROPERTIES, "list of dataformat properties separated by comma (propertyName1=propertyValue2,...").defaultValue(camelDataformatProperties)); + } + + private void manageAdditionalProperties() { + camelRestComponent = manageAdditionalProperty(CAMEL_REST_COMPONENT, camelRestComponent); + camelRestBindingMode = manageAdditionalProperty(CAMEL_REST_BINDING_MODE, camelRestBindingMode); + camelRestClientRequestValidation = manageAdditionalProperty(CAMEL_REST_CLIENT_REQUEST_VALIDATION, camelRestClientRequestValidation); + camelUseDefaulValidationtErrorProcessor = manageAdditionalProperty(CAMEL_USE_DEFAULT_VALIDATION_ERROR_PROCESSOR, camelUseDefaulValidationtErrorProcessor); + camelValidationErrorProcessor = manageAdditionalProperty(CAMEL_VALIDATION_ERROR_PROCESSOR, camelValidationErrorProcessor); + camelSecurityDefinitions = manageAdditionalProperty(CAMEL_SECURITY_DEFINITIONS, camelSecurityDefinitions); + camelDataformatProperties = manageAdditionalProperty(CAMEL_DATAFORMAT_PROPERTIES, camelDataformatProperties); + } + + private T manageAdditionalProperty(String propertyName, T defaultValue) { + if (additionalProperties.containsKey(propertyName)) { + Object propertyValue = additionalProperties.get(propertyName); + if (defaultValue instanceof Boolean && !(propertyValue instanceof Boolean)) { + return (T) manageBooleanAdditionalProperty((String) propertyValue); + } + return (T) additionalProperties.get(propertyName); + } + additionalProperties.put(propertyName, defaultValue); + return defaultValue; + } + + private Boolean manageBooleanAdditionalProperty(String propertyValue) { + return Boolean.parseBoolean(propertyValue); + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index c353b2a2846..d5911a2139b 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -141,3 +141,5 @@ org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen org.openapitools.codegen.languages.WsdlSchemaCodegen + +org.openapitools.codegen.languages.JavaCamelServerCodegen diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/README.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/README.mustache new file mode 100644 index 00000000000..e20452e8492 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/README.mustache @@ -0,0 +1,7 @@ +# OpenAPI generated server + +Apache Camel Server + +```bash +mvn clean test +``` \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache new file mode 100644 index 00000000000..6e6e769904f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/api.mustache @@ -0,0 +1,95 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package {{apiPackage}}; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.rest.RestParamType; +import org.springframework.stereotype.Component; +import {{modelPackage}}.*; +import org.apache.camel.model.rest.RestBindingMode; +import org.apache.camel.LoggingLevel; + +@Component +public class {{classname}} extends RouteBuilder { + + @Override + public void configure() throws Exception { + {{#performBeanValidation}} + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("{{camelValidationErrorProcessor}}"); + {{/performBeanValidation}} + {{#operations}}{{#operation}} + + /** + {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} + **/ + rest(){{#camelSecurityDefinitions}}{{#hasAuthMethods}} + .securityDefinitions(){{#authMethods}}{{#isOAuth}} + .oauth2("{{name}}"){{#flow}} + .flow("{{flow}}"){{/flow}}{{#tokenUrl}} + .tokenUrl("{{tokenUrl}}"){{/tokenUrl}}{{#authorizationUrl}} + .authorizationUrl("{{authorizationUrl}}"){{/authorizationUrl}}{{#refreshUrl}} + .refreshUrl("{{refreshUrl}}"){{/refreshUrl}}{{#scopes}} + .withScope("{{scope}}"{{#description}},"{{{.}}}"{{/description}}){{/scopes}} + {{^-last}}.end(){{/-last}}{{#-last}} + .endSecurityDefinition(){{/-last}}{{/isOAuth}}{{#isApiKey}} + .apiKey("{{name}}"){{#isKeyInHeader}} + .withHeader("{{name}}"){{/isKeyInHeader}}{{#isKeyInQuery}} + .withQuery("{{name}}").{{/isKeyInQuery}}{{#isKeyInCookie}} + .withCookie("{{name}}").{{/isKeyInCookie}} + {{^-last}}.end(){{/-last}}{{#-last}} + .endSecurityDefinition(){{/-last}}{{/isApiKey}}{{#isBasic}}{{#isBasicBasic}} + .basicAuth("{{name}}"){{#-last}}.end(){{/-last}}{{/isBasicBasic}}{{#isBasicBearer}} + .bearerToken("{{name}}"{{#bearerFormat}}, "{{bearerFormat}}"{{/bearerFormat}}){{#-last}}.end(){{/-last}}{{/isBasicBearer}}{{/isBasic}}{{/authMethods}}{{/hasAuthMethods}}{{/camelSecurityDefinitions}} + .{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}("{{path}}") + .description("{{#summary}}{{{.}}}{{/summary}}") + .id("{{operationId}}Api"){{#vendorExtensions}}{{#camelRestBindingMode}} + .clientRequestValidation(false) + .bindingMode(RestBindingMode.off){{/camelRestBindingMode}}{{/vendorExtensions}}{{#hasProduces}} + .produces("{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}"){{^isArray}}{{^isMap}}{{^isPrimitiveType}} + .outType({{returnType}}.class){{/isPrimitiveType}}{{/isMap}}{{/isArray}}{{#isArray}} + .outType({{returnBaseType}}[].class){{/isArray}}{{/hasProduces}}{{#hasConsumes}} + .consumes("{{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}"){{#bodyParams}}{{^isArray}}{{^isMap}}{{^isPrimitiveType}} + .type({{baseType}}.class){{/isPrimitiveType}}{{/isMap}}{{/isArray}}{{#isArray}} + .type({{baseType}}[].class){{/isArray}}{{/bodyParams}} + {{/hasConsumes}}{{#pathParams}} + .param() + .name("{{paramName}}") + .type(RestParamType.path) + .required({{required}}){{#description}} + .description("{{{.}}}"){{/description}} + .endParam(){{/pathParams}}{{#queryParams}} + .param() + .name("{{paramName}}") + .type(RestParamType.query) + .required({{required}}){{#description}} + .description("{{{.}}}"){{/description}} + .endParam(){{/queryParams}}{{#headerParams}} + .param() + .name("{{paramName}}") + .type(RestParamType.header) + .required({{required}}){{#description}} + .description("{{{.}}}"){{/description}} + .endParam(){{/headerParams}}{{#bodyParams}} + .param() + .name("{{paramName}}") + .type(RestParamType.body) + .required({{required}}){{#description}} + .description("{{{.}}}"){{/description}} + .endParam(){{/bodyParams}}{{#formParams}} + .param() + .name("{{paramName}}") + .type(RestParamType.formData) + .required({{required}}){{#description}} + .description("{{{.}}}"){{/description}} + .endParam(){{/formParams}}{{#performBeanValidation}} + .to("direct:validate-{{operationId}}");{{/performBeanValidation}}{{^performBeanValidation}} + .to("direct:{{operationId}}");{{/performBeanValidation}} + {{/operation}}{{/operations}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/application.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/application.mustache new file mode 100644 index 00000000000..1975bd19530 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/application.mustache @@ -0,0 +1,8 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +# https://openapi-generator.tech +# Do not edit the class manually. + +camel.springboot.name=camel-{{artifactId}} +camel.servlet.mapping.context-path=/api/v1/* + +server.port=8080 \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/errorProcessor.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/errorProcessor.mustache new file mode 100644 index 00000000000..0df67de43bb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/errorProcessor.mustache @@ -0,0 +1,33 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package {{basePackage}}; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.bean.validator.BeanValidationException; +import org.springframework.stereotype.Component; +{{#jackson}} +import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException;{{/jackson}} + +@Component("{{camelValidationErrorProcessor}}") +public class ValidationErrorProcessor implements Processor { + + @Override + public void process(Exchange exchange) throws Exception { + Exception fault = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class); + int httpStatusCode = 500; + if (fault instanceof BeanValidationException) { + httpStatusCode = 400; + } + {{#jackson}} + if (fault instanceof UnrecognizedPropertyException) { + httpStatusCode = 400; + } + {{/jackson}} + exchange.getIn().setHeader(Exchange.HTTP_RESPONSE_CODE, httpStatusCode); + exchange.getIn().setBody(fault.getMessage()); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/exampleString.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/exampleString.mustache new file mode 100644 index 00000000000..1f72a330ef6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/exampleString.mustache @@ -0,0 +1 @@ +{{#lambdaSplitString}}{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{#lambdaTrimWhitespace}}{{{example}}}{{/lambdaTrimWhitespace}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}{{/lambdaSplitString}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/exampleStringArray.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/exampleStringArray.mustache new file mode 100644 index 00000000000..99e5f81bdb8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/exampleStringArray.mustache @@ -0,0 +1 @@ +{{#lambdaSplitString}}{{#lambdaRemoveLineBreak}}{{#lambdaEscapeDoubleQuote}}{{#lambdaTrimWhitespace}}[{{{example}}}]{{/lambdaTrimWhitespace}}{{/lambdaEscapeDoubleQuote}}{{/lambdaRemoveLineBreak}}{{/lambdaSplitString}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/pom.mustache new file mode 100644 index 00000000000..d7c006cc40c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/pom.mustache @@ -0,0 +1,193 @@ + + + + 4.0.0 + + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + 2.6.2 + 3.14.0 + + + + + + org.apache.camel + camel-bom + ${org.apache.camel.version} + pom + import + + + org.apache.camel.springboot + camel-spring-boot-bom + ${org.apache.camel.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${org.springframework.boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + maven-surefire-plugin + 2.22.2 + + + + + + + org.apache.camel.springboot + camel-spring-boot-starter + + + + org.apache.camel.springboot + camel-servlet-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.openapitools + jackson-databind-nullable + 0.2.1 + + + io.swagger + swagger-annotations + 1.6.3 + + {{#oas3}} + + io.swagger.core.v3 + swagger-annotations + 2.1.11 + + {{/oas3}} + {{#jackson}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.13.0 + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + 2.13.0 + + + org.apache.camel + camel-jackson + + {{#withXml}} + + org.apache.camel + camel-jacksonxml + + {{/withXml}}{{/jackson}} + {{#withXml}} + + org.apache.camel + camel-jaxb + + {{/withXml}} + + org.apache.camel + camel-direct + + + {{#useBeanValidation}} + + org.apache.camel + camel-bean-validator + + {{/useBeanValidation}} + + + + com.mashape.unirest + unirest-java + 1.4.9 + test + + + + org.apache.camel + camel-test-spring-junit5 + test + + + + org.springframework.boot + spring-boot-starter-test + test + + + + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/restConfiguration.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/restConfiguration.mustache new file mode 100644 index 00000000000..44af274af40 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/restConfiguration.mustache @@ -0,0 +1,22 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package {{apiPackage}}; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.model.rest.RestBindingMode; + +@Component +public class RestConfiguration extends RouteBuilder { + @Override + public void configure() throws Exception { + restConfiguration() + .component("{{camelRestComponent}}") + .bindingMode(RestBindingMode.{{camelRestBindingMode}}){{#camelDataformatProperties}} + .dataFormatProperty("{{key}}", "{{value}}"){{/camelDataformatProperties}} + .clientRequestValidation({{camelRestClientRequestValidation}}); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/routesImpl.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/routesImpl.mustache new file mode 100644 index 00000000000..427aa3021d7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/routesImpl.mustache @@ -0,0 +1,34 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package {{apiPackage}}; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; +import {{modelPackage}}.*; +import org.apache.camel.model.dataformat.JsonLibrary; + +@Component +public class {{classname}}RoutesImpl extends RouteBuilder { + @Override + public void configure() throws Exception { + {{#operations}}{{#operation}} + /** + {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} + **/ + from("direct:{{operationId}}") + .id("{{operationId}}") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"){{#hasProduces}}{{#examples}}{{#-first}}{{^isArray}}{{^isMap}}{{^isPrimitiveType}} + .setBody(constant({{>exampleString}})) + .unmarshal().json(JsonLibrary.Jackson, {{returnType}}.class){{/isPrimitiveType}}{{/isMap}}{{/isArray}}{{#isArray}} + .setBody(constant({{>exampleStringArray}})) + .unmarshal().json(JsonLibrary.Jackson, {{returnBaseType}}[].class){{/isArray}}{{/-first}}{{/examples}}{{/hasProduces}};{{/operation}}{{/operations}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache new file mode 100644 index 00000000000..677f0e522ac --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/test.mustache @@ -0,0 +1,63 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package {{apiPackage}}; + +import org.junit.jupiter.api.Test; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.springframework.boot.test.context.SpringBootTest; +import com.mashape.unirest.request.HttpRequest; +import com.mashape.unirest.request.HttpRequestWithBody; +import com.mashape.unirest.http.Unirest; +import com.mashape.unirest.http.JsonNode; +import com.mashape.unirest.http.HttpResponse; +import java.io.InputStream; +import org.junit.jupiter.api.Assertions; + +@CamelSpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +public class {{classname}}Test { + private static final String API_URL = "http://127.0.0.1:8080/api/v1"; +{{#operations}}{{#operation}}{{#examples}}{{#-first}}{{#vendorExtensions}}{{^camelRestBindingMode}} + @Test + public void {{operationId}}TestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "{{path}}"; + HttpRequest httpRequest = Unirest.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(url);{{#hasConsumes}} + httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}} + httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}} + httpRequest = httpRequest.routeParam("{{paramName}}", "1");{{/pathParams}}{{#queryParams}} + httpRequest = httpRequest.queryString("{{paramName}}", "1");{{/queryParams}} + {{#hasConsumes}}{{#examples}}{{#-first}} + String requestBody = {{>exampleString}}; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + {{/-first}}{{/examples}}{{/hasConsumes}} + {{#hasProduces}}{{#produces}}{{#isJson}} + HttpResponse httpResponse = httpRequest.asJson();{{/isJson}}{{/produces}}{{/hasProduces}}{{^hasProduces}} + HttpResponse httpResponse = httpRequest.asBinary();{{/hasProduces}} + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + {{#examples}}{{#-last}}{{^isArray}} + @Test + public void {{operationId}}TestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "{{path}}"; + HttpRequest httpRequest = Unirest.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(url);{{#hasConsumes}} + httpRequest = httpRequest.header("Content-Type", contentType);{{/hasConsumes}}{{#hasProduces}} + httpRequest = httpRequest.header("Accept", accept);{{/hasProduces}}{{#pathParams}} + httpRequest = httpRequest.routeParam("{{paramName}}", "1");{{/pathParams}}{{#queryParams}} + httpRequest = httpRequest.queryString("{{paramName}}", "1");{{/queryParams}} + {{#hasConsumes}}{{#examples}}{{^-first}} + String requestBody = {{>exampleString}}; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + {{/-first}}{{/examples}}{{/hasConsumes}} + {{#hasProduces}}{{#produces}}{{#isXml}} + HttpResponse httpResponse = httpRequest.asString();{{/isXml}}{{/produces}}{{/hasProduces}}{{^hasProduces}} + HttpResponse httpResponse = httpRequest.asBinary();{{/hasProduces}} + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + }{{/isArray}}{{/-last}}{{/examples}}{{/camelRestBindingMode}}{{/vendorExtensions}}{{/-first}}{{/examples}}{{/operation}}{{/operations}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-camel-server/validation.mustache b/modules/openapi-generator/src/main/resources/java-camel-server/validation.mustache new file mode 100644 index 00000000000..27aa2ce4ec7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-camel-server/validation.mustache @@ -0,0 +1,28 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package {{apiPackage}}; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; + +@Component +public class {{classname}}Validator extends RouteBuilder { + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("{{camelValidationErrorProcessor}}"); + {{#operations}}{{#operation}} + from("direct:validate-{{operationId}}") + .id("validate-{{operationId}}"){{#hasConsumes}} + .to("bean-validator://validate-request"){{/hasConsumes}} + .to("direct:{{operationId}}"){{^hasProduces}};{{/hasProduces}}{{#hasProduces}} + .to("bean-validator://validate-response");{{/hasProduces}} + {{/operation}}{{/operations}} + } +} diff --git a/samples/server/petstore/java-camel/.openapi-generator-ignore b/samples/server/petstore/java-camel/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-camel/.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/server/petstore/java-camel/.openapi-generator/FILES b/samples/server/petstore/java-camel/.openapi-generator/FILES new file mode 100644 index 00000000000..4c9d78d30eb --- /dev/null +++ b/samples/server/petstore/java-camel/.openapi-generator/FILES @@ -0,0 +1,22 @@ +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/RestConfiguration.java +src/main/java/org/openapitools/ValidationErrorProcessor.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiRoutesImpl.java +src/main/java/org/openapitools/api/PetApiValidator.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiRoutesImpl.java +src/main/java/org/openapitools/api/StoreApiValidator.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiRoutesImpl.java +src/main/java/org/openapitools/api/UserApiValidator.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java +src/main/resources/application.properties diff --git a/samples/server/petstore/java-camel/.openapi-generator/VERSION b/samples/server/petstore/java-camel/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/server/petstore/java-camel/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-camel/README.md b/samples/server/petstore/java-camel/README.md new file mode 100644 index 00000000000..e20452e8492 --- /dev/null +++ b/samples/server/petstore/java-camel/README.md @@ -0,0 +1,7 @@ +# OpenAPI generated server + +Apache Camel Server + +```bash +mvn clean test +``` \ No newline at end of file diff --git a/samples/server/petstore/java-camel/pom.xml b/samples/server/petstore/java-camel/pom.xml new file mode 100644 index 00000000000..8391657c52f --- /dev/null +++ b/samples/server/petstore/java-camel/pom.xml @@ -0,0 +1,185 @@ + + + + 4.0.0 + + org.openapitools + openapi-camel + jar + openapi-camel + 1.0.0 + + + 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 + + + + + 2.6.2 + 3.14.0 + + + + + + org.apache.camel + camel-bom + ${org.apache.camel.version} + pom + import + + + org.apache.camel.springboot + camel-spring-boot-bom + ${org.apache.camel.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${org.springframework.boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + maven-surefire-plugin + 2.22.2 + + + + + + + org.apache.camel.springboot + camel-spring-boot-starter + + + + org.apache.camel.springboot + camel-servlet-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.openapitools + jackson-databind-nullable + 0.2.1 + + + io.swagger + swagger-annotations + 1.6.3 + + + io.swagger.core.v3 + swagger-annotations + 2.1.11 + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.13.0 + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + 2.13.0 + + + org.apache.camel + camel-jackson + + + org.apache.camel + camel-jacksonxml + + + + org.apache.camel + camel-jaxb + + + org.apache.camel + camel-direct + + + + org.apache.camel + camel-bean-validator + + + + + com.mashape.unirest + unirest-java + 1.4.9 + test + + + + org.apache.camel + camel-test-spring-junit5 + test + + + + org.springframework.boot + spring-boot-starter-test + test + + + + \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java new file mode 100644 index 00000000000..7caef40973e --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -0,0 +1,64 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenAPI2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(OpenAPI2SpringBoot.class).run(args); + } + + static class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } + + @Bean + public WebMvcConfigurer webConfigurer() { + return new WebMvcConfigurerAdapter() { + /*@Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("*") + .allowedHeaders("Content-Type"); + }*/ + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); + } + }; + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/RFC3339DateFormat.java new file mode 100644 index 00000000000..bcd3936d8b3 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/RestConfiguration.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/RestConfiguration.java new file mode 100644 index 00000000000..f9273736a2f --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/RestConfiguration.java @@ -0,0 +1,22 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.model.rest.RestBindingMode; + +@Component +public class RestConfiguration extends RouteBuilder { + @Override + public void configure() throws Exception { + restConfiguration() + .component("servlet") + .bindingMode(RestBindingMode.auto) + .dataFormatProperty("json.out.disableFeatures", "WRITE_DATES_AS_TIMESTAMPS") + .clientRequestValidation(true); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/ValidationErrorProcessor.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/ValidationErrorProcessor.java new file mode 100644 index 00000000000..d74fcf78d21 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/ValidationErrorProcessor.java @@ -0,0 +1,30 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.bean.validator.BeanValidationException; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; + +@Component("validationErrorProcessor") +public class ValidationErrorProcessor implements Processor { + + @Override + public void process(Exchange exchange) throws Exception { + Exception fault = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class); + int httpStatusCode = 500; + if (fault instanceof BeanValidationException) { + httpStatusCode = 400; + } + if (fault instanceof UnrecognizedPropertyException) { + httpStatusCode = 400; + } + exchange.getIn().setHeader(Exchange.HTTP_RESPONSE_CODE, httpStatusCode); + exchange.getIn().setBody(fault.getMessage()); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 00000000000..01d874fca95 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,268 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.rest.RestParamType; +import org.springframework.stereotype.Component; +import org.openapitools.model.*; +import org.apache.camel.model.rest.RestBindingMode; +import org.apache.camel.LoggingLevel; + +@Component +public class PetApi extends RouteBuilder { + + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("validationErrorProcessor"); + + + /** + POST /pet : Add a new pet to the store + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("write:pets","modify pets in your account") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .post("/pet") + .description("Add a new pet to the store") + .id("addPetApi") + .produces("application/xml, application/json") + .outType(Pet.class) + .consumes("application/json, application/xml") + .type(Pet.class) + + .param() + .name("pet") + .type(RestParamType.body) + .required(true) + .description("Pet object that needs to be added to the store") + .endParam() + .to("direct:validate-addPet"); + + + /** + DELETE /pet/{petId} : Deletes a pet + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("write:pets","modify pets in your account") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .delete("/pet/{petId}") + .description("Deletes a pet") + .id("deletePetApi") + .param() + .name("petId") + .type(RestParamType.path) + .required(true) + .description("Pet id to delete") + .endParam() + .param() + .name("apiKey") + .type(RestParamType.header) + .required(false) + .endParam() + .to("direct:validate-deletePet"); + + + /** + GET /pet/findByStatus : Finds Pets by status + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .get("/pet/findByStatus") + .description("Finds Pets by status") + .id("findPetsByStatusApi") + .produces("application/xml, application/json") + .outType(Pet[].class) + .param() + .name("status") + .type(RestParamType.query) + .required(true) + .description("Status values that need to be considered for filter") + .endParam() + .to("direct:validate-findPetsByStatus"); + + + /** + GET /pet/findByTags : Finds Pets by tags + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .get("/pet/findByTags") + .description("Finds Pets by tags") + .id("findPetsByTagsApi") + .produces("application/xml, application/json") + .outType(Pet[].class) + .param() + .name("tags") + .type(RestParamType.query) + .required(true) + .description("Tags to filter by") + .endParam() + .to("direct:validate-findPetsByTags"); + + + /** + GET /pet/{petId} : Find pet by ID + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .get("/pet/{petId}") + .description("Find pet by ID") + .id("getPetByIdApi") + .produces("application/xml, application/json") + .outType(Pet.class) + .param() + .name("petId") + .type(RestParamType.path) + .required(true) + .description("ID of pet to return") + .endParam() + .to("direct:validate-getPetById"); + + + /** + PUT /pet : Update an existing pet + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("write:pets","modify pets in your account") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .put("/pet") + .description("Update an existing pet") + .id("updatePetApi") + .produces("application/xml, application/json") + .outType(Pet.class) + .consumes("application/json, application/xml") + .type(Pet.class) + + .param() + .name("pet") + .type(RestParamType.body) + .required(true) + .description("Pet object that needs to be added to the store") + .endParam() + .to("direct:validate-updatePet"); + + + /** + POST /pet/{petId} : Updates a pet in the store with form data + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("write:pets","modify pets in your account") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .post("/pet/{petId}") + .description("Updates a pet in the store with form data") + .id("updatePetWithFormApi") + .clientRequestValidation(false) + .bindingMode(RestBindingMode.off) + .consumes("application/x-www-form-urlencoded") + + .param() + .name("petId") + .type(RestParamType.path) + .required(true) + .description("ID of pet that needs to be updated") + .endParam() + .param() + .name("name") + .type(RestParamType.formData) + .required(false) + .description("Updated name of the pet") + .endParam() + .param() + .name("status") + .type(RestParamType.formData) + .required(false) + .description("Updated status of the pet") + .endParam() + .to("direct:validate-updatePetWithForm"); + + + /** + POST /pet/{petId}/uploadImage : uploads an image + **/ + rest() + .securityDefinitions() + .oauth2("petstore_auth") + .flow("implicit") + .authorizationUrl("http://petstore.swagger.io/api/oauth/dialog") + .withScope("write:pets","modify pets in your account") + .withScope("read:pets","read your pets") + + .endSecurityDefinition() + .post("/pet/{petId}/uploadImage") + .description("uploads an image") + .id("uploadFileApi") + .clientRequestValidation(false) + .bindingMode(RestBindingMode.off) + .produces("application/json") + .outType(ModelApiResponse.class) + .consumes("multipart/form-data") + + .param() + .name("petId") + .type(RestParamType.path) + .required(true) + .description("ID of pet to update") + .endParam() + .param() + .name("additionalMetadata") + .type(RestParamType.formData) + .required(false) + .description("Additional data to pass to server") + .endParam() + .param() + .name("file") + .type(RestParamType.formData) + .required(false) + .description("file to upload") + .endParam() + .to("direct:validate-uploadFile"); + + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiRoutesImpl.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiRoutesImpl.java new file mode 100644 index 00000000000..65de1c7c3d5 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiRoutesImpl.java @@ -0,0 +1,112 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; +import org.openapitools.model.*; +import org.apache.camel.model.dataformat.JsonLibrary; + +@Component +public class PetApiRoutesImpl extends RouteBuilder { + @Override + public void configure() throws Exception { + + /** + POST /pet : Add a new pet to the store + **/ + from("direct:addPet") + .id("addPet") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }")) + .unmarshal().json(JsonLibrary.Jackson, Pet.class); + /** + DELETE /pet/{petId} : Deletes a pet + **/ + from("direct:deletePet") + .id("deletePet") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + GET /pet/findByStatus : Finds Pets by status + **/ + from("direct:findPetsByStatus") + .id("findPetsByStatus") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("[{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }]")) + .unmarshal().json(JsonLibrary.Jackson, Pet[].class); + /** + GET /pet/findByTags : Finds Pets by tags + **/ + from("direct:findPetsByTags") + .id("findPetsByTags") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("[{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }]")) + .unmarshal().json(JsonLibrary.Jackson, Pet[].class); + /** + GET /pet/{petId} : Find pet by ID + **/ + from("direct:getPetById") + .id("getPetById") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }")) + .unmarshal().json(JsonLibrary.Jackson, Pet.class); + /** + PUT /pet : Update an existing pet + **/ + from("direct:updatePet") + .id("updatePet") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }")) + .unmarshal().json(JsonLibrary.Jackson, Pet.class); + /** + POST /pet/{petId} : Updates a pet in the store with form data + **/ + from("direct:updatePetWithForm") + .id("updatePetWithForm") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + POST /pet/{petId}/uploadImage : uploads an image + **/ + from("direct:uploadFile") + .id("uploadFile") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }")) + .unmarshal().json(JsonLibrary.Jackson, ModelApiResponse.class); + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiValidator.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiValidator.java new file mode 100644 index 00000000000..f32d4c7d2d8 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/PetApiValidator.java @@ -0,0 +1,64 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; + +@Component +public class PetApiValidator extends RouteBuilder { + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("validationErrorProcessor"); + + from("direct:validate-addPet") + .id("validate-addPet") + .to("bean-validator://validate-request") + .to("direct:addPet") + .to("bean-validator://validate-response"); + + from("direct:validate-deletePet") + .id("validate-deletePet") + .to("direct:deletePet"); + + from("direct:validate-findPetsByStatus") + .id("validate-findPetsByStatus") + .to("direct:findPetsByStatus") + .to("bean-validator://validate-response"); + + from("direct:validate-findPetsByTags") + .id("validate-findPetsByTags") + .to("direct:findPetsByTags") + .to("bean-validator://validate-response"); + + from("direct:validate-getPetById") + .id("validate-getPetById") + .to("direct:getPetById") + .to("bean-validator://validate-response"); + + from("direct:validate-updatePet") + .id("validate-updatePet") + .to("bean-validator://validate-request") + .to("direct:updatePet") + .to("bean-validator://validate-response"); + + from("direct:validate-updatePetWithForm") + .id("validate-updatePetWithForm") + .to("bean-validator://validate-request") + .to("direct:updatePetWithForm"); + + from("direct:validate-uploadFile") + .id("validate-uploadFile") + .to("bean-validator://validate-request") + .to("direct:uploadFile") + .to("bean-validator://validate-response"); + + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 00000000000..55d8651439e --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,97 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.rest.RestParamType; +import org.springframework.stereotype.Component; +import org.openapitools.model.*; +import org.apache.camel.model.rest.RestBindingMode; +import org.apache.camel.LoggingLevel; + +@Component +public class StoreApi extends RouteBuilder { + + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("validationErrorProcessor"); + + + /** + DELETE /store/order/{orderId} : Delete purchase order by ID + **/ + rest() + .delete("/store/order/{orderId}") + .description("Delete purchase order by ID") + .id("deleteOrderApi") + .param() + .name("orderId") + .type(RestParamType.path) + .required(true) + .description("ID of the order that needs to be deleted") + .endParam() + .to("direct:validate-deleteOrder"); + + + /** + GET /store/inventory : Returns pet inventories by status + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .get("/store/inventory") + .description("Returns pet inventories by status") + .id("getInventoryApi") + .produces("application/json") + .to("direct:validate-getInventory"); + + + /** + GET /store/order/{orderId} : Find purchase order by ID + **/ + rest() + .get("/store/order/{orderId}") + .description("Find purchase order by ID") + .id("getOrderByIdApi") + .produces("application/xml, application/json") + .outType(Order.class) + .param() + .name("orderId") + .type(RestParamType.path) + .required(true) + .description("ID of pet that needs to be fetched") + .endParam() + .to("direct:validate-getOrderById"); + + + /** + POST /store/order : Place an order for a pet + **/ + rest() + .post("/store/order") + .description("Place an order for a pet") + .id("placeOrderApi") + .produces("application/xml, application/json") + .outType(Order.class) + .consumes("application/json") + .type(Order.class) + + .param() + .name("order") + .type(RestParamType.body) + .required(true) + .description("order placed for purchasing the pet") + .endParam() + .to("direct:validate-placeOrder"); + + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiRoutesImpl.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiRoutesImpl.java new file mode 100644 index 00000000000..c9fd610e3f2 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiRoutesImpl.java @@ -0,0 +1,64 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; +import org.openapitools.model.*; +import org.apache.camel.model.dataformat.JsonLibrary; + +@Component +public class StoreApiRoutesImpl extends RouteBuilder { + @Override + public void configure() throws Exception { + + /** + DELETE /store/order/{orderId} : Delete purchase order by ID + **/ + from("direct:deleteOrder") + .id("deleteOrder") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + GET /store/inventory : Returns pet inventories by status + **/ + from("direct:getInventory") + .id("getInventory") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + GET /store/order/{orderId} : Find purchase order by ID + **/ + from("direct:getOrderById") + .id("getOrderById") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }")) + .unmarshal().json(JsonLibrary.Jackson, Order.class); + /** + POST /store/order : Place an order for a pet + **/ + from("direct:placeOrder") + .id("placeOrder") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }")) + .unmarshal().json(JsonLibrary.Jackson, Order.class); + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiValidator.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiValidator.java new file mode 100644 index 00000000000..ce6ad820710 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/StoreApiValidator.java @@ -0,0 +1,42 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; + +@Component +public class StoreApiValidator extends RouteBuilder { + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("validationErrorProcessor"); + + from("direct:validate-deleteOrder") + .id("validate-deleteOrder") + .to("direct:deleteOrder"); + + from("direct:validate-getInventory") + .id("validate-getInventory") + .to("direct:getInventory") + .to("bean-validator://validate-response"); + + from("direct:validate-getOrderById") + .id("validate-getOrderById") + .to("direct:getOrderById") + .to("bean-validator://validate-response"); + + from("direct:validate-placeOrder") + .id("validate-placeOrder") + .to("bean-validator://validate-request") + .to("direct:placeOrder") + .to("bean-validator://validate-response"); + + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..3babbf719cc --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,206 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.rest.RestParamType; +import org.springframework.stereotype.Component; +import org.openapitools.model.*; +import org.apache.camel.model.rest.RestBindingMode; +import org.apache.camel.LoggingLevel; + +@Component +public class UserApi extends RouteBuilder { + + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("validationErrorProcessor"); + + + /** + POST /user : Create user + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .post("/user") + .description("Create user") + .id("createUserApi") + .consumes("application/json") + .type(User.class) + + .param() + .name("user") + .type(RestParamType.body) + .required(true) + .description("Created user object") + .endParam() + .to("direct:validate-createUser"); + + + /** + POST /user/createWithArray : Creates list of users with given input array + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .post("/user/createWithArray") + .description("Creates list of users with given input array") + .id("createUsersWithArrayInputApi") + .consumes("application/json") + .type(User[].class) + + .param() + .name("user") + .type(RestParamType.body) + .required(true) + .description("List of user object") + .endParam() + .to("direct:validate-createUsersWithArrayInput"); + + + /** + POST /user/createWithList : Creates list of users with given input array + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .post("/user/createWithList") + .description("Creates list of users with given input array") + .id("createUsersWithListInputApi") + .consumes("application/json") + .type(User[].class) + + .param() + .name("user") + .type(RestParamType.body) + .required(true) + .description("List of user object") + .endParam() + .to("direct:validate-createUsersWithListInput"); + + + /** + DELETE /user/{username} : Delete user + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .delete("/user/{username}") + .description("Delete user") + .id("deleteUserApi") + .param() + .name("username") + .type(RestParamType.path) + .required(true) + .description("The name that needs to be deleted") + .endParam() + .to("direct:validate-deleteUser"); + + + /** + GET /user/{username} : Get user by user name + **/ + rest() + .get("/user/{username}") + .description("Get user by user name") + .id("getUserByNameApi") + .produces("application/xml, application/json") + .outType(User.class) + .param() + .name("username") + .type(RestParamType.path) + .required(true) + .description("The name that needs to be fetched. Use user1 for testing.") + .endParam() + .to("direct:validate-getUserByName"); + + + /** + GET /user/login : Logs user into the system + **/ + rest() + .get("/user/login") + .description("Logs user into the system") + .id("loginUserApi") + .produces("application/xml, application/json") + .outType(String.class) + .param() + .name("username") + .type(RestParamType.query) + .required(true) + .description("The user name for login") + .endParam() + .param() + .name("password") + .type(RestParamType.query) + .required(true) + .description("The password for login in clear text") + .endParam() + .to("direct:validate-loginUser"); + + + /** + GET /user/logout : Logs out current logged in user session + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .get("/user/logout") + .description("Logs out current logged in user session") + .id("logoutUserApi") + .to("direct:validate-logoutUser"); + + + /** + PUT /user/{username} : Updated user + **/ + rest() + .securityDefinitions() + .apiKey("api_key") + .withHeader("api_key") + + .endSecurityDefinition() + .put("/user/{username}") + .description("Updated user") + .id("updateUserApi") + .consumes("application/json") + .type(User.class) + + .param() + .name("username") + .type(RestParamType.path) + .required(true) + .description("name that need to be deleted") + .endParam() + .param() + .name("user") + .type(RestParamType.body) + .required(true) + .description("Updated user object") + .endParam() + .to("direct:validate-updateUser"); + + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiRoutesImpl.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiRoutesImpl.java new file mode 100644 index 00000000000..b2fd13058a0 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiRoutesImpl.java @@ -0,0 +1,102 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; +import org.openapitools.model.*; +import org.apache.camel.model.dataformat.JsonLibrary; + +@Component +public class UserApiRoutesImpl extends RouteBuilder { + @Override + public void configure() throws Exception { + + /** + POST /user : Create user + **/ + from("direct:createUser") + .id("createUser") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + POST /user/createWithArray : Creates list of users with given input array + **/ + from("direct:createUsersWithArrayInput") + .id("createUsersWithArrayInput") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + POST /user/createWithList : Creates list of users with given input array + **/ + from("direct:createUsersWithListInput") + .id("createUsersWithListInput") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + DELETE /user/{username} : Delete user + **/ + from("direct:deleteUser") + .id("deleteUser") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + GET /user/{username} : Get user by user name + **/ + from("direct:getUserByName") + .id("getUserByName") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}") + .setBody(constant("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }")) + .unmarshal().json(JsonLibrary.Jackson, User.class); + /** + GET /user/login : Logs user into the system + **/ + from("direct:loginUser") + .id("loginUser") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + GET /user/logout : Logs out current logged in user session + **/ + from("direct:logoutUser") + .id("logoutUser") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + /** + PUT /user/{username} : Updated user + **/ + from("direct:updateUser") + .id("updateUser") + .choice() + .when(simple("${body} != null")) + .log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}") + .end() + .log(LoggingLevel.INFO, "HEADERS: ${headers}"); + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiValidator.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiValidator.java new file mode 100644 index 00000000000..da259ae0c53 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/api/UserApiValidator.java @@ -0,0 +1,60 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.apache.camel.builder.RouteBuilder; +import org.springframework.stereotype.Component; +import org.apache.camel.LoggingLevel; + +@Component +public class UserApiValidator extends RouteBuilder { + @Override + public void configure() throws Exception { + onException(Exception.class) + .log(LoggingLevel.ERROR, "${exception.message}: ${exception.stacktrace}") + .handled(true) + .process("validationErrorProcessor"); + + from("direct:validate-createUser") + .id("validate-createUser") + .to("bean-validator://validate-request") + .to("direct:createUser"); + + from("direct:validate-createUsersWithArrayInput") + .id("validate-createUsersWithArrayInput") + .to("bean-validator://validate-request") + .to("direct:createUsersWithArrayInput"); + + from("direct:validate-createUsersWithListInput") + .id("validate-createUsersWithListInput") + .to("bean-validator://validate-request") + .to("direct:createUsersWithListInput"); + + from("direct:validate-deleteUser") + .id("validate-deleteUser") + .to("direct:deleteUser"); + + from("direct:validate-getUserByName") + .id("validate-getUserByName") + .to("direct:getUserByName") + .to("bean-validator://validate-response"); + + from("direct:validate-loginUser") + .id("validate-loginUser") + .to("direct:loginUser") + .to("bean-validator://validate-response"); + + from("direct:validate-logoutUser") + .id("validate-logoutUser") + .to("direct:logoutUser"); + + from("direct:validate-updateUser") + .id("validate-updateUser") + .to("bean-validator://validate-request") + .to("direct:updateUser"); + + } +} diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..b5835986bec --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import org.hibernate.validator.constraints.*; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.*; + +import java.util.*; + +/** + * A category for a pet + */ +@Schema(name = "Category",description = "A category for a pet") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Category") +@XmlRootElement(name = "Category") +@XmlAccessorType(XmlAccessType.FIELD) +public class Category { + @JsonProperty("id") + @JacksonXmlProperty(localName = "id") + private Long id; + + @JsonProperty("name") + @JacksonXmlProperty(localName = "name") + private String name; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @Schema(name = "id", defaultValue = "") + + + 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 + */ + @Schema(name = "name", defaultValue = "") + +@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..4029a7a8be3 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,143 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import org.hibernate.validator.constraints.*; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.*; + +import java.util.*; + +/** + * Describes the result of uploading an image resource + */ +@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "ModelApiResponse") +@XmlRootElement(name = "ModelApiResponse") +@XmlAccessorType(XmlAccessType.FIELD) +public class ModelApiResponse { + @JsonProperty("code") + @JacksonXmlProperty(localName = "code") + private Integer code; + + @JsonProperty("type") + @JacksonXmlProperty(localName = "type") + private String type; + + @JsonProperty("message") + @JacksonXmlProperty(localName = "message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @Schema(name = "code", defaultValue = "") + + + 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 + */ + @Schema(name = "type", defaultValue = "") + + + 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 + */ + @Schema(name = "message", defaultValue = "") + + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..50fc948d4d5 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,262 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import org.hibernate.validator.constraints.*; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.*; + +import java.util.*; + +/** + * An order for a pets from the pet store + */ +@Schema(name = "Order",description = "An order for a pets from the pet store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Order") +@XmlRootElement(name = "Order") +@XmlAccessorType(XmlAccessType.FIELD) +public class Order { + @JsonProperty("id") + @JacksonXmlProperty(localName = "id") + private Long id; + + @JsonProperty("petId") + @JacksonXmlProperty(localName = "petId") + private Long petId; + + @JsonProperty("quantity") + @JacksonXmlProperty(localName = "quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @JacksonXmlProperty(localName = "shipDate") + @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + private Date 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 + "'"); + } + } + + @JsonProperty("status") + @JacksonXmlProperty(localName = "status") + private StatusEnum status; + + @JsonProperty("complete") + @JacksonXmlProperty(localName = "complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @Schema(name = "id", defaultValue = "") + + + 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 + */ + @Schema(name = "petId", defaultValue = "") + + + 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 + */ + @Schema(name = "quantity", defaultValue = "") + + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @Schema(name = "shipDate", defaultValue = "") + + @Valid + + public Date getShipDate() { + return shipDate; + } + + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + @Schema(name = "status", defaultValue = "Order Status") + + + 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 + */ + @Schema(name = "complete", defaultValue = "") + + + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..04fe97643f6 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,282 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import org.hibernate.validator.constraints.*; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.*; + +import java.util.*; + +/** + * A pet for sale in the pet store + */ +@Schema(name = "Pet",description = "A pet for sale in the pet store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Pet") +@XmlRootElement(name = "Pet") +@XmlAccessorType(XmlAccessType.FIELD) +public class Pet { + @JsonProperty("id") + @JacksonXmlProperty(localName = "id") + private Long id; + + @JsonProperty("category") + @JacksonXmlProperty(localName = "category") + private Category category; + + @JsonProperty("name") + @JacksonXmlProperty(localName = "name") + private String name; + + @JsonProperty("photoUrls") + @JacksonXmlProperty(localName = "photoUrl") + @Valid + private List photoUrls = new ArrayList(); + + @JsonProperty("tags") + @JacksonXmlProperty(localName = "tag") + @Valid + 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 + "'"); + } + } + + @JsonProperty("status") + @JacksonXmlProperty(localName = "status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @Schema(name = "id", defaultValue = "") + + + 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 + */ + @Schema(name = "category", defaultValue = "") + + @Valid + + 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 + */ + @Schema(name = "name", example = "doggie", required = true, defaultValue = "") + @NotNull + + + 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 + */ + @Schema(name = "photoUrls", required = true, defaultValue = "") + @NotNull + + + 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 + */ + @Schema(name = "tags", defaultValue = "") + + @Valid + + 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 + */ + @Schema(name = "status", defaultValue = "pet status in the store") + + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..1c26d879995 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import org.hibernate.validator.constraints.*; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.*; + +import java.util.*; + +/** + * A tag for a pet + */ +@Schema(name = "Tag",description = "A tag for a pet") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Tag") +@XmlRootElement(name = "Tag") +@XmlAccessorType(XmlAccessType.FIELD) +public class Tag { + @JsonProperty("id") + @JacksonXmlProperty(localName = "id") + private Long id; + + @JsonProperty("name") + @JacksonXmlProperty(localName = "name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @Schema(name = "id", defaultValue = "") + + + 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 + */ + @Schema(name = "name", defaultValue = "") + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..e6943a48f32 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,273 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import org.hibernate.validator.constraints.*; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.*; + +import java.util.*; + +/** + * A User who is purchasing from the pet store + */ +@Schema(name = "User",description = "A User who is purchasing from the pet store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "User") +@XmlRootElement(name = "User") +@XmlAccessorType(XmlAccessType.FIELD) +public class User { + @JsonProperty("id") + @JacksonXmlProperty(localName = "id") + private Long id; + + @JsonProperty("username") + @JacksonXmlProperty(localName = "username") + private String username; + + @JsonProperty("firstName") + @JacksonXmlProperty(localName = "firstName") + private String firstName; + + @JsonProperty("lastName") + @JacksonXmlProperty(localName = "lastName") + private String lastName; + + @JsonProperty("email") + @JacksonXmlProperty(localName = "email") + private String email; + + @JsonProperty("password") + @JacksonXmlProperty(localName = "password") + private String password; + + @JsonProperty("phone") + @JacksonXmlProperty(localName = "phone") + private String phone; + + @JsonProperty("userStatus") + @JacksonXmlProperty(localName = "userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @Schema(name = "id", defaultValue = "") + + + 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 + */ + @Schema(name = "username", defaultValue = "") + + + 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 + */ + @Schema(name = "firstName", defaultValue = "") + + + 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 + */ + @Schema(name = "lastName", defaultValue = "") + + + 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 + */ + @Schema(name = "email", defaultValue = "") + + + 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 + */ + @Schema(name = "password", defaultValue = "") + + + 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 + */ + @Schema(name = "phone", defaultValue = "") + + + 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 + */ + @Schema(name = "userStatus", defaultValue = "User Status") + + + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-camel/src/main/resources/application.properties b/samples/server/petstore/java-camel/src/main/resources/application.properties new file mode 100644 index 00000000000..36cdb989417 --- /dev/null +++ b/samples/server/petstore/java-camel/src/main/resources/application.properties @@ -0,0 +1,8 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +# https://openapi-generator.tech +# Do not edit the class manually. + +camel.springboot.name=camel-openapi-camel +camel.servlet.mapping.context-path=/api/v1/* + +server.port=8080 \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/PetApiTest.java b/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/PetApiTest.java new file mode 100644 index 00000000000..d02598dd1cc --- /dev/null +++ b/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/PetApiTest.java @@ -0,0 +1,145 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.junit.jupiter.api.Test; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.springframework.boot.test.context.SpringBootTest; +import com.mashape.unirest.request.HttpRequest; +import com.mashape.unirest.request.HttpRequestWithBody; +import com.mashape.unirest.http.Unirest; +import com.mashape.unirest.http.JsonNode; +import com.mashape.unirest.http.HttpResponse; +import java.io.InputStream; +import org.junit.jupiter.api.Assertions; + +@CamelSpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +public class PetApiTest { + private static final String API_URL = "http://127.0.0.1:8080/api/v1"; + + @Test + public void addPetTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/pet"; + HttpRequest httpRequest = Unirest.post(url); + httpRequest = httpRequest.header("Content-Type", contentType); + httpRequest = httpRequest.header("Accept", accept); + + String requestBody = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void addPetTestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "/pet"; + HttpRequest httpRequest = Unirest.post(url); + httpRequest = httpRequest.header("Content-Type", contentType); + httpRequest = httpRequest.header("Accept", accept); + + String requestBody = " 123456789 doggie aeiou aeiou "; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + + + HttpResponse httpResponse = httpRequest.asString(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + @Test + public void findPetsByStatusTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/pet/findByStatus"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.queryString("status", "1"); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void findPetsByTagsTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/pet/findByTags"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.queryString("tags", "1"); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void getPetByIdTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/pet/{petId}"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.routeParam("petId", "1"); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void getPetByIdTestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "/pet/{petId}"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.routeParam("petId", "1"); + + + HttpResponse httpResponse = httpRequest.asString(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + @Test + public void updatePetTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/pet"; + HttpRequest httpRequest = Unirest.put(url); + httpRequest = httpRequest.header("Content-Type", contentType); + httpRequest = httpRequest.header("Accept", accept); + + String requestBody = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void updatePetTestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "/pet"; + HttpRequest httpRequest = Unirest.put(url); + httpRequest = httpRequest.header("Content-Type", contentType); + httpRequest = httpRequest.header("Accept", accept); + + String requestBody = " 123456789 doggie aeiou aeiou "; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + + + HttpResponse httpResponse = httpRequest.asString(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/StoreApiTest.java b/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/StoreApiTest.java new file mode 100644 index 00000000000..f2d137065b7 --- /dev/null +++ b/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/StoreApiTest.java @@ -0,0 +1,84 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.junit.jupiter.api.Test; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.springframework.boot.test.context.SpringBootTest; +import com.mashape.unirest.request.HttpRequest; +import com.mashape.unirest.request.HttpRequestWithBody; +import com.mashape.unirest.http.Unirest; +import com.mashape.unirest.http.JsonNode; +import com.mashape.unirest.http.HttpResponse; +import java.io.InputStream; +import org.junit.jupiter.api.Assertions; + +@CamelSpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +public class StoreApiTest { + private static final String API_URL = "http://127.0.0.1:8080/api/v1"; + + @Test + public void getOrderByIdTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/store/order/{orderId}"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.routeParam("orderId", "1"); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void getOrderByIdTestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "/store/order/{orderId}"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.routeParam("orderId", "1"); + + + HttpResponse httpResponse = httpRequest.asString(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + @Test + public void placeOrderTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/store/order"; + HttpRequest httpRequest = Unirest.post(url); + httpRequest = httpRequest.header("Content-Type", contentType); + httpRequest = httpRequest.header("Accept", accept); + + String requestBody = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void placeOrderTestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "/store/order"; + HttpRequest httpRequest = Unirest.post(url); + httpRequest = httpRequest.header("Content-Type", contentType); + httpRequest = httpRequest.header("Accept", accept); + + String requestBody = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + httpRequest = ((HttpRequestWithBody) httpRequest).body(requestBody).getHttpRequest(); + + + HttpResponse httpResponse = httpRequest.asString(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/UserApiTest.java b/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/UserApiTest.java new file mode 100644 index 00000000000..c278b12de3b --- /dev/null +++ b/samples/server/petstore/java-camel/src/test/java/org/openapitools/api/UserApiTest.java @@ -0,0 +1,51 @@ +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.api; + +import org.junit.jupiter.api.Test; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.springframework.boot.test.context.SpringBootTest; +import com.mashape.unirest.request.HttpRequest; +import com.mashape.unirest.request.HttpRequestWithBody; +import com.mashape.unirest.http.Unirest; +import com.mashape.unirest.http.JsonNode; +import com.mashape.unirest.http.HttpResponse; +import java.io.InputStream; +import org.junit.jupiter.api.Assertions; + +@CamelSpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +public class UserApiTest { + private static final String API_URL = "http://127.0.0.1:8080/api/v1"; + + @Test + public void getUserByNameTestJson() throws Exception { + String contentType = "application/json"; + String accept = "application/json"; + String url = API_URL + "/user/{username}"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.routeParam("username", "1"); + + + HttpResponse httpResponse = httpRequest.asJson(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } + + @Test + public void getUserByNameTestXml() throws Exception { + String contentType = "application/xml"; + String accept = "application/xml"; + String url = API_URL + "/user/{username}"; + HttpRequest httpRequest = Unirest.get(url); + httpRequest = httpRequest.header("Accept", accept); + httpRequest = httpRequest.routeParam("username", "1"); + + + HttpResponse httpResponse = httpRequest.asString(); + Assertions.assertTrue(httpResponse.getStatus() < 400 || httpResponse.getStatus() == 415); + } +} \ No newline at end of file From 3e8dc31ec5a2590ab348e801f2d386c7f398fcb2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 13 Jan 2022 01:49:52 +0800 Subject: [PATCH 035/113] update samples --- samples/client/petstore/c/include/list.h | 4 ++-- .../kotlin-array-simple-string/.openapi-generator/FILES | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/client/petstore/c/include/list.h b/samples/client/petstore/c/include/list.h index 06c1740dc11..96c5832b02b 100644 --- a/samples/client/petstore/c/include/list.h +++ b/samples/client/petstore/c/include/list.h @@ -23,8 +23,8 @@ typedef struct list_t { #define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) -list_t* list_creatList(); -void list_freeList(list_t* listToFree); +list_t* List(); +void list_freeListList(list_t* listToFree); void list_addElement(list_t* list, void* dataToAddInList); listEntry_t* list_getElementAt(list_t *list, long indexOfElement); diff --git a/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES index 97e668afe5f..d731beb9d87 100644 --- a/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-array-simple-string/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle docs/DefaultApi.md From dff3944d19a3f409680d2c61c235b7a0803fdb81 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 13 Jan 2022 18:16:48 +0800 Subject: [PATCH 036/113] update doc --- docs/generators/java-camel.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 0f2631991b6..8d50c879938 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -1,8 +1,18 @@ --- -title: Config Options for java-camel -sidebar_label: java-camel +title: Documentation for the java-camel Generator --- +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-camel | pass this to the generate command after -g | +| generator stability | STABLE | | +| generator type | SERVER | | +| generator language | Java | | +| helpTxt | Generates a camel server. | | + +## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. | Option | Description | Values | Default | From 7129cdebc5524fb2516822d33b4d2000096cb72b Mon Sep 17 00:00:00 2001 From: Bodo Graumann Date: Thu, 13 Jan 2022 17:06:04 +0100 Subject: [PATCH 037/113] [typescript] Make module usable with esbuild (#11298) * Use default import from url-parse * Update samples * Fix typo in readme --- README.md | 2 +- .../src/main/resources/typescript/http/http.mustache | 4 +--- .../src/main/resources/typescript/package.mustache | 3 ++- .../src/main/resources/typescript/tsconfig.mustache | 3 +++ .../petstore/typescript/builds/composed-schemas/http/http.ts | 4 +--- .../petstore/typescript/builds/composed-schemas/package.json | 3 ++- .../petstore/typescript/builds/composed-schemas/tsconfig.json | 3 +++ .../client/petstore/typescript/builds/default/http/http.ts | 4 +--- .../client/petstore/typescript/builds/default/package.json | 3 ++- .../client/petstore/typescript/builds/default/tsconfig.json | 3 +++ .../client/petstore/typescript/builds/inversify/http/http.ts | 4 +--- .../client/petstore/typescript/builds/inversify/package.json | 3 ++- .../client/petstore/typescript/builds/inversify/tsconfig.json | 3 +++ .../client/petstore/typescript/builds/jquery/http/http.ts | 4 +--- .../client/petstore/typescript/builds/jquery/package.json | 3 ++- .../client/petstore/typescript/builds/jquery/tsconfig.json | 3 +++ .../petstore/typescript/builds/object_params/http/http.ts | 4 +--- .../petstore/typescript/builds/object_params/package.json | 3 ++- .../petstore/typescript/builds/object_params/tsconfig.json | 3 +++ 19 files changed, 37 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e526479d127..87f37c8ca49 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
-[![Stable releaases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) [![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers)](https://opencollective.com/openapi_generator) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator) +[![Stable releases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) [![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers)](https://opencollective.com/openapi_generator) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator)
diff --git a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache index 2f71d86109f..c3a83a84d6e 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache @@ -7,9 +7,7 @@ import { URLSearchParams } from 'url'; {{/platforms}} {{#platforms}} {{^deno}} -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; +import URLParse from "url-parse"; {{/deno}} {{/platforms}} import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{extensionForDeno}}'{{/useRxJS}}; diff --git a/modules/openapi-generator/src/main/resources/typescript/package.mustache b/modules/openapi-generator/src/main/resources/typescript/package.mustache index 807989026b1..e775b345eee 100644 --- a/modules/openapi-generator/src/main/resources/typescript/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/package.mustache @@ -51,7 +51,8 @@ "url-parse": "^1.4.3" }, "devDependencies": { - "typescript": "^3.9.3" + "typescript": "^3.9.3", + "@types/url-parse": "1.4.4" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig":{ diff --git a/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache index 011a217eb06..6e3bd9bb349 100644 --- a/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache @@ -13,6 +13,9 @@ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* To import url-parse */ + "allowSyntheticDefaultImports": true, + "removeComments": true, "sourceMap": true, "outDir": "./dist", diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts index f19e206b19f..4a69a7f7f18 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts @@ -1,6 +1,4 @@ -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; +import URLParse from "url-parse"; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json index 1605e85eb13..78d313bd12e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json @@ -22,6 +22,7 @@ "url-parse": "^1.4.3" }, "devDependencies": { - "typescript": "^3.9.3" + "typescript": "^3.9.3", + "@types/url-parse": "1.4.4" } } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json index 6576215ef87..68bff46d308 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json @@ -13,6 +13,9 @@ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* To import url-parse */ + "allowSyntheticDefaultImports": true, + "removeComments": true, "sourceMap": true, "outDir": "./dist", diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts index a623aef1278..a380003eb6d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts @@ -1,9 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; +import URLParse from "url-parse"; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; diff --git a/samples/openapi3/client/petstore/typescript/builds/default/package.json b/samples/openapi3/client/petstore/typescript/builds/default/package.json index f2676763610..830fc2abb28 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/package.json @@ -26,6 +26,7 @@ "url-parse": "^1.4.3" }, "devDependencies": { - "typescript": "^3.9.3" + "typescript": "^3.9.3", + "@types/url-parse": "1.4.4" } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json index 3ada5c62a9f..1fd524c47e3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/tsconfig.json @@ -13,6 +13,9 @@ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* To import url-parse */ + "allowSyntheticDefaultImports": true, + "removeComments": true, "sourceMap": true, "outDir": "./dist", diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index a623aef1278..a380003eb6d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -1,9 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; +import URLParse from "url-parse"; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/package.json b/samples/openapi3/client/petstore/typescript/builds/inversify/package.json index 71908ad48ca..4102c747f78 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/package.json @@ -27,6 +27,7 @@ "url-parse": "^1.4.3" }, "devDependencies": { - "typescript": "^3.9.3" + "typescript": "^3.9.3", + "@types/url-parse": "1.4.4" } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json index c09901ad10f..ec234242c2e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json @@ -13,6 +13,9 @@ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* To import url-parse */ + "allowSyntheticDefaultImports": true, + "removeComments": true, "sourceMap": true, "outDir": "./dist", diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts index 4b9ef54beeb..d48c69e9781 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts @@ -1,6 +1,4 @@ -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; +import URLParse from "url-parse"; import { Observable, from } from '../rxjsStub'; export * from './jquery'; diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/package.json b/samples/openapi3/client/petstore/typescript/builds/jquery/package.json index 7c35bc6c6dd..aed6c6e9f95 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/package.json @@ -23,6 +23,7 @@ "url-parse": "^1.4.3" }, "devDependencies": { - "typescript": "^3.9.3" + "typescript": "^3.9.3", + "@types/url-parse": "1.4.4" } } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json index 6576215ef87..68bff46d308 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/tsconfig.json @@ -13,6 +13,9 @@ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* To import url-parse */ + "allowSyntheticDefaultImports": true, + "removeComments": true, "sourceMap": true, "outDir": "./dist", diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index a623aef1278..a380003eb6d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -1,9 +1,7 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; -// typings of url-parse are incorrect... -// @ts-ignore -import * as URLParse from "url-parse"; +import URLParse from "url-parse"; import { Observable, from } from '../rxjsStub'; export * from './isomorphic-fetch'; diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/package.json b/samples/openapi3/client/petstore/typescript/builds/object_params/package.json index f2676763610..830fc2abb28 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/package.json +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/package.json @@ -26,6 +26,7 @@ "url-parse": "^1.4.3" }, "devDependencies": { - "typescript": "^3.9.3" + "typescript": "^3.9.3", + "@types/url-parse": "1.4.4" } } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json index 3ada5c62a9f..1fd524c47e3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/tsconfig.json @@ -13,6 +13,9 @@ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + /* To import url-parse */ + "allowSyntheticDefaultImports": true, + "removeComments": true, "sourceMap": true, "outDir": "./dist", From 759883f804f0da49855f39b65e892fa6cf918e0e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 14 Jan 2022 01:08:22 +0800 Subject: [PATCH 038/113] minor enhancements to java camel generator (#11296) --- README.md | 3 ++- docs/generators/java-camel.md | 2 +- .../languages/JavaCamelServerCodegen.java | 24 ++++++++++++++++++- pom.xml | 11 +++++---- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 87f37c8ca49..24298b5ab1a 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient, Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** | @@ -964,6 +964,7 @@ Here is a list of template creators: * GraphQL Express Server: @renepardon * Haskell Servant: @algas * Haskell Yesod: @yotsuya + * Java Camel: @carnevalegiacomo * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 8d50c879938..09185f35308 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -10,7 +10,7 @@ title: Documentation for the java-camel Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | -| helpTxt | Generates a camel server. | | +| helpTxt | Generates a Java Camel server (beta). | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java index 39240ff329e..40d17458e1f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java @@ -1,3 +1,19 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * 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. + */ + package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; @@ -8,6 +24,8 @@ import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.OptionalFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +67,7 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat } public String getHelp() { - return "Generates a camel server."; + return "Generates a Java Camel server (beta)."; } public JavaCamelServerCodegen() { @@ -62,6 +80,10 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat @Override public void processOpts() { + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + if (!additionalProperties.containsKey(DATE_LIBRARY)) { additionalProperties.put(DATE_LIBRARY, "legacy"); } diff --git a/pom.xml b/pom.xml index 81e5c5c2b2a..318bf21f0dc 100644 --- a/pom.xml +++ b/pom.xml @@ -1246,15 +1246,16 @@ - samples/server/petstore/spring-mvc - samples/server/petstore/spring-mvc-default-value - samples/server/petstore/spring-mvc-j8-async - samples/server/petstore/spring-mvc-j8-localdatetime - samples/client/petstore/spring-cloud samples/openapi3/client/petstore/spring-cloud samples/client/petstore/spring-cloud-date-time samples/openapi3/client/petstore/spring-cloud-date-time + + samples/server/petstore/java-camel + samples/server/petstore/spring-mvc + samples/server/petstore/spring-mvc-default-value + samples/server/petstore/spring-mvc-j8-async + samples/server/petstore/spring-mvc-j8-localdatetime samples/server/petstore/springboot samples/openapi3/server/petstore/springboot samples/server/petstore/springboot-beanvalidation From 0323708b978be7943d0e8be213ee2343df131faf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jan 2022 01:08:40 +0800 Subject: [PATCH 039/113] Bump follow-redirects from 1.10.0 to 1.14.7 in /website (#11300) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.10.0 to 1.14.7. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.10.0...v1.14.7) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/yarn.lock | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 23846922dea..15489b0fce1 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2944,7 +2944,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@^3.0.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: +debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -3815,11 +3815,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.10.0.tgz#01f5263aee921c6a54fb91667f08f4155ce169eb" - integrity sha512-4eyLK6s6lH32nOvLLwlIOnr9zrL8Sm+OvW4pVTJNoXeGzYIkHVf+pADQi+OJ0E67hiuSLezPVPyBcIZO50TmmQ== - dependencies: - debug "^3.0.0" + version "1.14.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" + integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== for-in@^1.0.2: version "1.0.2" From d8cb6bd894962f37e76c38d2a3b0eed97bf84e99 Mon Sep 17 00:00:00 2001 From: Amelia Raia <63364513+Amelia0193@users.noreply.github.com> Date: Thu, 13 Jan 2022 23:25:40 +0000 Subject: [PATCH 040/113] Allow the user to pass in any headers per request. #11139 (#11140) * [Python] Allow the user to pass in any headers per request * Update docs * Update docs Update Docs _headers * Add test Co-authored-by: Rizwan Saeed --- .../main/resources/python-legacy/api.mustache | 5 +- .../petstore_api/api/another_fake_api.py | 5 +- .../petstore_api/api/fake_api.py | 70 +++++++++------ .../api/fake_classname_tags_123_api.py | 5 +- .../petstore_api/api/pet_api.py | 45 ++++++---- .../petstore_api/api/store_api.py | 20 +++-- .../petstore_api/api/user_api.py | 40 +++++---- .../petstore_api/api/another_fake_api.py | 5 +- .../petstore_api/api/fake_api.py | 70 +++++++++------ .../api/fake_classname_tags_123_api.py | 5 +- .../python-legacy/petstore_api/api/pet_api.py | 45 ++++++---- .../petstore_api/api/store_api.py | 20 +++-- .../petstore_api/api/user_api.py | 40 +++++---- .../petstore_api/api/another_fake_api.py | 5 +- .../petstore_api/api/fake_api.py | 70 +++++++++------ .../api/fake_classname_tags_123_api.py | 5 +- .../petstore_api/api/pet_api.py | 45 ++++++---- .../petstore_api/api/store_api.py | 20 +++-- .../petstore_api/api/user_api.py | 40 +++++---- .../petstore_api/api/another_fake_api.py | 5 +- .../petstore_api/api/default_api.py | 5 +- .../petstore_api/api/fake_api.py | 85 +++++++++++-------- .../api/fake_classname_tags_123_api.py | 5 +- .../python-legacy/petstore_api/api/pet_api.py | 45 ++++++---- .../petstore_api/api/store_api.py | 20 +++-- .../petstore_api/api/user_api.py | 40 +++++---- .../python-legacy/test/test_fake_api.py | 14 ++- 27 files changed, 472 insertions(+), 307 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache index afde9560aa9..723033609f9 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache @@ -144,7 +144,8 @@ class {{classname}}(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -221,7 +222,7 @@ class {{classname}}(object): collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501 {{/queryParams}} - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) {{#headerParams}} if '{{paramName}}' in local_var_params: header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isArray}} # noqa: E501 diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py index b76ee3b916c..17c46b6ac4c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py @@ -114,7 +114,8 @@ class AnotherFakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class AnotherFakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index b97f43f60f9..44636a1a022 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -114,7 +114,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -251,7 +252,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -270,7 +272,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -384,7 +386,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -403,7 +406,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -517,7 +520,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -536,7 +540,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -650,7 +654,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -669,7 +674,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -783,7 +788,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -806,7 +812,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -923,7 +929,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -952,7 +959,7 @@ class FakeApi(object): if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1066,7 +1073,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1089,7 +1097,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1274,7 +1282,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1337,7 +1346,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1512,7 +1521,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1540,7 +1550,7 @@ class FakeApi(object): if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'enum_header_string_array' in local_var_params: header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 @@ -1687,7 +1697,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1726,7 +1737,7 @@ class FakeApi(object): if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'required_boolean_group' in local_var_params: header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 if 'boolean_group' in local_var_params: @@ -1834,7 +1845,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1857,7 +1869,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1974,7 +1986,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2001,7 +2014,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -2137,7 +2150,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2191,7 +2205,7 @@ class FakeApi(object): query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py index 2b46147fed5..b5cd8cd22c9 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py @@ -114,7 +114,8 @@ class FakeClassnameTags123Api(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeClassnameTags123Api(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py index e20e57a7f86..59c3b238c1c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py @@ -112,7 +112,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -135,7 +136,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -252,7 +253,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -277,7 +279,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'api_key' in local_var_params: header_params['api_key'] = local_var_params['api_key'] # noqa: E501 @@ -385,7 +387,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -411,7 +414,7 @@ class PetApi(object): query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -524,7 +527,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -550,7 +554,7 @@ class PetApi(object): query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -663,7 +667,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -688,7 +693,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -800,7 +805,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -823,7 +829,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -945,7 +951,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -970,7 +977,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1094,7 +1101,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1119,7 +1127,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1249,7 +1257,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1278,7 +1287,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py index 4425692aec0..93566fdb1d6 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py @@ -114,7 +114,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -139,7 +140,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -240,7 +241,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -259,7 +261,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -371,7 +373,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -400,7 +403,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -512,7 +515,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -535,7 +539,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py index 593e5e5856b..550d852e0c2 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py @@ -114,7 +114,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -243,7 +244,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -266,7 +268,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -372,7 +374,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -395,7 +398,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -503,7 +506,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -528,7 +532,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -632,7 +636,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -657,7 +662,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -774,7 +779,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -805,7 +811,7 @@ class UserApi(object): if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -911,7 +917,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -930,7 +937,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1041,7 +1048,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1070,7 +1078,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py index b76ee3b916c..17c46b6ac4c 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py @@ -114,7 +114,8 @@ class AnotherFakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class AnotherFakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py index b97f43f60f9..44636a1a022 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -114,7 +114,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -251,7 +252,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -270,7 +272,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -384,7 +386,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -403,7 +406,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -517,7 +520,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -536,7 +540,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -650,7 +654,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -669,7 +674,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -783,7 +788,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -806,7 +812,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -923,7 +929,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -952,7 +959,7 @@ class FakeApi(object): if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1066,7 +1073,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1089,7 +1097,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1274,7 +1282,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1337,7 +1346,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1512,7 +1521,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1540,7 +1550,7 @@ class FakeApi(object): if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'enum_header_string_array' in local_var_params: header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 @@ -1687,7 +1697,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1726,7 +1737,7 @@ class FakeApi(object): if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'required_boolean_group' in local_var_params: header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 if 'boolean_group' in local_var_params: @@ -1834,7 +1845,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1857,7 +1869,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1974,7 +1986,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2001,7 +2014,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -2137,7 +2150,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2191,7 +2205,7 @@ class FakeApi(object): query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py index 2b46147fed5..b5cd8cd22c9 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py @@ -114,7 +114,8 @@ class FakeClassnameTags123Api(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeClassnameTags123Api(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py index e20e57a7f86..59c3b238c1c 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -112,7 +112,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -135,7 +136,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -252,7 +253,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -277,7 +279,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'api_key' in local_var_params: header_params['api_key'] = local_var_params['api_key'] # noqa: E501 @@ -385,7 +387,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -411,7 +414,7 @@ class PetApi(object): query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -524,7 +527,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -550,7 +554,7 @@ class PetApi(object): query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -663,7 +667,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -688,7 +693,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -800,7 +805,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -823,7 +829,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -945,7 +951,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -970,7 +977,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1094,7 +1101,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1119,7 +1127,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1249,7 +1257,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1278,7 +1287,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py index 4425692aec0..93566fdb1d6 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -114,7 +114,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -139,7 +140,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -240,7 +241,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -259,7 +261,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -371,7 +373,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -400,7 +403,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -512,7 +515,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -535,7 +539,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py index 593e5e5856b..550d852e0c2 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -114,7 +114,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -243,7 +244,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -266,7 +268,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -372,7 +374,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -395,7 +398,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -503,7 +506,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -528,7 +532,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -632,7 +636,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -657,7 +662,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -774,7 +779,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -805,7 +811,7 @@ class UserApi(object): if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -911,7 +917,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -930,7 +937,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1041,7 +1048,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1070,7 +1078,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py index b76ee3b916c..17c46b6ac4c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py @@ -114,7 +114,8 @@ class AnotherFakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class AnotherFakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index b97f43f60f9..44636a1a022 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -114,7 +114,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -251,7 +252,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -270,7 +272,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -384,7 +386,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -403,7 +406,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -517,7 +520,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -536,7 +540,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -650,7 +654,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -669,7 +674,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -783,7 +788,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -806,7 +812,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -923,7 +929,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -952,7 +959,7 @@ class FakeApi(object): if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1066,7 +1073,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1089,7 +1097,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1274,7 +1282,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1337,7 +1346,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1512,7 +1521,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1540,7 +1550,7 @@ class FakeApi(object): if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'enum_header_string_array' in local_var_params: header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 @@ -1687,7 +1697,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1726,7 +1737,7 @@ class FakeApi(object): if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'required_boolean_group' in local_var_params: header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 if 'boolean_group' in local_var_params: @@ -1834,7 +1845,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1857,7 +1869,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1974,7 +1986,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2001,7 +2014,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -2137,7 +2150,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2191,7 +2205,7 @@ class FakeApi(object): query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py index 2b46147fed5..b5cd8cd22c9 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py @@ -114,7 +114,8 @@ class FakeClassnameTags123Api(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeClassnameTags123Api(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py index e20e57a7f86..59c3b238c1c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py @@ -112,7 +112,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -135,7 +136,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -252,7 +253,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -277,7 +279,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'api_key' in local_var_params: header_params['api_key'] = local_var_params['api_key'] # noqa: E501 @@ -385,7 +387,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -411,7 +414,7 @@ class PetApi(object): query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -524,7 +527,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -550,7 +554,7 @@ class PetApi(object): query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -663,7 +667,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -688,7 +693,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -800,7 +805,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -823,7 +829,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -945,7 +951,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -970,7 +977,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1094,7 +1101,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1119,7 +1127,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1249,7 +1257,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1278,7 +1287,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py index 4425692aec0..93566fdb1d6 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py @@ -114,7 +114,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -139,7 +140,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -240,7 +241,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -259,7 +261,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -371,7 +373,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -400,7 +403,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -512,7 +515,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -535,7 +539,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py index 593e5e5856b..550d852e0c2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py @@ -114,7 +114,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -243,7 +244,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -266,7 +268,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -372,7 +374,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -395,7 +398,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -503,7 +506,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -528,7 +532,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -632,7 +636,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -657,7 +662,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -774,7 +779,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -805,7 +811,7 @@ class UserApi(object): if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -911,7 +917,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -930,7 +937,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1041,7 +1048,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1070,7 +1078,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py index 43e5339dcc9..bbebcdf743f 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py @@ -114,7 +114,8 @@ class AnotherFakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class AnotherFakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py index d3be5ae092a..c626466b75d 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py @@ -107,7 +107,8 @@ class DefaultApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -126,7 +127,7 @@ class DefaultApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index a08aee25453..91d684ae47f 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -107,7 +107,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -126,7 +127,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -246,7 +247,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -271,7 +273,7 @@ class FakeApi(object): if 'query_1' in local_var_params and local_var_params['query_1'] is not None: # noqa: E501 query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'header_1' in local_var_params: header_params['header_1'] = local_var_params['header_1'] # noqa: E501 @@ -387,7 +389,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -406,7 +409,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -526,7 +529,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -545,7 +549,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -665,7 +669,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -684,7 +689,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -804,7 +809,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -823,7 +829,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -943,7 +949,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -966,7 +973,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1086,7 +1093,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1105,7 +1113,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1219,7 +1227,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1242,7 +1251,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1359,7 +1368,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1388,7 +1398,7 @@ class FakeApi(object): if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1502,7 +1512,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1525,7 +1536,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1710,7 +1721,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1773,7 +1785,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1948,7 +1960,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1976,7 +1989,7 @@ class FakeApi(object): if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'enum_header_string_array' in local_var_params: header_params['enum_header_string_array'] = local_var_params['enum_header_string_array'] # noqa: E501 collection_formats['enum_header_string_array'] = 'csv' # noqa: E501 @@ -2123,7 +2136,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2162,7 +2176,7 @@ class FakeApi(object): if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'required_boolean_group' in local_var_params: header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501 if 'boolean_group' in local_var_params: @@ -2270,7 +2284,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2293,7 +2308,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -2410,7 +2425,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2437,7 +2453,7 @@ class FakeApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -2583,7 +2599,8 @@ class FakeApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -2645,7 +2662,7 @@ class FakeApi(object): if 'allow_empty' in local_var_params and local_var_params['allow_empty'] is not None: # noqa: E501 query_params.append(('allowEmpty', local_var_params['allow_empty'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py index 1dd90624e71..05c1c8a0e4f 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py @@ -114,7 +114,8 @@ class FakeClassnameTags123Api(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class FakeClassnameTags123Api(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py index 5f4bcb8888b..2fda30914a7 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -125,7 +125,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -148,7 +149,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -266,7 +267,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -291,7 +293,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) if 'api_key' in local_var_params: header_params['api_key'] = local_var_params['api_key'] # noqa: E501 @@ -399,7 +401,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -425,7 +428,7 @@ class PetApi(object): query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -538,7 +541,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -564,7 +568,7 @@ class PetApi(object): query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -677,7 +681,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -702,7 +707,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -827,7 +832,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -850,7 +856,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -973,7 +979,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -998,7 +1005,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1122,7 +1129,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1147,7 +1155,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1277,7 +1285,8 @@ class PetApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1306,7 +1315,7 @@ class PetApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py index 48c85b36d7b..5b8296dfbeb 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -114,7 +114,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -139,7 +140,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -240,7 +241,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -259,7 +261,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -371,7 +373,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -400,7 +403,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -512,7 +515,8 @@ class StoreApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -535,7 +539,7 @@ class StoreApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py index 89fd46adef9..d634bad956b 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -114,7 +114,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -137,7 +138,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -249,7 +250,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -272,7 +274,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -384,7 +386,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -407,7 +410,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -521,7 +524,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -546,7 +550,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -650,7 +654,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -675,7 +680,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -792,7 +797,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -823,7 +829,7 @@ class UserApi(object): if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -929,7 +935,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -948,7 +955,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} @@ -1059,7 +1066,8 @@ class UserApi(object): '_preload_content', '_request_timeout', '_request_auth', - '_content_type' + '_content_type', + '_headers' ] ) @@ -1088,7 +1096,7 @@ class UserApi(object): query_params = [] - header_params = {} + header_params = dict(local_var_params.get('_headers', {})) form_params = [] local_var_files = {} diff --git a/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py b/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py index 0f4028bc96b..b7f11348897 100644 --- a/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/test/test_fake_api.py @@ -13,10 +13,10 @@ from __future__ import absolute_import import unittest +from unittest.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): @@ -126,6 +126,18 @@ class TestFakeApi(unittest.TestCase): """ pass + def test_headers_parameter(self): + """Test case for the _headers are passed by the user + + To test any optional parameter # noqa: E501 + """ + api = petstore_api.api.PetApi() + with patch("petstore_api.api_client.ApiClient.call_api") as mock_method: + value_headers = {"Header1": "value1"} + api.find_pets_by_status(["Cat"], _headers=value_headers) + args, _ = mock_method.call_args + self.assertEqual(args, ('/pet/findByStatus', 'GET', {}, [('status', ['Cat'])], {'Accept': 'application/json', 'Header1': 'value1'}) +) if __name__ == '__main__': unittest.main() From 57987424a4eaa22d73337388489cd86d7f42a023 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Fri, 14 Jan 2022 10:52:36 -0800 Subject: [PATCH 041/113] Revert "Has generators set default template engine (#11245)" (#11316) This reverts commit dd3bba8c9442f2ee40d6ea8f0872ab0be43714b9. Because it broke peoples builds per this issue https://github.com/OpenAPITools/openapi-generator/issues/11276 --- bin/configs/python-experimental.yaml | 1 + .../codegen/config/WorkflowSettings.java | 2 +- .../org/openapitools/codegen/CodegenConfig.java | 2 -- .../openapitools/codegen/DefaultCodegen.java | 5 ----- .../codegen/config/CodegenConfigurator.java | 17 ++++------------- .../PythonExperimentalClientCodegen.java | 5 ----- 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml index dd204f44938..1a8ea6e002c 100644 --- a/bin/configs/python-experimental.yaml +++ b/bin/configs/python-experimental.yaml @@ -2,6 +2,7 @@ generatorName: python-experimental outputDir: samples/openapi3/client/petstore/python-experimental inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/python-experimental +templatingEngineName: handlebars additionalProperties: packageName: petstore_api recursionLimit: "1234" 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 64e426fa68a..e2feddb9822 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 @@ -46,7 +46,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 boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false; - public static final String DEFAULT_TEMPLATING_ENGINE_NAME = null; // this is set by the generator + public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; public static final Map DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>()); private String inputSpec; 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 952d3a841f2..2207e3170fb 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 @@ -305,8 +305,6 @@ public interface CodegenConfig { Schema unaliasSchema(Schema schema, Map usedImportMappings); - public String defaultTemplatingEngine(); - public GeneratorLanguage generatorLanguage(); /* 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 d4c70494f97..95df82d2ddf 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 @@ -7357,11 +7357,6 @@ public class DefaultCodegen implements CodegenConfig { return xOf; } - @Override - public String defaultTemplatingEngine() { - return "mustache"; - } - @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; } 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 9eb6f558ef7..b5bd0b23c33 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 @@ -91,18 +91,11 @@ public class CodegenConfigurator { WorkflowSettings workflowSettings = settings.getWorkflowSettings(); List userDefinedTemplateSettings = settings.getFiles(); - CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName()); - String templatingEngineName = workflowSettings.getTemplatingEngineName(); - if (isEmpty(templatingEngineName)) { - // if templatingEngineName is empty check the config for a default - templatingEngineName = config.defaultTemplatingEngine(); - } - // We copy "cached" properties into configurator so it is appropriately configured with all settings in external files. // FIXME: target is to eventually move away from CodegenConfigurator properties except gen/workflow settings. configurator.generatorName = generatorSettings.getGeneratorName(); configurator.inputSpec = workflowSettings.getInputSpec(); - configurator.templatingEngineName = templatingEngineName; + configurator.templatingEngineName = workflowSettings.getTemplatingEngineName(); if (workflowSettings.getGlobalProperties() != null) { configurator.globalProperties.putAll(workflowSettings.getGlobalProperties()); } @@ -489,17 +482,15 @@ public class CodegenConfigurator { Validate.notEmpty(generatorName, "generator name must be specified"); Validate.notEmpty(inputSpec, "input spec must be specified"); - GeneratorSettings generatorSettings = generatorSettingsBuilder.build(); - CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName()); if (isEmpty(templatingEngineName)) { - // if templatingEngineName is empty check the config for a default - String defaultTemplatingEngine = config.defaultTemplatingEngine(); - workflowSettingsBuilder.withTemplatingEngineName(defaultTemplatingEngine); + // Built-in templates are mustache, but allow users to use a simplified handlebars engine for their custom templates. + workflowSettingsBuilder.withTemplatingEngineName("mustache"); } else { workflowSettingsBuilder.withTemplatingEngineName(templatingEngineName); } // at this point, all "additionalProperties" are set, and are now immutable per GeneratorSettings instance. + GeneratorSettings generatorSettings = generatorSettingsBuilder.build(); WorkflowSettings workflowSettings = workflowSettingsBuilder.build(); if (workflowSettings.isVerbose()) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index 5424080f0d7..ca237e47eca 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -2086,11 +2086,6 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { return co; } - @Override - public String defaultTemplatingEngine() { - return "handlebars"; - } - @Override public String generatorLanguageVersion() { return ">=3.9"; }; } From 6430aaf3b1b2a6bafc67d5342f9e3703ada1a671 Mon Sep 17 00:00:00 2001 From: Ethan Keller Date: Fri, 14 Jan 2022 15:39:22 -0500 Subject: [PATCH 042/113] =?UTF-8?q?recursively=20search=20for=20types=20du?= =?UTF-8?q?ring=20import=20type=20collection=20in=20deeply=20=E2=80=A6=20(?= =?UTF-8?q?#11221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * recursively search for types during import type collection in deeply nested schemas #11220 * composed schema recursive type import handling * change Importable to ComplexType to modularize related type-wrangling. * Problems... * Revert "Problems..." This reverts commit 6154f202a0f4db7a706fe3d61b45573581d164d4. * Reverted attempts to reuse recursive type-finding code. * add javadoc comments * fix javadoc warning. * fix NPE * PR feedback incorporation * Include additionalProperties recursion. * More feedback * More feedback * Add comments from feedback --- .../codegen/CodegenParameter.java | 5 ++ .../openapitools/codegen/CodegenResponse.java | 5 ++ .../openapitools/codegen/DefaultCodegen.java | 38 ++++++++++---- .../IJsonSchemaValidationProperties.java | 51 +++++++++++++++++++ .../codegen/DefaultCodegenTest.java | 10 ++++ .../TypeScriptClientCodegenTest.java | 13 +++++ .../additional-properties-deeply-nested.yaml | 32 ++++++++++++ ...perties_and_additional_properties_class.py | 2 + 8 files changed, 145 insertions(+), 11 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/additional-properties-deeply-nested.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index dba1721fbca..6d00e02103e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -756,5 +756,10 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public void setContent(LinkedHashMap content) { this.content = content; } + + @Override + public String getBaseType() { + return baseType; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index 7a23b3ab726..33fcf0afa52 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -614,4 +614,9 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { @Override public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; } + + @Override + public String getBaseType() { + return baseType; + } } 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 95df82d2ddf..30750772951 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 @@ -5120,12 +5120,32 @@ public class DefaultCodegen implements CodegenConfig { } } + protected void addImports(CodegenModel m, IJsonSchemaValidationProperties type) { + addImports(m.imports, type); + } + + protected void addImports(Set importsToBeAddedTo, IJsonSchemaValidationProperties type) { + addImports(importsToBeAddedTo, type.getImports(true)); + } + + protected void addImports(Set importsToBeAddedTo, Set importsToAdd) { + importsToAdd.stream().forEach(i -> addImport(importsToBeAddedTo, i)); + } + protected void addImport(CodegenModel m, String type) { - if (type != null && needToImport(type)) { - m.imports.add(type); + addImport(m.imports, type); + } + + private void addImport(Set importsToBeAddedTo, String type) { + if (shouldAddImport(type)) { + importsToBeAddedTo.add(type); } } + private boolean shouldAddImport(String type) { + return type != null && needToImport(type); + } + /** * Loop through properties and unalias the reference if $ref (reference) is defined * @@ -5262,17 +5282,10 @@ public class DefaultCodegen implements CodegenConfig { * @param property The codegen representation of the OAS schema's property. */ protected void addImportsForPropertyType(CodegenModel model, CodegenProperty property) { - // TODO revise the logic to include map if (property.isContainer) { - addImport(model, typeMapping.get("array")); - } - - addImport(model, property.baseType); - CodegenProperty innerCp = property; - while (innerCp != null) { - addImport(model, innerCp.complexType); - innerCp = innerCp.items; + addImport(model.imports, typeMapping.get("array")); } + addImports(model, property); } /** @@ -6727,6 +6740,9 @@ public class DefaultCodegen implements CodegenConfig { CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType, mediaTypeSchemaSuffix), mt.getSchema()); CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); cmtContent.put(contentType, codegenMt); + if (schemaProp != null) { + addImports(imports, schemaProp.getImports(false)); + } } return cmtContent; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java index eb95821d6f3..187e3f5a14a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java @@ -1,6 +1,10 @@ package org.openapitools.codegen; +import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import java.util.stream.Stream; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.utils.ModelUtils; @@ -213,4 +217,51 @@ public interface IJsonSchemaValidationProperties { setIsAnyType(true); } } + + /** + * @return basic type - no generics supported. + */ + default String getBaseType() { + return null; + }; + + /** + * @return complex type that can contain type parameters - like {@code List} for Java + */ + default String getComplexType() { + return getBaseType(); + }; + + /** + * Recursively collect all necessary imports to include so that the type may be resolved. + * + * @param includeContainerTypes whether or not to include the container types in the returned imports. + * @return all of the imports + */ + default Set getImports(boolean includeContainerTypes) { + Set imports = new HashSet<>(); + if (this.getComposedSchemas() != null) { + CodegenComposedSchemas composed = (CodegenComposedSchemas) this.getComposedSchemas(); + List allOfs = composed.getAllOf() == null ? Collections.emptyList() : composed.getAllOf(); + List oneOfs = composed.getOneOf() == null ? Collections.emptyList() : composed.getOneOf(); + Stream innerTypes = Stream.concat(allOfs.stream(), oneOfs.stream()); + innerTypes.flatMap(cp -> cp.getImports(includeContainerTypes).stream()).forEach(s -> imports.add(s)); + } else if (includeContainerTypes || !(this.getIsArray() || this.getIsMap())) { + // this is our base case, add imports for referenced schemas + // this can't be broken out as a separate if block because Typescript only generates union types as A | B + // and would need to handle this differently + imports.add(this.getComplexType()); + imports.add(this.getBaseType()); + } + if (this.getItems() !=null && this.getIsArray()) { + imports.addAll(this.getItems().getImports(includeContainerTypes)); + } + if (this.getAdditionalProperties() != null) { + imports.addAll(this.getAdditionalProperties().getImports(includeContainerTypes)); + } + if (this.getVars() != null && !this.getVars().isEmpty()) { + this.getVars().stream().flatMap(v -> v.getImports(includeContainerTypes).stream()).forEach(s -> imports.add(s)); + } + return imports; + } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 54a2b0d2053..4e9fcd6397b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -56,6 +56,16 @@ import static org.testng.Assert.*; public class DefaultCodegenTest { + @Test + public void testDeeplyNestedAdditionalPropertiesImports() { + final DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openApi = TestUtils.parseFlattenSpec("src/test/resources/3_0/additional-properties-deeply-nested.yaml"); + codegen.setOpenAPI(openApi); + PathItem path = openApi.getPaths().get("/ping"); + CodegenOperation operation = codegen.fromOperation("/ping", "post", path.getPost(), path.getServers()); + Assert.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("Person")).size(), 1); + } + @Test public void testHasBodyParameter() { final Schema refSchema = new Schema<>().$ref("#/components/schemas/Pet"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java index 350af16ebb8..55c7b3b5efa 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java @@ -1,7 +1,10 @@ package org.openapitools.codegen.typescript; +import com.google.common.collect.Sets; import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.media.*; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.TypeScriptClientCodegen; import org.openapitools.codegen.utils.ModelUtils; @@ -41,4 +44,14 @@ public class TypeScriptClientCodegenTest { Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "{ [key: string]: Child; }"); } + @Test + public void testComposedSchemasImportTypesIndividually() { + final TypeScriptClientCodegen codegen = new TypeScriptClientCodegen(); + final OpenAPI openApi = TestUtils.parseFlattenSpec("src/test/resources/3_0/composed-schemas.yaml"); + codegen.setOpenAPI(openApi); + PathItem path = openApi.getPaths().get("/pets"); + CodegenOperation operation = codegen.fromOperation("/pets", "patch", path.getPatch(), path.getServers()); + Assert.assertEquals(operation.imports, Sets.newHashSet("Cat", "Dog")); + } + } diff --git a/modules/openapi-generator/src/test/resources/3_0/additional-properties-deeply-nested.yaml b/modules/openapi-generator/src/test/resources/3_0/additional-properties-deeply-nested.yaml new file mode 100644 index 00000000000..78d9c95b54a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/additional-properties-deeply-nested.yaml @@ -0,0 +1,32 @@ +openapi: 3.0.1 +info: + title: Test additional properties with ref + version: '1.0' +servers: + - url: 'http://localhost:8000/' +paths: + /ping: + post: + operationId: pingGet + responses: + default: + description: default response + content: + application/json: + schema: + type: object + additionalProperties: + type: object + additionalProperties: + type: object + additionalProperties: + "$ref": "#/components/schemas/Person" +components: + schemas: + Person: + type: object + properties: + lastName: + type: string + firstName: + type: string \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index e8bb843a7c8..6f95ff0eaaf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -113,3 +113,5 @@ class MixedPropertiesAndAdditionalPropertiesClass( _instantiation_metadata=_instantiation_metadata, **kwargs, ) + +from petstore_api.model.animal import Animal From 692a4db9642a4468540e09c40d8ab089de30fd90 Mon Sep 17 00:00:00 2001 From: Knut Johannes Dahle Date: Sat, 15 Jan 2022 16:59:42 +0100 Subject: [PATCH 043/113] Added fix for wrongly encoded backticks when generating kotlin client with reserved words as part of the parameters. Wrote a test verifying that the method signatures is without html encoding for backticks (#11310) --- .../libraries/jvm-okhttp/api.mustache | 6 ++-- .../kotlin/KotlinReservedWordsTest.java | 36 ++++++++++++++++++- .../resources/3_0/kotlin/reserved_words.yaml | 16 +++++++++ ...11304_kotlin_backticks_reserved_words.yaml | 23 ++++++++++++ 4 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/bugs/issue_11304_kotlin_backticks_reserved_words.yaml diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index d7948cf6a75..1616e309ff1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -129,7 +129,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -163,7 +163,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -183,7 +183,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}RequestConfig({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}> { + fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}> { val localVariableBody = {{#hasBodyParam}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to {{{paramName}}}{{^-last}}, {{/-last}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() {{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java index 914ed814da8..bd06fde5f2a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java @@ -10,8 +10,13 @@ import org.openapitools.codegen.utils.StringUtils; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.HashSet; +import static org.openapitools.codegen.TestUtils.assertFileContains; +import static org.openapitools.codegen.TestUtils.assertFileNotContains; import static org.testng.Assert.assertEquals; @SuppressWarnings("rawtypes") @@ -51,7 +56,8 @@ public class KotlinReservedWordsTest { {"while"}, {"open"}, {"external"}, - {"internal"} + {"internal"}, + {"value"} }; } @@ -128,4 +134,32 @@ public class KotlinReservedWordsTest { assertEquals(property.baseName, reservedWord); } + @Test + public void reservedWordsInGeneratedCode() throws Exception { + String baseApiPackage = "/org/openapitools/client/apis/"; + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); //may be move to /build + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_11304_kotlin_backticks_reserved_words.yaml"); + + KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(input).generate(); + + File resultSourcePath = new File(output, "src/main/kotlin"); + + assertFileContains(Paths.get(resultSourcePath.getAbsolutePath() + baseApiPackage + "DefaultApi.kt"), + "fun test(`value`: kotlin.String) : Unit {", + "fun testWithHttpInfo(`value`: kotlin.String) : ApiResponse {", + "fun testRequestConfig(`value`: kotlin.String) : RequestConfig {" + ); + + assertFileNotContains(Paths.get(resultSourcePath.getAbsolutePath() + baseApiPackage + "DefaultApi.kt"), + "`" + ); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml index 881ffe49499..d5074fd953c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml @@ -108,6 +108,10 @@ paths: in: header schema: type: string + - name: value + in: header + schema: + type: string - name: var in: header schema: @@ -192,6 +196,8 @@ components: type: string val: type: string + value: + type: string var: type: string when: @@ -261,6 +267,8 @@ components: $ref: '#/components/schemas/typeof' val: $ref: '#/components/schemas/val' + value: + $ref: '#/components/schemas/value' var: $ref: '#/components/schemas/var' when: @@ -473,6 +481,14 @@ components: type: integer format: int64 + value: + title: Testing reserved word 'value' + type: object + properties: + id: + type: integer + format: int64 + var: title: Testing reserved word 'var' type: object diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_11304_kotlin_backticks_reserved_words.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_11304_kotlin_backticks_reserved_words.yaml new file mode 100644 index 00000000000..33498515ac6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_11304_kotlin_backticks_reserved_words.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.3 +info: + title: Kotlin Issue + version: "1.0" + +servers: + - url: "http://localhost" + +paths: + /test/{value}: + post: + summary: test + operationId: test + parameters: + - name: value + in: path + required: true + schema: + type: string + example: something + responses: + '200': + description: OK \ No newline at end of file From 1b6d0f8746153def389c615ec7e79f04bdb9a67b Mon Sep 17 00:00:00 2001 From: Anakael Date: Sat, 15 Jan 2022 19:18:12 +0300 Subject: [PATCH 044/113] Add condition for header (#11325) --- .../libraries/httpclient/api.mustache | 12 +++---- .../src/Org.OpenAPITools/Api/FakeApi.cs | 8 ++--- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache index f1f8a890d3d..c0d49570a62 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache @@ -489,21 +489,21 @@ namespace {{packageName}}.{{apiPackage}} {{/isApiKey}} {{#isBasicBasic}} // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } {{/isBasicBasic}} {{#isBasicBearer}} // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } {{/isBasicBearer}} {{#isOAuth}} // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -689,14 +689,14 @@ namespace {{packageName}}.{{apiPackage}} {{#isBasic}} {{#isBasicBasic}} // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } {{/isBasicBasic}} {{#isBasicBearer}} // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -704,7 +704,7 @@ namespace {{packageName}}.{{apiPackage}} {{/isBasic}} {{#isOAuth}} // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs index b43035fbb26..542c9dadd54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2121,7 +2121,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2258,7 +2258,7 @@ namespace Org.OpenAPITools.Api // authentication (http_basic_test) required // http basic authentication required - if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Org.OpenAPITools.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -2533,7 +2533,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -2616,7 +2616,7 @@ namespace Org.OpenAPITools.Api // authentication (bearer_test) required // bearer authentication required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/PetApi.cs index f38f7cb7557..a4ab1260df9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/PetApi.cs @@ -719,7 +719,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -800,7 +800,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -862,7 +862,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -927,7 +927,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1006,7 +1006,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1088,7 +1088,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1169,7 +1169,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1253,7 +1253,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1450,7 +1450,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1531,7 +1531,7 @@ namespace Org.OpenAPITools.Api } // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1600,7 +1600,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1672,7 +1672,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1743,7 +1743,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1817,7 +1817,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1889,7 +1889,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } @@ -1964,7 +1964,7 @@ namespace Org.OpenAPITools.Api // authentication (petstore_auth) required // oauth required - if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); } From 249968e397c481e9c78b587975a8aa2417c14083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul-Etienne=20Fran=C3=A7ois?= Date: Sat, 15 Jan 2022 17:51:40 +0100 Subject: [PATCH 045/113] [Java][Native] Fix the Content-Type and Accept headers that were forced to application/json (#11303) * [Java][Native] Fix the Content-Type and Accept headers that were forced to application/json * Update the generated samples after fixing issue no. 6779 --- .../main/resources/Java/libraries/native/api.mustache | 4 ++-- .../main/java/org/openapitools/client/api/FakeApi.java | 10 +++++----- .../main/java/org/openapitools/client/api/PetApi.java | 6 +++--- .../java/org/openapitools/client/api/StoreApi.java | 4 ++-- .../main/java/org/openapitools/client/api/UserApi.java | 4 ++-- .../main/java/org/openapitools/client/api/FakeApi.java | 10 +++++----- .../main/java/org/openapitools/client/api/PetApi.java | 6 +++--- .../java/org/openapitools/client/api/StoreApi.java | 4 ++-- .../main/java/org/openapitools/client/api/UserApi.java | 4 ++-- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 218a432d106..86fb8dd899c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -341,9 +341,9 @@ public class {{classname}} { } {{/headerParams}} {{#bodyParam}} - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{mediaType}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); {{/bodyParam}} - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); {{#bodyParam}} try { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java index 69e4b4562c5..b600572f511 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java @@ -148,7 +148,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "application/xml"); localVarRequestBuilder.header("Accept", "application/json"); try { @@ -241,7 +241,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); @@ -333,7 +333,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); @@ -425,7 +425,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); @@ -517,7 +517,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java index 69c55b8cb66..f8020e0d6fe 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java @@ -330,7 +330,7 @@ public class PetApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -433,7 +433,7 @@ public class PetApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -524,7 +524,7 @@ public class PetApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java index 0ed6d0b6db1..65430c5eaa5 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java @@ -316,7 +316,7 @@ public class StoreApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -407,7 +407,7 @@ public class StoreApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java index 209d289e08e..5e05a49b80c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java @@ -479,7 +479,7 @@ public class UserApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -585,7 +585,7 @@ public class UserApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 6618620891c..665df72be2f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -146,7 +146,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Content-Type", "application/xml"); localVarRequestBuilder.header("Accept", "application/json"); try { @@ -221,7 +221,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); @@ -295,7 +295,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); @@ -369,7 +369,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); @@ -443,7 +443,7 @@ public class FakeApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index 758142dfa7b..b113b63a959 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -309,7 +309,7 @@ public class PetApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -394,7 +394,7 @@ public class PetApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -467,7 +467,7 @@ public class PetApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java index bde07853f96..2f142dd9411 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java @@ -278,7 +278,7 @@ public class StoreApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -351,7 +351,7 @@ public class StoreApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index 2ce486c6491..b4ceaf86bf9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -456,7 +456,7 @@ public class UserApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { @@ -544,7 +544,7 @@ public class UserApi { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { From 0427681bc48064555017523b76677e42d876b86f Mon Sep 17 00:00:00 2001 From: jiangyuan Date: Sun, 16 Jan 2022 10:23:15 +0800 Subject: [PATCH 046/113] fix java apache-httpclient set basePath (#11277) --- .../Java/libraries/apache-httpclient/ApiClient.mustache | 1 + .../src/main/java/org/openapitools/client/ApiClient.java | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index dadec3c2cce..371f8ee7268 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -228,6 +228,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; return this; } diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 686ad20b951..754393e13a0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -193,6 +193,7 @@ public class ApiClient extends JavaTimeFormatter { */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; return this; } From c12456de8e4f7d099f5e588f48607a7bfbb31deb Mon Sep 17 00:00:00 2001 From: mvistein Date: Sun, 16 Jan 2022 03:29:47 +0100 Subject: [PATCH 047/113] [Java-okhttp-gson] Do not set content-type if content type is null #2 (#11315) * Fixing empty Content-Type in HTTP requests * Updating samples --- .../okhttp-gson-nextgen/api.mustache | 2 +- .../Java/libraries/okhttp-gson/api.mustache | 2 +- .../org/openapitools/client/api/PingApi.java | 2 +- .../client/api/AnotherFakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 28 +++++++++---------- .../client/api/FakeClassnameTags123Api.java | 2 +- .../org/openapitools/client/api/PetApi.java | 18 ++++++------ .../org/openapitools/client/api/StoreApi.java | 8 +++--- .../org/openapitools/client/api/UserApi.java | 16 +++++------ .../client/api/AnotherFakeApi.java | 2 +- .../openapitools/client/api/DefaultApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 28 +++++++++---------- .../client/api/FakeClassnameTags123Api.java | 2 +- .../org/openapitools/client/api/PetApi.java | 18 ++++++------ .../org/openapitools/client/api/StoreApi.java | 8 +++--- .../org/openapitools/client/api/UserApi.java | 16 +++++------ .../client/api/AnotherFakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 28 +++++++++---------- .../client/api/FakeClassnameTags123Api.java | 2 +- .../org/openapitools/client/api/PetApi.java | 18 ++++++------ .../org/openapitools/client/api/StoreApi.java | 8 +++--- .../org/openapitools/client/api/UserApi.java | 16 +++++------ .../client/api/AnotherFakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 28 +++++++++---------- .../client/api/FakeClassnameTags123Api.java | 2 +- .../org/openapitools/client/api/PetApi.java | 18 ++++++------ .../org/openapitools/client/api/StoreApi.java | 8 +++--- .../org/openapitools/client/api/UserApi.java | 16 +++++------ 28 files changed, 152 insertions(+), 152 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache index e0d605818d3..943e6948de7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache @@ -173,7 +173,7 @@ public class {{classname}} { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index c55259c44fe..e81f874f1e1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -204,7 +204,7 @@ public class {{classname}} { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java index 5f408920f53..dc64eace544 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java @@ -123,7 +123,7 @@ public class PingApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 815719efc1f..5f6571f9e7d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -133,7 +133,7 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java index c7332815b44..c55d1e12c08 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java @@ -141,7 +141,7 @@ public class FakeApi { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -272,7 +272,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -402,7 +402,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -532,7 +532,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -662,7 +662,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -792,7 +792,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -925,7 +925,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1064,7 +1064,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1269,7 +1269,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1479,7 +1479,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1623,7 +1623,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1844,7 +1844,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1984,7 +1984,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -2132,7 +2132,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 2483077a5c8..c508d0d8bb6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -133,7 +133,7 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java index e5ba0411588..085d9f0ec8e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java @@ -137,7 +137,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -275,7 +275,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -414,7 +414,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -556,7 +556,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -704,7 +704,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -848,7 +848,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -999,7 +999,7 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1147,7 +1147,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1299,7 +1299,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java index 1e32b8c7607..afa9b5c026d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java @@ -135,7 +135,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -268,7 +268,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -398,7 +398,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -540,7 +540,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index faf4e626946..2051423374c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -134,7 +134,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -265,7 +265,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -396,7 +396,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -529,7 +529,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -666,7 +666,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -811,7 +811,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -956,7 +956,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1082,7 +1082,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 9482a5a5f86..52c19920a97 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -91,7 +91,7 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java index 70e9788eb14..7741b8200a9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -90,7 +90,7 @@ public class DefaultApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java index 0e4cf97f1c8..d413cd3e829 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java @@ -98,7 +98,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -209,7 +209,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -323,7 +323,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -437,7 +437,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -551,7 +551,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -664,7 +664,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -780,7 +780,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -897,7 +897,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1086,7 +1086,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1292,7 +1292,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1432,7 +1432,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1631,7 +1631,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1749,7 +1749,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1890,7 +1890,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 1fac7240705..34c9d282281 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -91,7 +91,7 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java index c1523ef0790..8c8a226d0cb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java @@ -93,7 +93,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -208,7 +208,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -325,7 +325,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -454,7 +454,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -586,7 +586,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -713,7 +713,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -839,7 +839,7 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -965,7 +965,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1101,7 +1101,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java index 5d93e632223..f57a9e3ff70 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java @@ -93,7 +93,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -204,7 +204,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -318,7 +318,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -444,7 +444,7 @@ public class StoreApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java index 56c6433a490..f6d5e33327c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java @@ -92,7 +92,7 @@ public class UserApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -201,7 +201,7 @@ public class UserApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -310,7 +310,7 @@ public class UserApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -421,7 +421,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -536,7 +536,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -671,7 +671,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -800,7 +800,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -904,7 +904,7 @@ public class UserApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index af9e915240d..5789ec8083b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -122,7 +122,7 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index b27961d1479..450dbb1a5b7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -130,7 +130,7 @@ public class FakeApi { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -253,7 +253,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -375,7 +375,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -497,7 +497,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -619,7 +619,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -741,7 +741,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -869,7 +869,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1000,7 +1000,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1197,7 +1197,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1417,7 +1417,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1571,7 +1571,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1784,7 +1784,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1916,7 +1916,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -2071,7 +2071,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index d6bac0d84af..e9e0d6cb8c9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -122,7 +122,7 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index 2f90b4257f9..580a5f993ce 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -126,7 +126,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -259,7 +259,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -393,7 +393,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -530,7 +530,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -670,7 +670,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -806,7 +806,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -949,7 +949,7 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1089,7 +1089,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1233,7 +1233,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index 9aeea0062d0..e17f7df6c48 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -124,7 +124,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -249,7 +249,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -371,7 +371,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -505,7 +505,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index abf14e6dba3..627f7880487 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -123,7 +123,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -246,7 +246,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -369,7 +369,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -494,7 +494,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -623,7 +623,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -766,7 +766,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -903,7 +903,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1021,7 +1021,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index af9e915240d..5789ec8083b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -122,7 +122,7 @@ public class AnotherFakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index b27961d1479..450dbb1a5b7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -130,7 +130,7 @@ public class FakeApi { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -253,7 +253,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -375,7 +375,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -497,7 +497,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -619,7 +619,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -741,7 +741,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -869,7 +869,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1000,7 +1000,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1197,7 +1197,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1417,7 +1417,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1571,7 +1571,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1784,7 +1784,7 @@ public class FakeApi { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1916,7 +1916,7 @@ public class FakeApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -2071,7 +2071,7 @@ public class FakeApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index d6bac0d84af..e9e0d6cb8c9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -122,7 +122,7 @@ public class FakeClassnameTags123Api { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index 2f90b4257f9..580a5f993ce 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -126,7 +126,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -259,7 +259,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -393,7 +393,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -530,7 +530,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -670,7 +670,7 @@ public class PetApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -806,7 +806,7 @@ public class PetApi { "application/json", "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -949,7 +949,7 @@ public class PetApi { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1089,7 +1089,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1233,7 +1233,7 @@ public class PetApi { "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index 9aeea0062d0..e17f7df6c48 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -124,7 +124,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -249,7 +249,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -371,7 +371,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -505,7 +505,7 @@ public class StoreApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index abf14e6dba3..627f7880487 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -123,7 +123,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -246,7 +246,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -369,7 +369,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -494,7 +494,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -623,7 +623,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -766,7 +766,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -903,7 +903,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } @@ -1021,7 +1021,7 @@ public class UserApi { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null && localVarContentTypes != null) { + if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } From 5bccbf6734e82184e8a4aba0d2bb46a28bfb7276 Mon Sep 17 00:00:00 2001 From: mactho Date: Sat, 15 Jan 2022 18:39:20 -0800 Subject: [PATCH 048/113] Fix an issue where moustache template adds an extra null to the generated source code when 'nullable: true' is used in the api spec (#11284) Co-authored-by: Thomas MacNeil --- .../main/resources/kotlin-client/model_room_init_var.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache index 01896d2439f..3e6f299d3d6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache @@ -1 +1 @@ -{{#isNullable}}?{{/isNullable}}{{^required}}?{{/required}}{{#defaultvalue}} = {{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}{{#isNullable}} = null{{/isNullable}}{{^required}} = null{{/required}}{{/defaultvalue}} \ No newline at end of file +{{#isNullable}}?{{/isNullable}}{{^required}}{{^isNullable}}?{{/isNullable}}{{/required}}{{#defaultvalue}} = {{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}{{#isNullable}} = null{{/isNullable}}{{^required}}{{^isNullable}} = null{{/isNullable}}{{/required}}{{/defaultvalue}} \ No newline at end of file From ffe5df8fa1726478b10cc9879476857e462b30e0 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sun, 16 Jan 2022 01:12:38 -0800 Subject: [PATCH 049/113] Turns python-legacy CI back on in circle, fixes python-legacy test (#11326) * Turns python-legacy CI back on in circle, fixes python-legacy test * Installs python 2.7 into circleci node 3 * Python 2.7 version changed to 2.7 * Switches back to py2714 --- CI/circle_parallel.sh | 1 + pom.xml | 1 + .../client/petstore/python-legacy/test/test_fake_api.py | 5 ++++- .../openapi3/client/petstore/python-legacy/test_python2.sh | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 697009699a3..74e5f018f1b 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -59,6 +59,7 @@ elif [ "$NODE_INDEX" = "3" ]; then #sudo make altinstall pyenv install --list pyenv install 3.6.3 + pyenv install 2.7.14 pyenv global 3.6.3 python3 --version diff --git a/pom.xml b/pom.xml index 318bf21f0dc..06a209e7458 100644 --- a/pom.xml +++ b/pom.xml @@ -1283,6 +1283,7 @@ samples/client/petstore/python samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent samples/openapi3/client/petstore/python + samples/openapi3/client/petstore/python-legacy + samples/server/petstore/java-camel samples/server/petstore/jaxrs-jersey samples/server/petstore/jaxrs-spec samples/server/petstore/jaxrs-spec-interface @@ -1246,12 +1247,14 @@ + samples/client/petstore/spring-cloud samples/openapi3/client/petstore/spring-cloud samples/client/petstore/spring-cloud-date-time samples/openapi3/client/petstore/spring-cloud-date-time + samples/client/petstore/spring-stubs + samples/openapi3/client/petstore/spring-stubs - samples/server/petstore/java-camel samples/server/petstore/spring-mvc samples/server/petstore/spring-mvc-default-value samples/server/petstore/spring-mvc-j8-async diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index ff55cadf21f..d5f99122143 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -22,7 +23,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Pet", description = "the Pet API") public interface PetApi { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index f968f960775..8967afe8802 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -22,7 +22,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Store", description = "the Store API") public interface StoreApi { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 5ca513e5ffe..746cc2472d6 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -23,7 +23,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "User", description = "the User API") public interface UserApi { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java index f21d835af4d..af9a5d3bbec 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ + @ApiModel(description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Category { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Category { 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("}"); diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index ec1b1b81d6a..3ab8ad09cb6 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ + @ApiModel(description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -38,9 +41,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -58,9 +60,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -78,9 +79,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -89,7 +89,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +112,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java index 2f24cd46851..658d0de7168 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,13 +16,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ + @ApiModel(description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -32,7 +36,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -87,9 +91,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -107,9 +110,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -127,9 +129,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -147,10 +148,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -168,9 +167,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -188,9 +186,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -199,7 +196,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -226,7 +222,6 @@ public class Order { 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"); diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index a1f702f1a72..1c0c076a38c 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -18,13 +18,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ + @ApiModel(description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -91,9 +94,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -111,10 +113,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -132,10 +132,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -158,10 +156,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -187,10 +183,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -208,9 +202,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -219,7 +212,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -246,7 +238,6 @@ public class Pet { 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"); diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java index 8e3f6732233..86be70f2d3e 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ + @ApiModel(description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Tag { 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("}"); diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java index 73fcf01b537..e350716a933 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ + @ApiModel(description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -53,9 +56,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -73,9 +75,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -93,9 +94,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -113,9 +113,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -133,9 +132,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -153,9 +151,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -173,9 +170,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -193,9 +189,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -204,7 +199,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -233,7 +227,6 @@ public class User { 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"); diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 54e556cb9ed..7e8e9123594 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDate; import java.time.OffsetDateTime; import io.swagger.annotations.*; @@ -21,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Default", description = "the Default API") public interface DefaultApi { @@ -49,10 +52,10 @@ public interface DefaultApi { value = "/thingy/{date}" ) ResponseEntity get( - @ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @NotNull @ApiParam(value = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate xOrderDate, - @ApiParam(value = "A date cookie parameter") @CookieValue("loginDate") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate loginDate + @ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @NotNull @ApiParam(value = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, + @ApiParam(value = "A date cookie parameter") @CookieValue("loginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate ); @@ -79,8 +82,8 @@ public interface DefaultApi { consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "Updated last vist timestamp") @RequestParam(value="visitDate", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate + @ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "Updated last vist timestamp") @RequestParam(value="visitDate", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate ); } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index ac82a073506..9967f902fbf 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,11 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -21,7 +24,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Pet", description = "the Pet API") public interface PetApi { @@ -122,7 +127,7 @@ public interface PetApi { ) ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ); @@ -160,7 +165,7 @@ public interface PetApi { ) ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index b4b4df33915..94e33923fb3 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Store", description = "the Store API") public interface StoreApi { diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index fdd47d7f560..5dd5dabb68d 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "User", description = "the User API") public interface UserApi { diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java index f21d835af4d..af9a5d3bbec 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ + @ApiModel(description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Category { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Category { 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("}"); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index ec1b1b81d6a..3ab8ad09cb6 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ + @ApiModel(description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -38,9 +41,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -58,9 +60,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -78,9 +79,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -89,7 +89,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +112,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java index 2f24cd46851..658d0de7168 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,13 +16,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ + @ApiModel(description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -32,7 +36,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -87,9 +91,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -107,9 +110,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -127,9 +129,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -147,10 +148,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -168,9 +167,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -188,9 +186,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -199,7 +196,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -226,7 +222,6 @@ public class Order { 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"); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index a1f702f1a72..1c0c076a38c 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -18,13 +18,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ + @ApiModel(description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -91,9 +94,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -111,10 +113,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -132,10 +132,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -158,10 +156,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -187,10 +183,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -208,9 +202,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -219,7 +212,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -246,7 +238,6 @@ public class Pet { 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"); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 8e3f6732233..86be70f2d3e 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ + @ApiModel(description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Tag { 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("}"); diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java index 73fcf01b537..e350716a933 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ + @ApiModel(description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -53,9 +56,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -73,9 +75,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -93,9 +94,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -113,9 +113,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -133,9 +132,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -153,9 +151,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -173,9 +170,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -193,9 +189,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -204,7 +199,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -233,7 +227,6 @@ public class User { 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"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index a9cde131118..5bb72a8db6d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -21,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Pet", description = "the Pet API") public interface PetApi { diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index ab7dd8afc55..cc5a4ab5f12 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Store", description = "the Store API") public interface StoreApi { diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index e44789929a7..cf4bf183396 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "User", description = "the User API") public interface UserApi { diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index 26f5a6768a3..a34d3d59121 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ + @ApiModel(description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Category { * Get name * @return name */ + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(value = "") - -@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") public String getName() { return name; } @@ -66,7 +67,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Category { 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("}"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index ec1b1b81d6a..3ab8ad09cb6 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ + @ApiModel(description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -38,9 +41,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -58,9 +60,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -78,9 +79,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -89,7 +89,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +112,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index 2f24cd46851..658d0de7168 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,13 +16,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ + @ApiModel(description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -32,7 +36,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -87,9 +91,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -107,9 +110,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -127,9 +129,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -147,10 +148,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -168,9 +167,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -188,9 +186,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -199,7 +196,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -226,7 +222,6 @@ public class Order { 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"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index a1f702f1a72..1c0c076a38c 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -18,13 +18,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ + @ApiModel(description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -91,9 +94,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -111,10 +113,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -132,10 +132,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -158,10 +156,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -187,10 +183,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -208,9 +202,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -219,7 +212,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -246,7 +238,6 @@ public class Pet { 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"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index 8e3f6732233..86be70f2d3e 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ + @ApiModel(description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Tag { 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("}"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index 73fcf01b537..e350716a933 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ + @ApiModel(description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -53,9 +56,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -73,9 +75,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -93,9 +94,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -113,9 +113,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -133,9 +132,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -153,9 +151,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -173,9 +170,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -193,9 +189,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -204,7 +199,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -233,7 +227,6 @@ public class User { 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"); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index a893c689611..ea38051f7a9 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -21,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 1ffe7a38f36..49e3a394772 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 2baaed308ed..1eaf80c6155 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java index f21d835af4d..af9a5d3bbec 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ + @ApiModel(description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Category { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Category { 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("}"); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index ec1b1b81d6a..3ab8ad09cb6 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ + @ApiModel(description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -38,9 +41,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -58,9 +60,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -78,9 +79,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -89,7 +89,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +112,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java index 2f24cd46851..658d0de7168 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,13 +16,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ + @ApiModel(description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -32,7 +36,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -87,9 +91,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -107,9 +110,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -127,9 +129,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -147,10 +148,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -168,9 +167,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -188,9 +186,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -199,7 +196,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -226,7 +222,6 @@ public class Order { 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"); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index a1f702f1a72..1c0c076a38c 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -18,13 +18,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ + @ApiModel(description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -91,9 +94,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -111,10 +113,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -132,10 +132,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -158,10 +156,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -187,10 +183,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -208,9 +202,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -219,7 +212,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -246,7 +238,6 @@ public class Pet { 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"); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java index 8e3f6732233..86be70f2d3e 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ + @ApiModel(description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -35,9 +38,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -55,9 +57,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -66,7 +67,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Tag { 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("}"); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java index 73fcf01b537..e350716a933 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ + @ApiModel(description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -53,9 +56,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -73,9 +75,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -93,9 +94,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -113,9 +113,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -133,9 +132,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -153,9 +151,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -173,9 +170,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -193,9 +189,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -204,7 +199,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -233,7 +227,6 @@ public class User { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 88803c5bac2..7e87d57e371 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -29,7 +30,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "the Pet API") public interface PetApi { @@ -41,6 +44,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -68,6 +72,7 @@ public interface PetApi { * @return Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -96,6 +101,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -126,6 +132,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -156,6 +163,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -186,6 +194,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -216,6 +225,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -246,6 +256,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index da999d740a5..e58b40e6494 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -29,7 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "the Store API") public interface StoreApi { @@ -43,6 +45,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -66,6 +69,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -95,6 +99,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -121,6 +126,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 225627cbacc..7c13a46234c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -30,7 +30,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "the User API") public interface UserApi { @@ -43,6 +45,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -65,6 +68,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -87,6 +91,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -111,6 +116,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -136,6 +142,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -163,6 +170,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -187,6 +195,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -212,6 +221,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java index cb69c674a1e..03e4a4ce0b5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ -@Schema(name = "Category",description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ef610e38f0..ea4f1e40264 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ -@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java index 528598b79ea..e624a0d7c1f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,13 +15,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ -@Schema(name = "Order",description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 7c2986fea84..ddff66759ba 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -17,13 +17,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ -@Schema(name = "Pet",description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java index 27166f687a2..5c3ac82ba6e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ -@Schema(name = "Tag",description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java index ba24f681c1d..328569672eb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ -@Schema(name = "User",description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 7dbf104466f..7eb240e1ccc 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDate; import java.time.OffsetDateTime; import io.swagger.v3.oas.annotations.Operation; @@ -28,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Default", description = "the Default API") public interface DefaultApi { @@ -43,8 +46,7 @@ public interface DefaultApi { * @return OK (status code 200) */ @Operation( - summary = "", - tags = { }, + operationId = "get", responses = { @ApiResponse(responseCode = "200", description = "OK") } @@ -54,10 +56,10 @@ public interface DefaultApi { value = "/thingy/{date}" ) ResponseEntity get( - @Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "dateTime", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true, schema = @Schema(description = "")) @RequestHeader(value = "X-Order-Date", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate xOrderDate, - @Parameter(name = "loginDate", description = "A date cookie parameter", schema = @Schema(description = "")) @CookieValue("loginDate") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate loginDate + @Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "dateTime", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true, schema = @Schema(description = "")) @RequestHeader(value = "X-Order-Date", required = true) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate, + @Parameter(name = "loginDate", description = "A date cookie parameter", schema = @Schema(description = "")) @CookieValue("loginDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate ); @@ -70,8 +72,7 @@ public interface DefaultApi { * @return Invalid input (status code 405) */ @Operation( - summary = "", - tags = { }, + operationId = "updatePetWithForm", responses = { @ApiResponse(responseCode = "405", description = "Invalid input") } @@ -82,8 +83,8 @@ public interface DefaultApi { consumes = "application/x-www-form-urlencoded" ) ResponseEntity updatePetWithForm( - @Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "visitDate", description = "Updated last vist timestamp", schema = @Schema(description = "")) @RequestParam(value="visitDate", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate + @Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "visitDate", description = "Updated last vist timestamp", schema = @Schema(description = "")) @RequestParam(value="visitDate", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9085e07967b..a257403c105 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,7 +27,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "AnotherFake", description = "the AnotherFake API") public interface AnotherFakeApi { @@ -40,6 +42,7 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "call123testSpecialTags", summary = "To test special tags", tags = { "$another-fake?" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index a9d785eaea3..f6b8fb74feb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -7,11 +7,13 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -35,7 +37,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Fake", description = "the Fake API") public interface FakeApi { @@ -48,6 +52,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createXmlItem", summary = "creates an XmlItem", tags = { "fake" }, responses = { @@ -72,7 +77,7 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) @@ -96,7 +101,7 @@ public interface FakeApi { * @return Output composite (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) @@ -120,7 +125,7 @@ public interface FakeApi { * @return Output number (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) @@ -144,7 +149,7 @@ public interface FakeApi { * @return Output string (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) @@ -168,7 +173,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithFileSchema", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -192,7 +197,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithQueryParams", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -217,6 +222,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClientModel", summary = "To test \"client\" model", tags = { "fake" }, responses = { @@ -256,6 +262,7 @@ public interface FakeApi { * or User not found (status code 404) */ @Operation( + operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags = { "fake" }, responses = { @@ -282,8 +289,8 @@ public interface FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @RequestParam(value="float", required=false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @RequestParam(value="string", required=false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestParam("binary") MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @RequestParam(value="date", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @RequestParam(value="dateTime", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @RequestParam(value="date", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @RequestParam(value="dateTime", required=false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @RequestParam(value="password", required=false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @RequestParam(value="callback", required=false) String paramCallback ); @@ -305,6 +312,7 @@ public interface FakeApi { * or Not found (status code 404) */ @Operation( + operationId = "testEnumParameters", summary = "To test enum parameters", tags = { "fake" }, responses = { @@ -342,6 +350,7 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @Operation( + operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", tags = { "fake" }, responses = { @@ -369,6 +378,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", tags = { "fake" }, responses = { @@ -393,6 +403,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testJsonFormData", summary = "test json serialization of form data", tags = { "fake" }, responses = { @@ -422,7 +433,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testQueryParameterCollectionFormat", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 4239438bd3c..4be02096d7b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -27,7 +27,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "FakeClassnameTags123", description = "the FakeClassnameTags123 API") public interface FakeClassnameTags123Api { @@ -40,6 +42,7 @@ public interface FakeClassnameTags123Api { * @return successful operation (status code 200) */ @Operation( + operationId = "testClassname", summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index c618e1e4d90..b5d40e07435 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -29,7 +30,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "the Pet API") public interface PetApi { @@ -42,6 +45,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -71,6 +75,7 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -100,6 +105,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -130,6 +136,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -160,6 +167,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -191,6 +199,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -222,6 +231,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -252,6 +262,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { @@ -283,6 +294,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", tags = { "pet" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index d8329e19d40..f660e0a976d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "the Store API") public interface StoreApi { @@ -42,6 +44,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -65,6 +68,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -94,6 +98,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -120,6 +125,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index 665546ec700..de834ecc233 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "the User API") public interface UserApi { @@ -42,6 +44,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -64,6 +67,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -86,6 +90,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -110,6 +115,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -135,6 +141,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -162,6 +169,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -186,6 +194,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -211,6 +220,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0c57ae7dd14..88ea058c0c5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5285ec2f29..0d4d67f1a9e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index f8ca38c286d..219d797ee64 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dfd28ccb996..b2245551ad3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ - @Schema(name = "mapString", defaultValue = "") - - + + @Schema(name = "map_string", required = false) public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ - @Schema(name = "mapNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_number", required = false) public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ - @Schema(name = "mapInteger", defaultValue = "") - - + + @Schema(name = "map_integer", required = false) public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ - @Schema(name = "mapBoolean", defaultValue = "") - - + + @Schema(name = "map_boolean", required = false) public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ - @Schema(name = "mapArrayInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_integer", required = false) public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ - @Schema(name = "mapArrayAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_anytype", required = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ - @Schema(name = "mapMapString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_string", required = false) public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ - @Schema(name = "mapMapAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_anytype", required = false) public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ - @Schema(name = "anytype1", defaultValue = "") - - + + @Schema(name = "anytype_1", required = false) public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ - @Schema(name = "anytype2", defaultValue = "") - - + + @Schema(name = "anytype_2", required = false) public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ - @Schema(name = "anytype3", defaultValue = "") - - + + @Schema(name = "anytype_3", required = false) public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5fea577ab44..ea102c40ed2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index e6eee612a24..7a3a5d839f8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index d7116bd7572..22e47f1bc1c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index d2022be266f..91f47a9e83e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java index 6f096d5069e..ef0fc61b5b6 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java @@ -14,19 +14,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ - @Schema(name = "className", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "className", required = true) public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ - @Schema(name = "color", defaultValue = "") - - + + @Schema(name = "color", required = false) public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ebe36ad761a..ad560c9d834 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ - @Schema(name = "arrayArrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayArrayNumber", required = false) public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 8158dd44ab8..4409856d5a3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ - @Schema(name = "arrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayNumber", required = false) public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java index 420010561bc..fd25397b6b6 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ - @Schema(name = "arrayOfString", defaultValue = "") - - + + @Schema(name = "array_of_string", required = false) public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @Schema(name = "arrayArrayOfInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_integer", required = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @Schema(name = "arrayArrayOfModel", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_model", required = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java index 7f4a080ad8d..275a075f527 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -72,9 +75,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -83,7 +85,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java index d0a47ab5127..3640a6301af 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCatAllOf { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -103,7 +104,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java index 92d9a7245f1..80d6c5b2851 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ - @Schema(name = "smallCamel", defaultValue = "") - - + + @Schema(name = "smallCamel", required = false) public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ - @Schema(name = "capitalCamel", defaultValue = "") - - + + @Schema(name = "CapitalCamel", required = false) public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ - @Schema(name = "smallSnake", defaultValue = "") - - + + @Schema(name = "small_Snake", required = false) public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ - @Schema(name = "capitalSnake", defaultValue = "") - - + + @Schema(name = "Capital_Snake", required = false) public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @Schema(name = "scAETHFlowPoints", defaultValue = "") - - + + @Schema(name = "SCA_ETH_Flow_Points", required = false) public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ - @Schema(name = "ATT_NAME", defaultValue = "Name of the pet ") - - + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java index 2e496fb4acc..0b3c8b8759b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java index b732a62b1bc..19ffd6fffea 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java index 038fc8df3af..66dd429525d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java index fa2a736f4fb..13a83893e61 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@Schema(name = "ClassModel",description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "_class", required = false) public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java index e11bd4ff1b1..9fbd7e3b433 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ - @Schema(name = "client", defaultValue = "") - - + + @Schema(name = "client", required = false) public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java index ed5dc71a4ba..36f36600daf 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java index 2c99bc376c3..cc0bafc92e3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java index e1b2df0716a..c3e82d4c028 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ - @Schema(name = "justSymbol", defaultValue = "") - - + + @Schema(name = "just_symbol", required = false) public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ - @Schema(name = "arrayEnum", defaultValue = "") - - + + @Schema(name = "array_enum", required = false) public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumClass.java index e3d30c1ad45..4e6027d16c4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumClass.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java index 938af53e2b8..19ea0acc7a7 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ - @Schema(name = "enumString", defaultValue = "") - - + + @Schema(name = "enum_string", required = false) public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ - @Schema(name = "enumStringRequired", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "enum_string_required", required = true) public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ - @Schema(name = "enumInteger", defaultValue = "") - - + + @Schema(name = "enum_integer", required = false) public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ - @Schema(name = "enumNumber", defaultValue = "") - - + + @Schema(name = "enum_number", required = false) public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ - @Schema(name = "outerEnum", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "outerEnum", required = false) public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java index 001b30e1475..a2ee29fbfd6 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java index c16669d0c25..77868e77410 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ - @Schema(name = "file", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "file", required = false) public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ - @Schema(name = "files", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "files", required = false) public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java index 6546370cd32..0c14e2c93c1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -17,12 +19,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ - @Schema(name = "integer", defaultValue = "") - -@Min(10) @Max(100) + @Min(10) @Max(100) + @Schema(name = "integer", required = false) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ - @Schema(name = "int32", defaultValue = "") - -@Min(20) @Max(200) + @Min(20) @Max(200) + @Schema(name = "int32", required = false) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ - @Schema(name = "int64", defaultValue = "") - - + + @Schema(name = "int64", required = false) public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ - @Schema(name = "number", required = true, defaultValue = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ - @Schema(name = "_float", defaultValue = "") - -@DecimalMin("54.3") @DecimalMax("987.6") + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ - @Schema(name = "_double", defaultValue = "") - -@DecimalMin("67.8") @DecimalMax("123.4") + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ - @Schema(name = "string", defaultValue = "") - -@Pattern(regexp = "/[a-z]/i") + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ - @Schema(name = "_byte", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "byte", required = true) public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ - @Schema(name = "binary", defaultValue = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + @Valid + @Schema(name = "binary", required = false) + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ - @Schema(name = "date", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "date", required = true) public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ - @Schema(name = "password", required = true, defaultValue = "") - @NotNull - -@Size(min = 10, max = 64) + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ - @Schema(name = "bigDecimal", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "BigDecimal", required = false) public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index dfb615a529f..ec728db1f14 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ - @Schema(name = "foo", readOnly = true, defaultValue = "") - - + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java index 3ff73062758..2da2a81ac82 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ - @Schema(name = "mapMapOfString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_of_string", required = false) public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ - @Schema(name = "mapOfEnumString", defaultValue = "") - - + + @Schema(name = "map_of_enum_string", required = false) public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ - @Schema(name = "directMap", defaultValue = "") - - + + @Schema(name = "direct_map", required = false) public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ - @Schema(name = "indirectMap", defaultValue = "") - - + + @Schema(name = "indirect_map", required = false) public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 03a7be43cc4..9681c13f29d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,17 +19,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ - @Schema(name = "uuid", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", required = false) public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ - @Schema(name = "map", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map", required = false) public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java index 77bf91649b0..48528166d1c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@Schema(name = "200_response",description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "class", required = false) public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java index 2443600df22..4312ff4cc72 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java index 03dba280141..11078e7094e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ - @Schema(name = "_123list", defaultValue = "") - - + + @Schema(name = "123-list", required = false) public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java index 0301a47e9f3..37c94a6aa80 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@Schema(name = "Return",description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Return", description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ - @Schema(name = "_return", defaultValue = "") - - + + @Schema(name = "return", required = false) public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java index 62a16f80ee0..2876e64e991 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@Schema(name = "Name",description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ - @Schema(name = "snakeCase", readOnly = true, defaultValue = "") - - + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ - @Schema(name = "property", defaultValue = "") - - + + @Schema(name = "property", required = false) public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ - @Schema(name = "_123number", readOnly = true, defaultValue = "") - - + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java index 521fad80d5a..05c9f0a7785 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ - @Schema(name = "justNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "JustNumber", required = false) public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java index 05071bdfe2b..90b0d295718 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java index a721a3dde6a..14ff8ff8a9f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ - @Schema(name = "myNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "my_number", required = false) public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ - @Schema(name = "myString", defaultValue = "") - - + + @Schema(name = "my_string", required = false) public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ - @Schema(name = "myBoolean", defaultValue = "") - - + + @Schema(name = "my_boolean", required = false) public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterEnum.java index ba0cca8a5e8..7fdf6f47de3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/OuterEnum.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index 988eb317134..51d583a02e5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -20,12 +20,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -92,9 +95,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -112,10 +114,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -133,10 +133,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -159,10 +157,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public Set getPhotoUrls() { return photoUrls; } @@ -189,10 +185,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -210,9 +204,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -221,7 +214,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -248,7 +240,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1c51770a8e6..1d95448aeef 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ - @Schema(name = "baz", defaultValue = "") - - + + @Schema(name = "baz", required = false) public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java index 75f4be4e9f8..3dcdd9ee3f5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @Schema(name = "$specialPropertyName", defaultValue = "") - - + + @Schema(name = "$special[property.name]", required = false) public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java index 8722df999bf..6b24df20471 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java index 19e9bf310f7..66695c3e847 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", required = true) public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", required = true) public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", required = true) public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", required = true) public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java index c9a3762bc74..fdc9a096075 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", example = "what", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", example = "what", required = true) public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ - @Schema(name = "floatItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", example = "-2", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", example = "true", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", example = "true", required = true) public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", example = "[0, 1, 2, 3]", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java index 83152a15553..9aae48b0ceb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java index 59a183db0f6..b886d9d3f61 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ - @Schema(name = "attributeString", example = "string", defaultValue = "") - - + + @Schema(name = "attribute_string", example = "string", required = false) public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ - @Schema(name = "attributeNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ - @Schema(name = "attributeInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "attribute_integer", example = "-2", required = false) public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ - @Schema(name = "attributeBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "attribute_boolean", example = "true", required = false) public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ - @Schema(name = "wrappedArray", defaultValue = "") - - + + @Schema(name = "wrapped_array", required = false) public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ - @Schema(name = "nameString", example = "string", defaultValue = "") - - + + @Schema(name = "name_string", example = "string", required = false) public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ - @Schema(name = "nameNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "name_number", example = "1.234", required = false) public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ - @Schema(name = "nameInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "name_integer", example = "-2", required = false) public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ - @Schema(name = "nameBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "name_boolean", example = "true", required = false) public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ - @Schema(name = "nameArray", defaultValue = "") - - + + @Schema(name = "name_array", required = false) public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ - @Schema(name = "nameWrappedArray", defaultValue = "") - - + + @Schema(name = "name_wrapped_array", required = false) public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ - @Schema(name = "prefixString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_string", example = "string", required = false) public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ - @Schema(name = "prefixNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ - @Schema(name = "prefixInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_integer", example = "-2", required = false) public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ - @Schema(name = "prefixBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_boolean", example = "true", required = false) public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ - @Schema(name = "prefixArray", defaultValue = "") - - + + @Schema(name = "prefix_array", required = false) public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ - @Schema(name = "prefixWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_wrapped_array", required = false) public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ - @Schema(name = "namespaceString", example = "string", defaultValue = "") - - + + @Schema(name = "namespace_string", example = "string", required = false) public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ - @Schema(name = "namespaceNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ - @Schema(name = "namespaceInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "namespace_integer", example = "-2", required = false) public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ - @Schema(name = "namespaceBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "namespace_boolean", example = "true", required = false) public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ - @Schema(name = "namespaceArray", defaultValue = "") - - + + @Schema(name = "namespace_array", required = false) public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @Schema(name = "namespaceWrappedArray", defaultValue = "") - - + + @Schema(name = "namespace_wrapped_array", required = false) public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ - @Schema(name = "prefixNsString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_ns_string", example = "string", required = false) public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ - @Schema(name = "prefixNsNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ - @Schema(name = "prefixNsInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ - @Schema(name = "prefixNsBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ - @Schema(name = "prefixNsArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_array", required = false) public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @Schema(name = "prefixNsWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_wrapped_array", required = false) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 9eb95c97b89..4ae25d24dfb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -6,7 +6,9 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -28,7 +30,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "the Pet API") public interface PetApi { @@ -40,6 +44,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -67,6 +72,7 @@ public interface PetApi { * @return Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -95,6 +101,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -112,7 +119,7 @@ public interface PetApi { ) ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status, - final org.springframework.data.domain.Pageable pageable + final Pageable pageable ); @@ -126,6 +133,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -143,7 +151,7 @@ public interface PetApi { ) ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags, - final org.springframework.data.domain.Pageable pageable + final Pageable pageable ); @@ -157,6 +165,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -187,6 +196,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -217,6 +227,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -247,6 +258,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index a11117a8c9f..680489f3b4a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "the Store API") public interface StoreApi { @@ -42,6 +44,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -65,6 +68,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -94,6 +98,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -120,6 +125,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index f583fb099e7..d51556186fe 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "the User API") public interface UserApi { @@ -42,6 +44,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -64,6 +67,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -86,6 +90,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -110,6 +115,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -135,6 +141,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -162,6 +169,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -186,6 +194,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -207,6 +216,7 @@ public interface UserApi { * @return endpoint configuration response (status code 200) */ @Operation( + operationId = "logoutUserOptions", summary = "logoutUserOptions", tags = { "user" }, responses = { @@ -232,6 +242,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java index cb69c674a1e..03e4a4ce0b5 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ -@Schema(name = "Category",description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ef610e38f0..ea4f1e40264 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ -@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java index 528598b79ea..e624a0d7c1f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,13 +15,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ -@Schema(name = "Order",description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 7c2986fea84..ddff66759ba 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -17,13 +17,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ -@Schema(name = "Pet",description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 27166f687a2..5c3ac82ba6e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ -@Schema(name = "Tag",description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java index ba24f681c1d..328569672eb 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ -@Schema(name = "User",description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 90dfd2c5f8e..9f82a438521 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -28,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "the Pet API") public interface PetApi { @@ -41,6 +44,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -70,6 +74,7 @@ public interface PetApi { * @return Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -98,6 +103,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -128,6 +134,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -158,6 +165,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -189,6 +197,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -221,6 +230,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -251,6 +261,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index c42b27e3a5b..a8bab9da996 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "the Store API") public interface StoreApi { @@ -42,6 +44,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -65,6 +68,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -94,6 +98,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -120,6 +125,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 5b0522ee775..6181c9579ea 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "the User API") public interface UserApi { @@ -42,6 +44,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -68,6 +71,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -94,6 +98,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -122,6 +127,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -150,6 +156,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -177,6 +184,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -201,6 +209,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -229,6 +238,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java index 463de0ed39a..823adb2ae4d 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ -@Schema(name = "Category",description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - -@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ef610e38f0..ea4f1e40264 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ -@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java index 528598b79ea..e624a0d7c1f 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,13 +15,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ -@Schema(name = "Order",description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 7c2986fea84..ddff66759ba 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -17,13 +17,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ -@Schema(name = "Pet",description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java index 27166f687a2..5c3ac82ba6e 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ -@Schema(name = "Tag",description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java index ba24f681c1d..328569672eb 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ -@Schema(name = "User",description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/openapi3/client/petstore/spring-stubs/.openapi-generator-ignore b/samples/openapi3/client/petstore/spring-stubs/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/.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/spring-stubs/.openapi-generator/FILES b/samples/openapi3/client/petstore/spring-stubs/.openapi-generator/FILES new file mode 100644 index 00000000000..87837793235 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/.openapi-generator/FILES @@ -0,0 +1,12 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java diff --git a/samples/openapi3/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/openapi3/client/petstore/spring-stubs/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/spring-stubs/README.md b/samples/openapi3/client/petstore/spring-stubs/README.md new file mode 100644 index 00000000000..d43a1de307d --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/README.md @@ -0,0 +1,27 @@ + +# OpenAPI generated API stub + +Spring Framework stub + + +## Overview +This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. +This is an example of building API stub interfaces in Java using the Spring framework. + +The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints +by adding ```@Controller``` classes that implement the interface. Eg: +```java +@Controller +public class PetController implements PetApi { +// implement all PetApi methods +} +``` + +You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: +```java +@FeignClient(name="pet", url="http://petstore.swagger.io/v2") +public interface PetClient extends PetApi { + +} +``` diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml new file mode 100644 index 00000000000..5e1f049caf4 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + org.openapitools.openapi3 + spring-stubs + jar + spring-stubs + 1.0.0 + + 1.8 + ${java.version} + ${java.version} + 2.1.11 + + + org.springframework.boot + spring-boot-starter-parent + 2.5.8 + + + src/main/java + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + io.swagger.core.v3 + swagger-annotations + ${swagger-core-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 00000000000..1245b1dd0cc --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,19 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 00000000000..a8206198c4a --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,359 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + */ + @Operation( + operationId = "addPet", + summary = "Add a new pet to the store", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet", + consumes = "application/json" + ) + default ResponseEntity addPet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + */ + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid pet value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/pet/{petId}" + ) + default ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /pet/findByStatus : 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 successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @Operation( + operationId = "findPetsByStatus", + summary = "Finds Pets by status", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid status value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByStatus", + produces = "application/json" + ) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /pet/findByTags : 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 successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Operation( + operationId = "findPetsByTags", + summary = "Finds Pets by tags", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByTags", + produces = "application/json" + ) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + @Operation( + operationId = "getPetById", + summary = "Find pet by ID", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/{petId}", + produces = "application/json" + ) + default ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/pet", + consumes = "application/json" + ) + default ResponseEntity updatePet( + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /pet/{petId} : 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 Invalid input (status code 405) + */ + @Operation( + operationId = "updatePetWithForm", + summary = "Updates a pet in the store with form data", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}", + consumes = "application/x-www-form-urlencoded" + ) + default ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /pet/{petId}/uploadImage : 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 successful operation (status code 200) + */ + @Operation( + operationId = "uploadFile", + summary = "uploads an image", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}/uploadImage", + produces = "application/json", + consumes = "multipart/form-data" + ) + default ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 00000000000..a0f582be8e2 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,189 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * DELETE /store/order/{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 Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "deleteOrder", + summary = "Delete purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/store/order/{orderId}" + ) + default ResponseEntity deleteOrder( + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getInventory", + summary = "Returns pet inventories by status", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/inventory", + produces = "application/json" + ) + default ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /store/order/{orderId} : 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 successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "getOrderById", + summary = "Find purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/order/{orderId}", + produces = "application/json" + ) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @Operation( + operationId = "placeOrder", + summary = "Place an order for a pet", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/store/order", + produces = "application/json" + ) + default ResponseEntity placeOrder( + @Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..ea95ba18f55 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,282 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "user", description = "the user API") +public interface UserApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUser", + summary = "Create user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user" + ) + default ResponseEntity createUser( + @Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithArrayInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithArray" + ) + default ResponseEntity createUsersWithArrayInput( + @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithListInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithList" + ) + default ResponseEntity createUsersWithListInput( + @Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "deleteUser", + summary = "Delete user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/user/{username}" + ) + default ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "getUserByName", + summary = "Get user by user name", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/{username}", + produces = "application/json" + ) + default ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @Operation( + operationId = "loginUser", + summary = "Logs user into the system", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/login", + produces = "application/json" + ) + default ResponseEntity loginUser( + @NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/logout" + ) + default ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "updateUser", + summary = "Updated user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/user/{username}" + ) + default ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, + @Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..03e4a4ce0b5 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A category for a pet + */ + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Category { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..ea4f1e40264 --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,132 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Describes the result of uploading an image resource + */ + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelApiResponse { + + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @Schema(name = "code", required = false) + 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 + */ + + @Schema(name = "type", required = false) + 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 + */ + + @Schema(name = "message", required = false) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..e624a0d7c1f --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,245 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * An order for a pets from the pet store + */ + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Order { + + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + 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 + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "petId", required = false) + 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 + */ + + @Schema(name = "quantity", required = false) + 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 + */ + @Valid + @Schema(name = "shipDate", required = false) + 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 + */ + + @Schema(name = "status", description = "Order Status", required = false) + 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 + */ + + @Schema(name = "complete", required = false) + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..ddff66759ba --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,261 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A pet for sale in the pet store + */ + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private Category category; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private List photoUrls = new ArrayList<>(); + + @JsonProperty("tags") + @Valid + 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 + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + @Valid + @Schema(name = "category", required = false) + 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 + */ + @NotNull + @Schema(name = "name", example = "doggie", required = true) + 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 + */ + @NotNull + @Schema(name = "photoUrls", required = true) + 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 + */ + @Valid + @Schema(name = "tags", required = false) + 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 + */ + + @Schema(name = "status", description = "pet status in the store", required = false) + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..5c3ac82ba6e --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A tag for a pet + */ + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Tag { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..328569672eb --- /dev/null +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,252 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A User who is purchasing from the pet store + */ + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class User { + + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "username", required = false) + 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 + */ + + @Schema(name = "firstName", required = false) + 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 + */ + + @Schema(name = "lastName", required = false) + 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 + */ + + @Schema(name = "email", required = false) + 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 + */ + + @Schema(name = "password", required = false) + 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 + */ + + @Schema(name = "phone", required = false) + 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 + */ + + @Schema(name = "userStatus", description = "User Status", required = false) + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 81ca2e8ee07..e6cdc38fc69 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -23,7 +23,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { @@ -36,6 +38,7 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "call123testSpecialTags", summary = "To test special tags", tags = { "$another-fake?" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7968826328d..7c04dd3bba6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -26,14 +27,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index d634215d030..02ebe80dc98 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -32,7 +34,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") public interface FakeApi { @@ -45,6 +49,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createXmlItem", summary = "creates an XmlItem", tags = { "fake" }, responses = { @@ -69,7 +74,7 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) @@ -93,7 +98,7 @@ public interface FakeApi { * @return Output composite (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) @@ -117,7 +122,7 @@ public interface FakeApi { * @return Output number (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) @@ -141,7 +146,7 @@ public interface FakeApi { * @return Output string (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) @@ -165,7 +170,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithFileSchema", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -189,7 +194,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithQueryParams", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -214,6 +219,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClientModel", summary = "To test \"client\" model", tags = { "fake" }, responses = { @@ -253,6 +259,7 @@ public interface FakeApi { * or User not found (status code 404) */ @Operation( + operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags = { "fake" }, responses = { @@ -279,8 +286,8 @@ public interface FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback ); @@ -302,6 +309,7 @@ public interface FakeApi { * or Not found (status code 404) */ @Operation( + operationId = "testEnumParameters", summary = "To test enum parameters", tags = { "fake" }, responses = { @@ -339,6 +347,7 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @Operation( + operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", tags = { "fake" }, responses = { @@ -366,6 +375,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", tags = { "fake" }, responses = { @@ -390,6 +400,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testJsonFormData", summary = "test json serialization of form data", tags = { "fake" }, responses = { @@ -419,7 +430,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testQueryParameterCollectionFormat", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -447,6 +458,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 362ff5ff5e3..29b8c0d8176 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -35,14 +38,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } @@ -215,8 +220,8 @@ public class FakeApiController implements FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 5f640ca78de..bbfe6492b97 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -23,7 +23,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { @@ -36,6 +38,7 @@ public interface FakeClassnameTestApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClassname", summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1f416d5ab25..aaed20e877f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -26,14 +27,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index d4cbbab6f7b..28441b7e851 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -25,7 +26,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "the pet API") public interface PetApi { @@ -38,6 +41,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -67,6 +71,7 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -96,6 +101,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -126,6 +132,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -156,6 +163,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -187,6 +195,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -218,6 +227,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -248,6 +258,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 47d4ffcdb9d..5b4cc8611ca 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -28,14 +30,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 26389c13ef5..46a9931877b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -24,7 +24,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "the store API") public interface StoreApi { @@ -38,6 +40,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -61,6 +64,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -90,6 +94,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -116,6 +121,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 91b88d0652f..5d9974b5691 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -27,14 +28,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 3cdc6eeed91..62d52cbcebf 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -25,7 +25,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "the user API") public interface UserApi { @@ -38,6 +40,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -60,6 +63,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -82,6 +86,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -106,6 +111,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -131,6 +137,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -158,6 +165,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -182,6 +190,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -207,6 +216,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index c77024353b9..27741595f57 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -28,14 +29,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 70f6bb0d1c4..1facfb48af6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -30,9 +33,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -41,7 +43,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index ceb28401cd5..9775210209a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 9455c14cd5f..d2440961a78 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -30,9 +33,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -41,7 +43,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 69e4ba3737e..f28ec12951f 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -78,9 +81,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ - @Schema(name = "mapString", defaultValue = "") - - + + @Schema(name = "map_string", required = false) public Map getMapString() { return mapString; } @@ -106,10 +108,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ - @Schema(name = "mapNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_number", required = false) public Map getMapNumber() { return mapNumber; } @@ -135,9 +135,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ - @Schema(name = "mapInteger", defaultValue = "") - - + + @Schema(name = "map_integer", required = false) public Map getMapInteger() { return mapInteger; } @@ -163,9 +162,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ - @Schema(name = "mapBoolean", defaultValue = "") - - + + @Schema(name = "map_boolean", required = false) public Map getMapBoolean() { return mapBoolean; } @@ -191,10 +189,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ - @Schema(name = "mapArrayInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_integer", required = false) public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -220,10 +216,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ - @Schema(name = "mapArrayAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_anytype", required = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -249,10 +243,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ - @Schema(name = "mapMapString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_string", required = false) public Map> getMapMapString() { return mapMapString; } @@ -278,10 +270,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ - @Schema(name = "mapMapAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_anytype", required = false) public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -299,9 +289,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ - @Schema(name = "anytype1", defaultValue = "") - - + + @Schema(name = "anytype_1", required = false) public Object getAnytype1() { return anytype1; } @@ -319,9 +308,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ - @Schema(name = "anytype2", defaultValue = "") - - + + @Schema(name = "anytype_2", required = false) public Object getAnytype2() { return anytype2; } @@ -339,9 +327,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ - @Schema(name = "anytype3", defaultValue = "") - - + + @Schema(name = "anytype_3", required = false) public Object getAnytype3() { return anytype3; } @@ -350,7 +337,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -382,7 +368,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index fb06ae322e2..2125dd10695 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -30,9 +33,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -41,7 +43,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 71868e47335..788612115c6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 75db554b329..f469e4b37d9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -30,9 +33,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -41,7 +43,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index aa62e4fbb2e..00091c392df 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -30,9 +33,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -41,7 +43,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 26eeb264a74..e762aace509 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -12,19 +12,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -40,10 +42,8 @@ public class Animal { * Get className * @return className */ - @Schema(name = "className", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "className", required = true) public String getClassName() { return className; } @@ -61,9 +61,8 @@ public class Animal { * Get color * @return color */ - @Schema(name = "color", defaultValue = "") - - + + @Schema(name = "color", required = false) public String getColor() { return color; } @@ -72,7 +71,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -95,7 +93,6 @@ public class Animal { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 436750d2ef6..0facaee5e60 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -40,10 +43,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ - @Schema(name = "arrayArrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayArrayNumber", required = false) public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -52,7 +53,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -74,7 +74,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index da9c15f73dd..1be9988fc5b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -40,10 +43,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ - @Schema(name = "arrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayNumber", required = false) public List getArrayNumber() { return arrayNumber; } @@ -52,7 +53,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -74,7 +74,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 6e995d00cb8..52090b658b8 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -48,9 +51,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ - @Schema(name = "arrayOfString", defaultValue = "") - - + + @Schema(name = "array_of_string", required = false) public List getArrayOfString() { return arrayOfString; } @@ -76,10 +78,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @Schema(name = "arrayArrayOfInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_integer", required = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -105,10 +105,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @Schema(name = "arrayArrayOfModel", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_model", required = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -117,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -141,7 +138,6 @@ public class ArrayTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index 1ca8388a6ce..455f600b0ce 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index f39298398eb..56ea8267235 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -11,12 +11,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -68,9 +71,8 @@ public class BigCatAllOf { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -79,7 +81,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +102,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index ac4b9725888..bab70ab41af 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -43,9 +46,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ - @Schema(name = "smallCamel", defaultValue = "") - - + + @Schema(name = "smallCamel", required = false) public String getSmallCamel() { return smallCamel; } @@ -63,9 +65,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ - @Schema(name = "capitalCamel", defaultValue = "") - - + + @Schema(name = "CapitalCamel", required = false) public String getCapitalCamel() { return capitalCamel; } @@ -83,9 +84,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ - @Schema(name = "smallSnake", defaultValue = "") - - + + @Schema(name = "small_Snake", required = false) public String getSmallSnake() { return smallSnake; } @@ -103,9 +103,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ - @Schema(name = "capitalSnake", defaultValue = "") - - + + @Schema(name = "Capital_Snake", required = false) public String getCapitalSnake() { return capitalSnake; } @@ -123,9 +122,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @Schema(name = "scAETHFlowPoints", defaultValue = "") - - + + @Schema(name = "SCA_ETH_Flow_Points", required = false) public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -143,9 +141,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ - @Schema(name = "ATT_NAME", defaultValue = "Name of the pet ") - - + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) public String getATTNAME() { return ATT_NAME; } @@ -154,7 +151,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -181,7 +177,6 @@ public class Capitalization { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index e41f36a626b..d502537ab4e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 9bc555ab000..5354e8af132 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -28,9 +31,8 @@ public class CatAllOf { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -39,7 +41,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -61,7 +62,6 @@ public class CatAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 03a760ee3fd..57afab36b95 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -31,9 +34,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -51,10 +53,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public String getName() { return name; } @@ -63,7 +63,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -86,7 +85,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index 878a45986a8..b31b562dbba 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -10,13 +10,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@Schema(name = "ClassModel",description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -29,9 +32,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "_class", required = false) public String getPropertyClass() { return propertyClass; } @@ -40,7 +42,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class ClassModel { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index 74b85fd2823..31927074d37 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -28,9 +31,8 @@ public class Client { * Get client * @return client */ - @Schema(name = "client", defaultValue = "") - - + + @Schema(name = "client", required = false) public String getClient() { return client; } @@ -39,7 +41,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -61,7 +62,6 @@ public class Client { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index 1dbce140c90..992bc894a34 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class Dog extends Animal { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 0af97ffbaf4..a82bcdc4907 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -28,9 +31,8 @@ public class DogAllOf { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -39,7 +41,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -61,7 +62,6 @@ public class DogAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index ef006f92c68..dabe3611437 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -105,9 +108,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ - @Schema(name = "justSymbol", defaultValue = "") - - + + @Schema(name = "just_symbol", required = false) public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -133,9 +135,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ - @Schema(name = "arrayEnum", defaultValue = "") - - + + @Schema(name = "array_enum", required = false) public List getArrayEnum() { return arrayEnum; } @@ -144,7 +145,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -167,7 +167,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index f5edf59363a..d26620f561a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index f67ec5d041a..a9cc411bc89 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -186,9 +189,8 @@ public class EnumTest { * Get enumString * @return enumString */ - @Schema(name = "enumString", defaultValue = "") - - + + @Schema(name = "enum_string", required = false) public EnumStringEnum getEnumString() { return enumString; } @@ -206,10 +208,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ - @Schema(name = "enumStringRequired", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "enum_string_required", required = true) public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -227,9 +227,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ - @Schema(name = "enumInteger", defaultValue = "") - - + + @Schema(name = "enum_integer", required = false) public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -247,9 +246,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ - @Schema(name = "enumNumber", defaultValue = "") - - + + @Schema(name = "enum_number", required = false) public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -267,10 +265,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ - @Schema(name = "outerEnum", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "outerEnum", required = false) public OuterEnum getOuterEnum() { return outerEnum; } @@ -279,7 +275,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -305,7 +300,6 @@ public class EnumTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index 3eb39014b63..87884c44e79 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -10,13 +10,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -29,9 +32,8 @@ public class File { * Test capitalization * @return sourceURI */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) public String getSourceURI() { return sourceURI; } @@ -40,7 +42,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 0ab7ce083e3..8d27d598bb2 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -35,10 +38,8 @@ public class FileSchemaTestClass { * Get file * @return file */ - @Schema(name = "file", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "file", required = false) public File getFile() { return file; } @@ -64,10 +65,8 @@ public class FileSchemaTestClass { * Get files * @return files */ - @Schema(name = "files", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "files", required = false) public List getFiles() { return files; } @@ -76,7 +75,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -99,7 +97,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index e0203457d83..a82f33264d6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -7,6 +7,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +17,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -46,14 +51,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -76,9 +81,8 @@ public class FormatTest { * maximum: 100 * @return integer */ - @Schema(name = "integer", defaultValue = "") - -@Min(10) @Max(100) + @Min(10) @Max(100) + @Schema(name = "integer", required = false) public Integer getInteger() { return integer; } @@ -98,9 +102,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ - @Schema(name = "int32", defaultValue = "") - -@Min(20) @Max(200) + @Min(20) @Max(200) + @Schema(name = "int32", required = false) public Integer getInt32() { return int32; } @@ -118,9 +121,8 @@ public class FormatTest { * Get int64 * @return int64 */ - @Schema(name = "int64", defaultValue = "") - - + + @Schema(name = "int64", required = false) public Long getInt64() { return int64; } @@ -140,11 +142,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ - @Schema(name = "number", required = true, defaultValue = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) public BigDecimal getNumber() { return number; } @@ -164,9 +163,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ - @Schema(name = "_float", defaultValue = "") - -@DecimalMin("54.3") @DecimalMax("987.6") + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) public Float getFloat() { return _float; } @@ -186,9 +184,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ - @Schema(name = "_double", defaultValue = "") - -@DecimalMin("67.8") @DecimalMax("123.4") + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) public Double getDouble() { return _double; } @@ -206,9 +203,8 @@ public class FormatTest { * Get string * @return string */ - @Schema(name = "string", defaultValue = "") - -@Pattern(regexp = "/[a-z]/i") + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) public String getString() { return string; } @@ -226,10 +222,8 @@ public class FormatTest { * Get _byte * @return _byte */ - @Schema(name = "_byte", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "byte", required = true) public byte[] getByte() { return _byte; } @@ -238,7 +232,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -247,15 +241,13 @@ public class FormatTest { * Get binary * @return binary */ - @Schema(name = "binary", defaultValue = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + @Valid + @Schema(name = "binary", required = false) + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -268,11 +260,8 @@ public class FormatTest { * Get date * @return date */ - @Schema(name = "date", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "date", required = true) public LocalDate getDate() { return date; } @@ -290,10 +279,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -311,10 +298,8 @@ public class FormatTest { * Get uuid * @return uuid */ - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) public UUID getUuid() { return uuid; } @@ -332,10 +317,8 @@ public class FormatTest { * Get password * @return password */ - @Schema(name = "password", required = true, defaultValue = "") - @NotNull - -@Size(min = 10, max = 64) + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) public String getPassword() { return password; } @@ -353,10 +336,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ - @Schema(name = "bigDecimal", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "BigDecimal", required = false) public BigDecimal getBigDecimal() { return bigDecimal; } @@ -365,7 +346,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -400,7 +380,6 @@ public class FormatTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index d2f0afa1d4a..adc53a60f2c 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -31,9 +34,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -51,9 +53,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ - @Schema(name = "foo", readOnly = true, defaultValue = "") - - + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getFoo() { return foo; } @@ -62,7 +63,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -85,7 +85,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index ed29ea575ee..81ec542f86b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -88,10 +91,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ - @Schema(name = "mapMapOfString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_of_string", required = false) public Map> getMapMapOfString() { return mapMapOfString; } @@ -117,9 +118,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ - @Schema(name = "mapOfEnumString", defaultValue = "") - - + + @Schema(name = "map_of_enum_string", required = false) public Map getMapOfEnumString() { return mapOfEnumString; } @@ -145,9 +145,8 @@ public class MapTest { * Get directMap * @return directMap */ - @Schema(name = "directMap", defaultValue = "") - - + + @Schema(name = "direct_map", required = false) public Map getDirectMap() { return directMap; } @@ -173,9 +172,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ - @Schema(name = "indirectMap", defaultValue = "") - - + + @Schema(name = "indirect_map", required = false) public Map getIndirectMap() { return indirectMap; } @@ -184,7 +182,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -209,7 +206,6 @@ public class MapTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index e846cf63782..704d5daf961 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -16,17 +17,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -42,10 +46,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ - @Schema(name = "uuid", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", required = false) public UUID getUuid() { return uuid; } @@ -63,10 +65,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -92,10 +92,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ - @Schema(name = "map", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map", required = false) public Map getMap() { return map; } @@ -104,7 +102,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -128,7 +125,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 8aa5b96e1da..21c119570b9 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -10,13 +10,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@Schema(name = "200_response",description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -32,9 +35,8 @@ public class Model200Response { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public Integer getName() { return name; } @@ -52,9 +54,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "class", required = false) public String getPropertyClass() { return propertyClass; } @@ -63,7 +64,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -86,7 +86,6 @@ public class Model200Response { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 86af4aba24a..b2190788b39 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -34,9 +37,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -54,9 +56,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -74,9 +75,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -85,7 +85,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -109,7 +108,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 4c81c32e795..65083e0155b 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -28,9 +31,8 @@ public class ModelList { * Get _123list * @return _123list */ - @Schema(name = "_123list", defaultValue = "") - - + + @Schema(name = "123-list", required = false) public String get123list() { return _123list; } @@ -39,7 +41,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -61,7 +62,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 06bc8e6627c..2c77d8a517a 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -10,13 +10,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@Schema(name = "Return",description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Return", description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -29,9 +32,8 @@ public class ModelReturn { * Get _return * @return _return */ - @Schema(name = "_return", defaultValue = "") - - + + @Schema(name = "return", required = false) public Integer getReturn() { return _return; } @@ -40,7 +42,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class ModelReturn { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index 5e755ef8dd1..2dd3efc08b4 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -10,13 +10,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@Schema(name = "Name",description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -38,10 +41,8 @@ public class Name { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public Integer getName() { return name; } @@ -59,9 +60,8 @@ public class Name { * Get snakeCase * @return snakeCase */ - @Schema(name = "snakeCase", readOnly = true, defaultValue = "") - - + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer getSnakeCase() { return snakeCase; } @@ -79,9 +79,8 @@ public class Name { * Get property * @return property */ - @Schema(name = "property", defaultValue = "") - - + + @Schema(name = "property", required = false) public String getProperty() { return property; } @@ -99,9 +98,8 @@ public class Name { * Get _123number * @return _123number */ - @Schema(name = "_123number", readOnly = true, defaultValue = "") - - + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer get123number() { return _123number; } @@ -110,7 +108,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -135,7 +132,6 @@ public class Name { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 88b9009b1dc..e4f864b35b2 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -11,12 +11,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -29,10 +32,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ - @Schema(name = "justNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "JustNumber", required = false) public BigDecimal getJustNumber() { return justNumber; } @@ -41,7 +42,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +63,6 @@ public class NumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index 5c9bb7ae7e4..a69c5a43f4e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -5,6 +5,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -28,7 +32,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -83,9 +87,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -103,9 +106,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -123,9 +125,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -143,10 +144,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -164,9 +163,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -184,9 +182,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -195,7 +192,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -222,7 +218,6 @@ public class Order { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index cea0bf2f757..2a94c21a95d 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -11,12 +11,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -35,10 +38,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ - @Schema(name = "myNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "my_number", required = false) public BigDecimal getMyNumber() { return myNumber; } @@ -56,9 +57,8 @@ public class OuterComposite { * Get myString * @return myString */ - @Schema(name = "myString", defaultValue = "") - - + + @Schema(name = "my_string", required = false) public String getMyString() { return myString; } @@ -76,9 +76,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ - @Schema(name = "myBoolean", defaultValue = "") - - + + @Schema(name = "my_boolean", required = false) public Boolean getMyBoolean() { return myBoolean; } @@ -87,7 +86,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +109,6 @@ public class OuterComposite { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 72e7826828f..6e050d8e150 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 9ca656bd917..5192f3943c0 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -18,12 +18,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 15b221c739b..cf421153515 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -31,9 +34,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -51,9 +53,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ - @Schema(name = "baz", defaultValue = "") - - + + @Schema(name = "baz", required = false) public String getBaz() { return baz; } @@ -62,7 +63,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -85,7 +85,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 56ced4dc6f0..e52a3838938 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -28,9 +31,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @Schema(name = "$specialPropertyName", defaultValue = "") - - + + @Schema(name = "$special[property.name]", required = false) public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -39,7 +41,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -61,7 +62,6 @@ public class SpecialModelName { 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(); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index f98b6a0b281..873bb3fc435 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -31,9 +34,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -51,9 +53,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -62,7 +63,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -85,7 +85,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index d346c36b80a..625823af85e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -44,10 +47,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", required = true) public String getStringItem() { return stringItem; } @@ -65,11 +66,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -87,10 +85,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", required = true) public Integer getIntegerItem() { return integerItem; } @@ -108,10 +104,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", required = true) public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", required = true) public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index c62a0e4dc71..90533252ffd 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -47,10 +50,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", example = "what", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", example = "what", required = true) public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ - @Schema(name = "floatItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) public Float getFloatItem() { return floatItem; } @@ -111,10 +107,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", example = "-2", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) public Integer getIntegerItem() { return integerItem; } @@ -132,10 +126,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", example = "true", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", example = "true", required = true) public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", example = "[0, 1, 2, 3]", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index 155bdf978d5..60b86f5edc6 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -10,12 +10,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -49,9 +52,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -69,9 +71,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -89,9 +90,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -109,9 +109,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -129,9 +128,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -149,9 +147,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -169,9 +166,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -189,9 +185,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -200,7 +195,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -229,7 +223,6 @@ public class User { 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"); diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 9f829a1a26f..ac1c8c10e5d 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -124,9 +127,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ - @Schema(name = "attributeString", example = "string", defaultValue = "") - - + + @Schema(name = "attribute_string", example = "string", required = false) public String getAttributeString() { return attributeString; } @@ -144,10 +146,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ - @Schema(name = "attributeNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -165,9 +165,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ - @Schema(name = "attributeInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "attribute_integer", example = "-2", required = false) public Integer getAttributeInteger() { return attributeInteger; } @@ -185,9 +184,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ - @Schema(name = "attributeBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "attribute_boolean", example = "true", required = false) public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -213,9 +211,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ - @Schema(name = "wrappedArray", defaultValue = "") - - + + @Schema(name = "wrapped_array", required = false) public List getWrappedArray() { return wrappedArray; } @@ -233,9 +230,8 @@ public class XmlItem { * Get nameString * @return nameString */ - @Schema(name = "nameString", example = "string", defaultValue = "") - - + + @Schema(name = "name_string", example = "string", required = false) public String getNameString() { return nameString; } @@ -253,10 +249,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ - @Schema(name = "nameNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "name_number", example = "1.234", required = false) public BigDecimal getNameNumber() { return nameNumber; } @@ -274,9 +268,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ - @Schema(name = "nameInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "name_integer", example = "-2", required = false) public Integer getNameInteger() { return nameInteger; } @@ -294,9 +287,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ - @Schema(name = "nameBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "name_boolean", example = "true", required = false) public Boolean getNameBoolean() { return nameBoolean; } @@ -322,9 +314,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ - @Schema(name = "nameArray", defaultValue = "") - - + + @Schema(name = "name_array", required = false) public List getNameArray() { return nameArray; } @@ -350,9 +341,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ - @Schema(name = "nameWrappedArray", defaultValue = "") - - + + @Schema(name = "name_wrapped_array", required = false) public List getNameWrappedArray() { return nameWrappedArray; } @@ -370,9 +360,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ - @Schema(name = "prefixString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_string", example = "string", required = false) public String getPrefixString() { return prefixString; } @@ -390,10 +379,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ - @Schema(name = "prefixNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -411,9 +398,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ - @Schema(name = "prefixInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_integer", example = "-2", required = false) public Integer getPrefixInteger() { return prefixInteger; } @@ -431,9 +417,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ - @Schema(name = "prefixBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_boolean", example = "true", required = false) public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -459,9 +444,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ - @Schema(name = "prefixArray", defaultValue = "") - - + + @Schema(name = "prefix_array", required = false) public List getPrefixArray() { return prefixArray; } @@ -487,9 +471,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ - @Schema(name = "prefixWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_wrapped_array", required = false) public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -507,9 +490,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ - @Schema(name = "namespaceString", example = "string", defaultValue = "") - - + + @Schema(name = "namespace_string", example = "string", required = false) public String getNamespaceString() { return namespaceString; } @@ -527,10 +509,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ - @Schema(name = "namespaceNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -548,9 +528,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ - @Schema(name = "namespaceInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "namespace_integer", example = "-2", required = false) public Integer getNamespaceInteger() { return namespaceInteger; } @@ -568,9 +547,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ - @Schema(name = "namespaceBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "namespace_boolean", example = "true", required = false) public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -596,9 +574,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ - @Schema(name = "namespaceArray", defaultValue = "") - - + + @Schema(name = "namespace_array", required = false) public List getNamespaceArray() { return namespaceArray; } @@ -624,9 +601,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @Schema(name = "namespaceWrappedArray", defaultValue = "") - - + + @Schema(name = "namespace_wrapped_array", required = false) public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -644,9 +620,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ - @Schema(name = "prefixNsString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_ns_string", example = "string", required = false) public String getPrefixNsString() { return prefixNsString; } @@ -664,10 +639,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ - @Schema(name = "prefixNsNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -685,9 +658,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ - @Schema(name = "prefixNsInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -705,9 +677,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ - @Schema(name = "prefixNsBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -733,9 +704,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ - @Schema(name = "prefixNsArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_array", required = false) public List getPrefixNsArray() { return prefixNsArray; } @@ -761,9 +731,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @Schema(name = "prefixNsWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_wrapped_array", required = false) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -772,7 +741,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -822,7 +790,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index b36ef3022ad..65e395479d4 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -23,7 +23,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { @@ -40,6 +42,7 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "call123testSpecialTags", summary = "To test special tags", tags = { "$another-fake?" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index df11134c806..f57c395c28a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index a86542ddf22..2d5e24bcd5f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index a1667f68fd9..8f17228b6a2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -32,7 +34,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") public interface FakeApi { @@ -49,6 +53,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createXmlItem", summary = "creates an XmlItem", tags = { "fake" }, responses = { @@ -75,7 +80,7 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) @@ -101,7 +106,7 @@ public interface FakeApi { * @return Output composite (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) @@ -127,7 +132,7 @@ public interface FakeApi { * @return Output number (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) @@ -153,7 +158,7 @@ public interface FakeApi { * @return Output string (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) @@ -179,7 +184,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithFileSchema", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -205,7 +210,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithQueryParams", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -232,6 +237,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClientModel", summary = "To test \"client\" model", tags = { "fake" }, responses = { @@ -273,6 +279,7 @@ public interface FakeApi { * or User not found (status code 404) */ @Operation( + operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags = { "fake" }, responses = { @@ -299,8 +306,8 @@ public interface FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { @@ -324,6 +331,7 @@ public interface FakeApi { * or Not found (status code 404) */ @Operation( + operationId = "testEnumParameters", summary = "To test enum parameters", tags = { "fake" }, responses = { @@ -363,6 +371,7 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @Operation( + operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", tags = { "fake" }, responses = { @@ -392,6 +401,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", tags = { "fake" }, responses = { @@ -418,6 +428,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testJsonFormData", summary = "test json serialization of form data", tags = { "fake" }, responses = { @@ -449,7 +460,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testQueryParameterCollectionFormat", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -479,6 +490,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 6b22c1aba66..501419787ef 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index d3a949e65d8..3796fc00ce5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -19,12 +21,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 52e3ba4f096..e13856e59a2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -23,7 +23,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { @@ -40,6 +42,7 @@ public interface FakeClassnameTestApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClassname", summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 58497641e4c..0e301ab5f9b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index ed5a6bfc09a..fb689b13f94 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 7ddf343bfc3..ccc4a0d3015 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -25,7 +26,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "the pet API") public interface PetApi { @@ -42,6 +45,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -73,6 +77,7 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -104,6 +109,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -136,6 +142,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -168,6 +175,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -201,6 +209,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -234,6 +243,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -266,6 +276,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 5fa088c6f10..03b76f0b64b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index e3adc7d4bca..9c616c14aaa 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -12,12 +13,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index de9cf4c59e2..2c5d3616960 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -24,7 +24,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "the store API") public interface StoreApi { @@ -42,6 +44,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -67,6 +70,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -98,6 +102,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -126,6 +131,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 9e08c646ae9..8209043ac02 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index dfe4bb31496..e9b7146b52a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -11,12 +11,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index e7dd25c6b5d..c348d32b8c1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -25,7 +25,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "the user API") public interface UserApi { @@ -42,6 +44,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -66,6 +69,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -90,6 +94,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -116,6 +121,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -143,6 +149,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -172,6 +179,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -198,6 +206,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -225,6 +234,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index bc2d33598fd..82725d16025 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index 2efbd71c9dc..c39231c6b29 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -12,12 +12,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0c57ae7dd14..88ea058c0c5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5285ec2f29..0d4d67f1a9e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index f8ca38c286d..219d797ee64 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dfd28ccb996..b2245551ad3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ - @Schema(name = "mapString", defaultValue = "") - - + + @Schema(name = "map_string", required = false) public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ - @Schema(name = "mapNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_number", required = false) public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ - @Schema(name = "mapInteger", defaultValue = "") - - + + @Schema(name = "map_integer", required = false) public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ - @Schema(name = "mapBoolean", defaultValue = "") - - + + @Schema(name = "map_boolean", required = false) public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ - @Schema(name = "mapArrayInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_integer", required = false) public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ - @Schema(name = "mapArrayAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_anytype", required = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ - @Schema(name = "mapMapString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_string", required = false) public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ - @Schema(name = "mapMapAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_anytype", required = false) public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ - @Schema(name = "anytype1", defaultValue = "") - - + + @Schema(name = "anytype_1", required = false) public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ - @Schema(name = "anytype2", defaultValue = "") - - + + @Schema(name = "anytype_2", required = false) public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ - @Schema(name = "anytype3", defaultValue = "") - - + + @Schema(name = "anytype_3", required = false) public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5fea577ab44..ea102c40ed2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index e6eee612a24..7a3a5d839f8 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index d7116bd7572..22e47f1bc1c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index d2022be266f..91f47a9e83e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 6f096d5069e..ef0fc61b5b6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -14,19 +14,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ - @Schema(name = "className", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "className", required = true) public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ - @Schema(name = "color", defaultValue = "") - - + + @Schema(name = "color", required = false) public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ebe36ad761a..ad560c9d834 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ - @Schema(name = "arrayArrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayArrayNumber", required = false) public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 8158dd44ab8..4409856d5a3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ - @Schema(name = "arrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayNumber", required = false) public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 420010561bc..fd25397b6b6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ - @Schema(name = "arrayOfString", defaultValue = "") - - + + @Schema(name = "array_of_string", required = false) public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @Schema(name = "arrayArrayOfInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_integer", required = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @Schema(name = "arrayArrayOfModel", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_model", required = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index 7f4a080ad8d..275a075f527 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -72,9 +75,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -83,7 +85,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index d0a47ab5127..3640a6301af 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCatAllOf { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -103,7 +104,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index 92d9a7245f1..80d6c5b2851 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ - @Schema(name = "smallCamel", defaultValue = "") - - + + @Schema(name = "smallCamel", required = false) public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ - @Schema(name = "capitalCamel", defaultValue = "") - - + + @Schema(name = "CapitalCamel", required = false) public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ - @Schema(name = "smallSnake", defaultValue = "") - - + + @Schema(name = "small_Snake", required = false) public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ - @Schema(name = "capitalSnake", defaultValue = "") - - + + @Schema(name = "Capital_Snake", required = false) public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @Schema(name = "scAETHFlowPoints", defaultValue = "") - - + + @Schema(name = "SCA_ETH_Flow_Points", required = false) public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ - @Schema(name = "ATT_NAME", defaultValue = "Name of the pet ") - - + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index 2e496fb4acc..0b3c8b8759b 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index b732a62b1bc..19ffd6fffea 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 038fc8df3af..66dd429525d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index fa2a736f4fb..13a83893e61 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@Schema(name = "ClassModel",description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "_class", required = false) public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index e11bd4ff1b1..9fbd7e3b433 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ - @Schema(name = "client", defaultValue = "") - - + + @Schema(name = "client", required = false) public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index ed5dc71a4ba..36f36600daf 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index 2c99bc376c3..cc0bafc92e3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index e1b2df0716a..c3e82d4c028 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ - @Schema(name = "justSymbol", defaultValue = "") - - + + @Schema(name = "just_symbol", required = false) public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ - @Schema(name = "arrayEnum", defaultValue = "") - - + + @Schema(name = "array_enum", required = false) public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java index e3d30c1ad45..4e6027d16c4 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 938af53e2b8..19ea0acc7a7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ - @Schema(name = "enumString", defaultValue = "") - - + + @Schema(name = "enum_string", required = false) public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ - @Schema(name = "enumStringRequired", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "enum_string_required", required = true) public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ - @Schema(name = "enumInteger", defaultValue = "") - - + + @Schema(name = "enum_integer", required = false) public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ - @Schema(name = "enumNumber", defaultValue = "") - - + + @Schema(name = "enum_number", required = false) public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ - @Schema(name = "outerEnum", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "outerEnum", required = false) public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index 001b30e1475..a2ee29fbfd6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index c16669d0c25..77868e77410 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ - @Schema(name = "file", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "file", required = false) public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ - @Schema(name = "files", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "files", required = false) public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 6546370cd32..0c14e2c93c1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -17,12 +19,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ - @Schema(name = "integer", defaultValue = "") - -@Min(10) @Max(100) + @Min(10) @Max(100) + @Schema(name = "integer", required = false) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ - @Schema(name = "int32", defaultValue = "") - -@Min(20) @Max(200) + @Min(20) @Max(200) + @Schema(name = "int32", required = false) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ - @Schema(name = "int64", defaultValue = "") - - + + @Schema(name = "int64", required = false) public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ - @Schema(name = "number", required = true, defaultValue = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ - @Schema(name = "_float", defaultValue = "") - -@DecimalMin("54.3") @DecimalMax("987.6") + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ - @Schema(name = "_double", defaultValue = "") - -@DecimalMin("67.8") @DecimalMax("123.4") + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ - @Schema(name = "string", defaultValue = "") - -@Pattern(regexp = "/[a-z]/i") + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ - @Schema(name = "_byte", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "byte", required = true) public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ - @Schema(name = "binary", defaultValue = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + @Valid + @Schema(name = "binary", required = false) + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ - @Schema(name = "date", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "date", required = true) public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ - @Schema(name = "password", required = true, defaultValue = "") - @NotNull - -@Size(min = 10, max = 64) + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ - @Schema(name = "bigDecimal", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "BigDecimal", required = false) public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index dfb615a529f..ec728db1f14 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ - @Schema(name = "foo", readOnly = true, defaultValue = "") - - + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 3ff73062758..2da2a81ac82 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ - @Schema(name = "mapMapOfString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_of_string", required = false) public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ - @Schema(name = "mapOfEnumString", defaultValue = "") - - + + @Schema(name = "map_of_enum_string", required = false) public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ - @Schema(name = "directMap", defaultValue = "") - - + + @Schema(name = "direct_map", required = false) public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ - @Schema(name = "indirectMap", defaultValue = "") - - + + @Schema(name = "indirect_map", required = false) public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 03a7be43cc4..9681c13f29d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,17 +19,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ - @Schema(name = "uuid", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", required = false) public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ - @Schema(name = "map", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map", required = false) public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 77bf91649b0..48528166d1c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@Schema(name = "200_response",description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "class", required = false) public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 2443600df22..4312ff4cc72 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index 03dba280141..11078e7094e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ - @Schema(name = "_123list", defaultValue = "") - - + + @Schema(name = "123-list", required = false) public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 0301a47e9f3..37c94a6aa80 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@Schema(name = "Return",description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Return", description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ - @Schema(name = "_return", defaultValue = "") - - + + @Schema(name = "return", required = false) public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 62a16f80ee0..2876e64e991 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@Schema(name = "Name",description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ - @Schema(name = "snakeCase", readOnly = true, defaultValue = "") - - + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ - @Schema(name = "property", defaultValue = "") - - + + @Schema(name = "property", required = false) public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ - @Schema(name = "_123number", readOnly = true, defaultValue = "") - - + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index 521fad80d5a..05c9f0a7785 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ - @Schema(name = "justNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "JustNumber", required = false) public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index 05071bdfe2b..90b0d295718 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index a721a3dde6a..14ff8ff8a9f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ - @Schema(name = "myNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "my_number", required = false) public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ - @Schema(name = "myString", defaultValue = "") - - + + @Schema(name = "my_string", required = false) public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ - @Schema(name = "myBoolean", defaultValue = "") - - + + @Schema(name = "my_boolean", required = false) public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java index ba0cca8a5e8..7fdf6f47de3 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 988eb317134..51d583a02e5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -20,12 +20,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -92,9 +95,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -112,10 +114,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -133,10 +133,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -159,10 +157,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public Set getPhotoUrls() { return photoUrls; } @@ -189,10 +185,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -210,9 +204,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -221,7 +214,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -248,7 +240,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1c51770a8e6..1d95448aeef 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ - @Schema(name = "baz", defaultValue = "") - - + + @Schema(name = "baz", required = false) public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index 75f4be4e9f8..3dcdd9ee3f5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @Schema(name = "$specialPropertyName", defaultValue = "") - - + + @Schema(name = "$special[property.name]", required = false) public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 8722df999bf..6b24df20471 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 19e9bf310f7..66695c3e847 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", required = true) public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", required = true) public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", required = true) public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", required = true) public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index c9a3762bc74..fdc9a096075 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", example = "what", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", example = "what", required = true) public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ - @Schema(name = "floatItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", example = "-2", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", example = "true", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", example = "true", required = true) public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", example = "[0, 1, 2, 3]", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index 83152a15553..9aae48b0ceb 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 59a183db0f6..b886d9d3f61 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ - @Schema(name = "attributeString", example = "string", defaultValue = "") - - + + @Schema(name = "attribute_string", example = "string", required = false) public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ - @Schema(name = "attributeNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ - @Schema(name = "attributeInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "attribute_integer", example = "-2", required = false) public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ - @Schema(name = "attributeBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "attribute_boolean", example = "true", required = false) public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ - @Schema(name = "wrappedArray", defaultValue = "") - - + + @Schema(name = "wrapped_array", required = false) public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ - @Schema(name = "nameString", example = "string", defaultValue = "") - - + + @Schema(name = "name_string", example = "string", required = false) public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ - @Schema(name = "nameNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "name_number", example = "1.234", required = false) public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ - @Schema(name = "nameInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "name_integer", example = "-2", required = false) public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ - @Schema(name = "nameBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "name_boolean", example = "true", required = false) public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ - @Schema(name = "nameArray", defaultValue = "") - - + + @Schema(name = "name_array", required = false) public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ - @Schema(name = "nameWrappedArray", defaultValue = "") - - + + @Schema(name = "name_wrapped_array", required = false) public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ - @Schema(name = "prefixString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_string", example = "string", required = false) public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ - @Schema(name = "prefixNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ - @Schema(name = "prefixInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_integer", example = "-2", required = false) public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ - @Schema(name = "prefixBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_boolean", example = "true", required = false) public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ - @Schema(name = "prefixArray", defaultValue = "") - - + + @Schema(name = "prefix_array", required = false) public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ - @Schema(name = "prefixWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_wrapped_array", required = false) public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ - @Schema(name = "namespaceString", example = "string", defaultValue = "") - - + + @Schema(name = "namespace_string", example = "string", required = false) public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ - @Schema(name = "namespaceNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ - @Schema(name = "namespaceInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "namespace_integer", example = "-2", required = false) public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ - @Schema(name = "namespaceBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "namespace_boolean", example = "true", required = false) public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ - @Schema(name = "namespaceArray", defaultValue = "") - - + + @Schema(name = "namespace_array", required = false) public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @Schema(name = "namespaceWrappedArray", defaultValue = "") - - + + @Schema(name = "namespace_wrapped_array", required = false) public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ - @Schema(name = "prefixNsString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_ns_string", example = "string", required = false) public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ - @Schema(name = "prefixNsNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ - @Schema(name = "prefixNsInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ - @Schema(name = "prefixNsBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ - @Schema(name = "prefixNsArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_array", required = false) public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @Schema(name = "prefixNsWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_wrapped_array", required = false) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 82a5df22e20..5b0b00add83 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,7 +27,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { @@ -44,6 +46,7 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "call123testSpecialTags", summary = "To test special tags", tags = { "$another-fake?" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 456caa3cf66..9bc3c924c70 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -36,7 +38,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") public interface FakeApi { @@ -53,6 +57,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createXmlItem", summary = "creates an XmlItem", tags = { "fake" }, responses = { @@ -82,7 +87,7 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) @@ -111,7 +116,7 @@ public interface FakeApi { * @return Output composite (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) @@ -149,7 +154,7 @@ public interface FakeApi { * @return Output number (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) @@ -178,7 +183,7 @@ public interface FakeApi { * @return Output string (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) @@ -207,7 +212,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithFileSchema", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -236,7 +241,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithQueryParams", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -266,6 +271,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClientModel", summary = "To test \"client\" model", tags = { "fake" }, responses = { @@ -319,6 +325,7 @@ public interface FakeApi { * or User not found (status code 404) */ @Operation( + operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags = { "fake" }, responses = { @@ -347,8 +354,8 @@ public interface FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { @@ -371,6 +378,7 @@ public interface FakeApi { * or Not found (status code 404) */ @Operation( + operationId = "testEnumParameters", summary = "To test enum parameters", tags = { "fake" }, responses = { @@ -411,6 +419,7 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @Operation( + operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", tags = { "fake" }, responses = { @@ -443,6 +452,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", tags = { "fake" }, responses = { @@ -472,6 +482,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testJsonFormData", summary = "test json serialization of form data", tags = { "fake" }, responses = { @@ -506,7 +517,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testQueryParameterCollectionFormat", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -539,6 +550,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8f1db4a3481..ada59fbd2be 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,7 +27,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { @@ -44,6 +46,7 @@ public interface FakeClassnameTestApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClassname", summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 67abf9f8cb5..b44b240e3c3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -29,7 +30,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "the pet API") public interface PetApi { @@ -46,6 +49,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -79,6 +83,7 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -113,6 +118,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -162,6 +168,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -211,6 +218,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -261,6 +269,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -297,6 +306,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -332,6 +342,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index ce360c31059..3f7578b7e96 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "the store API") public interface StoreApi { @@ -46,6 +48,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -74,6 +77,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -108,6 +112,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -153,6 +158,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 3f0113d6d1a..6312c5190a1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "the user API") public interface UserApi { @@ -46,6 +48,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -73,6 +76,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -100,6 +104,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -129,6 +134,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -159,6 +165,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -205,6 +212,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -234,6 +242,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -264,6 +273,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0c57ae7dd14..88ea058c0c5 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5285ec2f29..0d4d67f1a9e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index f8ca38c286d..219d797ee64 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dfd28ccb996..b2245551ad3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ - @Schema(name = "mapString", defaultValue = "") - - + + @Schema(name = "map_string", required = false) public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ - @Schema(name = "mapNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_number", required = false) public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ - @Schema(name = "mapInteger", defaultValue = "") - - + + @Schema(name = "map_integer", required = false) public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ - @Schema(name = "mapBoolean", defaultValue = "") - - + + @Schema(name = "map_boolean", required = false) public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ - @Schema(name = "mapArrayInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_integer", required = false) public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ - @Schema(name = "mapArrayAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_anytype", required = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ - @Schema(name = "mapMapString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_string", required = false) public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ - @Schema(name = "mapMapAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_anytype", required = false) public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ - @Schema(name = "anytype1", defaultValue = "") - - + + @Schema(name = "anytype_1", required = false) public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ - @Schema(name = "anytype2", defaultValue = "") - - + + @Schema(name = "anytype_2", required = false) public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ - @Schema(name = "anytype3", defaultValue = "") - - + + @Schema(name = "anytype_3", required = false) public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5fea577ab44..ea102c40ed2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index e6eee612a24..7a3a5d839f8 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index d7116bd7572..22e47f1bc1c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index d2022be266f..91f47a9e83e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 6f096d5069e..ef0fc61b5b6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -14,19 +14,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ - @Schema(name = "className", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "className", required = true) public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ - @Schema(name = "color", defaultValue = "") - - + + @Schema(name = "color", required = false) public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ebe36ad761a..ad560c9d834 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ - @Schema(name = "arrayArrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayArrayNumber", required = false) public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 8158dd44ab8..4409856d5a3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ - @Schema(name = "arrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayNumber", required = false) public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 420010561bc..fd25397b6b6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ - @Schema(name = "arrayOfString", defaultValue = "") - - + + @Schema(name = "array_of_string", required = false) public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @Schema(name = "arrayArrayOfInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_integer", required = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @Schema(name = "arrayArrayOfModel", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_model", required = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index 7f4a080ad8d..275a075f527 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -72,9 +75,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -83,7 +85,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index d0a47ab5127..3640a6301af 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCatAllOf { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -103,7 +104,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index 92d9a7245f1..80d6c5b2851 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ - @Schema(name = "smallCamel", defaultValue = "") - - + + @Schema(name = "smallCamel", required = false) public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ - @Schema(name = "capitalCamel", defaultValue = "") - - + + @Schema(name = "CapitalCamel", required = false) public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ - @Schema(name = "smallSnake", defaultValue = "") - - + + @Schema(name = "small_Snake", required = false) public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ - @Schema(name = "capitalSnake", defaultValue = "") - - + + @Schema(name = "Capital_Snake", required = false) public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @Schema(name = "scAETHFlowPoints", defaultValue = "") - - + + @Schema(name = "SCA_ETH_Flow_Points", required = false) public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ - @Schema(name = "ATT_NAME", defaultValue = "Name of the pet ") - - + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index 2e496fb4acc..0b3c8b8759b 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index b732a62b1bc..19ffd6fffea 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 038fc8df3af..66dd429525d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index fa2a736f4fb..13a83893e61 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@Schema(name = "ClassModel",description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "_class", required = false) public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index e11bd4ff1b1..9fbd7e3b433 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ - @Schema(name = "client", defaultValue = "") - - + + @Schema(name = "client", required = false) public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index ed5dc71a4ba..36f36600daf 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index 2c99bc376c3..cc0bafc92e3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index e1b2df0716a..c3e82d4c028 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ - @Schema(name = "justSymbol", defaultValue = "") - - + + @Schema(name = "just_symbol", required = false) public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ - @Schema(name = "arrayEnum", defaultValue = "") - - + + @Schema(name = "array_enum", required = false) public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java index e3d30c1ad45..4e6027d16c4 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 938af53e2b8..19ea0acc7a7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ - @Schema(name = "enumString", defaultValue = "") - - + + @Schema(name = "enum_string", required = false) public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ - @Schema(name = "enumStringRequired", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "enum_string_required", required = true) public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ - @Schema(name = "enumInteger", defaultValue = "") - - + + @Schema(name = "enum_integer", required = false) public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ - @Schema(name = "enumNumber", defaultValue = "") - - + + @Schema(name = "enum_number", required = false) public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ - @Schema(name = "outerEnum", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "outerEnum", required = false) public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index 001b30e1475..a2ee29fbfd6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index c16669d0c25..77868e77410 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ - @Schema(name = "file", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "file", required = false) public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ - @Schema(name = "files", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "files", required = false) public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 6546370cd32..0c14e2c93c1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -17,12 +19,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ - @Schema(name = "integer", defaultValue = "") - -@Min(10) @Max(100) + @Min(10) @Max(100) + @Schema(name = "integer", required = false) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ - @Schema(name = "int32", defaultValue = "") - -@Min(20) @Max(200) + @Min(20) @Max(200) + @Schema(name = "int32", required = false) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ - @Schema(name = "int64", defaultValue = "") - - + + @Schema(name = "int64", required = false) public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ - @Schema(name = "number", required = true, defaultValue = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ - @Schema(name = "_float", defaultValue = "") - -@DecimalMin("54.3") @DecimalMax("987.6") + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ - @Schema(name = "_double", defaultValue = "") - -@DecimalMin("67.8") @DecimalMax("123.4") + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ - @Schema(name = "string", defaultValue = "") - -@Pattern(regexp = "/[a-z]/i") + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ - @Schema(name = "_byte", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "byte", required = true) public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ - @Schema(name = "binary", defaultValue = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + @Valid + @Schema(name = "binary", required = false) + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ - @Schema(name = "date", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "date", required = true) public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ - @Schema(name = "password", required = true, defaultValue = "") - @NotNull - -@Size(min = 10, max = 64) + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ - @Schema(name = "bigDecimal", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "BigDecimal", required = false) public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index dfb615a529f..ec728db1f14 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ - @Schema(name = "foo", readOnly = true, defaultValue = "") - - + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 3ff73062758..2da2a81ac82 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ - @Schema(name = "mapMapOfString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_of_string", required = false) public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ - @Schema(name = "mapOfEnumString", defaultValue = "") - - + + @Schema(name = "map_of_enum_string", required = false) public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ - @Schema(name = "directMap", defaultValue = "") - - + + @Schema(name = "direct_map", required = false) public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ - @Schema(name = "indirectMap", defaultValue = "") - - + + @Schema(name = "indirect_map", required = false) public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 03a7be43cc4..9681c13f29d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,17 +19,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ - @Schema(name = "uuid", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", required = false) public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ - @Schema(name = "map", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map", required = false) public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 77bf91649b0..48528166d1c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@Schema(name = "200_response",description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "class", required = false) public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 2443600df22..4312ff4cc72 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index 03dba280141..11078e7094e 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ - @Schema(name = "_123list", defaultValue = "") - - + + @Schema(name = "123-list", required = false) public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index 0301a47e9f3..37c94a6aa80 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@Schema(name = "Return",description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Return", description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ - @Schema(name = "_return", defaultValue = "") - - + + @Schema(name = "return", required = false) public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 62a16f80ee0..2876e64e991 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@Schema(name = "Name",description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ - @Schema(name = "snakeCase", readOnly = true, defaultValue = "") - - + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ - @Schema(name = "property", defaultValue = "") - - + + @Schema(name = "property", required = false) public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ - @Schema(name = "_123number", readOnly = true, defaultValue = "") - - + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index 521fad80d5a..05c9f0a7785 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ - @Schema(name = "justNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "JustNumber", required = false) public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index 05071bdfe2b..90b0d295718 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index a721a3dde6a..14ff8ff8a9f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ - @Schema(name = "myNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "my_number", required = false) public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ - @Schema(name = "myString", defaultValue = "") - - + + @Schema(name = "my_string", required = false) public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ - @Schema(name = "myBoolean", defaultValue = "") - - + + @Schema(name = "my_boolean", required = false) public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java index ba0cca8a5e8..7fdf6f47de3 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 988eb317134..51d583a02e5 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -20,12 +20,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -92,9 +95,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -112,10 +114,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -133,10 +133,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -159,10 +157,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public Set getPhotoUrls() { return photoUrls; } @@ -189,10 +185,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -210,9 +204,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -221,7 +214,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -248,7 +240,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1c51770a8e6..1d95448aeef 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ - @Schema(name = "baz", defaultValue = "") - - + + @Schema(name = "baz", required = false) public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index 75f4be4e9f8..3dcdd9ee3f5 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @Schema(name = "$specialPropertyName", defaultValue = "") - - + + @Schema(name = "$special[property.name]", required = false) public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 8722df999bf..6b24df20471 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 19e9bf310f7..66695c3e847 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", required = true) public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", required = true) public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", required = true) public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", required = true) public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index c9a3762bc74..fdc9a096075 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", example = "what", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", example = "what", required = true) public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ - @Schema(name = "floatItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", example = "-2", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", example = "true", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", example = "true", required = true) public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", example = "[0, 1, 2, 3]", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index 83152a15553..9aae48b0ceb 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 59a183db0f6..b886d9d3f61 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ - @Schema(name = "attributeString", example = "string", defaultValue = "") - - + + @Schema(name = "attribute_string", example = "string", required = false) public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ - @Schema(name = "attributeNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ - @Schema(name = "attributeInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "attribute_integer", example = "-2", required = false) public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ - @Schema(name = "attributeBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "attribute_boolean", example = "true", required = false) public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ - @Schema(name = "wrappedArray", defaultValue = "") - - + + @Schema(name = "wrapped_array", required = false) public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ - @Schema(name = "nameString", example = "string", defaultValue = "") - - + + @Schema(name = "name_string", example = "string", required = false) public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ - @Schema(name = "nameNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "name_number", example = "1.234", required = false) public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ - @Schema(name = "nameInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "name_integer", example = "-2", required = false) public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ - @Schema(name = "nameBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "name_boolean", example = "true", required = false) public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ - @Schema(name = "nameArray", defaultValue = "") - - + + @Schema(name = "name_array", required = false) public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ - @Schema(name = "nameWrappedArray", defaultValue = "") - - + + @Schema(name = "name_wrapped_array", required = false) public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ - @Schema(name = "prefixString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_string", example = "string", required = false) public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ - @Schema(name = "prefixNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ - @Schema(name = "prefixInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_integer", example = "-2", required = false) public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ - @Schema(name = "prefixBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_boolean", example = "true", required = false) public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ - @Schema(name = "prefixArray", defaultValue = "") - - + + @Schema(name = "prefix_array", required = false) public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ - @Schema(name = "prefixWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_wrapped_array", required = false) public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ - @Schema(name = "namespaceString", example = "string", defaultValue = "") - - + + @Schema(name = "namespace_string", example = "string", required = false) public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ - @Schema(name = "namespaceNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ - @Schema(name = "namespaceInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "namespace_integer", example = "-2", required = false) public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ - @Schema(name = "namespaceBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "namespace_boolean", example = "true", required = false) public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ - @Schema(name = "namespaceArray", defaultValue = "") - - + + @Schema(name = "namespace_array", required = false) public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @Schema(name = "namespaceWrappedArray", defaultValue = "") - - + + @Schema(name = "namespace_wrapped_array", required = false) public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ - @Schema(name = "prefixNsString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_ns_string", example = "string", required = false) public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ - @Schema(name = "prefixNsNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ - @Schema(name = "prefixNsInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ - @Schema(name = "prefixNsBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ - @Schema(name = "prefixNsArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_array", required = false) public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @Schema(name = "prefixNsWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_wrapped_array", required = false) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index c7e2bb2b25a..847cc88474b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { @@ -44,6 +46,7 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "call123testSpecialTags", summary = "To test special tags", tags = { "$another-fake?" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index df11134c806..f57c395c28a 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2ef11c811c1..575a4e23910 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -14,12 +14,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 729f78eb824..e0ac539a024 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -36,7 +38,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") public interface FakeApi { @@ -53,6 +57,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createXmlItem", summary = "creates an XmlItem", tags = { "fake" }, responses = { @@ -80,7 +85,7 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) @@ -107,7 +112,7 @@ public interface FakeApi { * @return Output composite (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) @@ -134,7 +139,7 @@ public interface FakeApi { * @return Output number (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) @@ -161,7 +166,7 @@ public interface FakeApi { * @return Output string (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) @@ -188,7 +193,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithFileSchema", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -215,7 +220,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithQueryParams", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -243,6 +248,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClientModel", summary = "To test \"client\" model", tags = { "fake" }, responses = { @@ -285,6 +291,7 @@ public interface FakeApi { * or User not found (status code 404) */ @Operation( + operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags = { "fake" }, responses = { @@ -311,8 +318,8 @@ public interface FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) Flux binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback, @Parameter(hidden = true) final ServerWebExchange exchange @@ -337,6 +344,7 @@ public interface FakeApi { * or Not found (status code 404) */ @Operation( + operationId = "testEnumParameters", summary = "To test enum parameters", tags = { "fake" }, responses = { @@ -377,6 +385,7 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @Operation( + operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", tags = { "fake" }, responses = { @@ -407,6 +416,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", tags = { "fake" }, responses = { @@ -434,6 +444,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testJsonFormData", summary = "test json serialization of form data", tags = { "fake" }, responses = { @@ -466,7 +477,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testQueryParameterCollectionFormat", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -497,6 +508,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index 6b22c1aba66..501419787ef 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index dbe78fa1c7f..0193067433b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -23,12 +25,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 229cba518a2..17dfd1cca12 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { @@ -44,6 +46,7 @@ public interface FakeClassnameTestApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClassname", summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 58497641e4c..0e301ab5f9b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 4127d96d9e3..bd1f7f3542f 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -14,12 +14,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 150f20d9401..09c88088125 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -29,7 +30,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "the pet API") public interface PetApi { @@ -46,6 +49,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -78,6 +82,7 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -110,6 +115,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -143,6 +149,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -176,6 +183,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -210,6 +218,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -244,6 +253,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -277,6 +287,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 5fa088c6f10..03b76f0b64b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 8dc1be776ea..b4c51ede918 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -16,12 +17,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 056bfb145d4..776ecce29b0 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "the store API") public interface StoreApi { @@ -46,6 +48,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -72,6 +75,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -103,6 +107,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -132,6 +137,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 9e08c646ae9..8209043ac02 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 02daadf024a..d4f1e2efbf9 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -15,12 +15,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 1bdbac92e64..14d69223a9c 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "the user API") public interface UserApi { @@ -46,6 +48,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -71,6 +74,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -96,6 +100,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -123,6 +128,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -151,6 +157,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -181,6 +188,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -208,6 +216,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -235,6 +244,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index bc2d33598fd..82725d16025 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 3985dd30ecd..063cd6d0ee8 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -16,12 +16,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0c57ae7dd14..88ea058c0c5 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5285ec2f29..0d4d67f1a9e 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index f8ca38c286d..219d797ee64 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dfd28ccb996..b2245551ad3 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ - @Schema(name = "mapString", defaultValue = "") - - + + @Schema(name = "map_string", required = false) public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ - @Schema(name = "mapNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_number", required = false) public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ - @Schema(name = "mapInteger", defaultValue = "") - - + + @Schema(name = "map_integer", required = false) public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ - @Schema(name = "mapBoolean", defaultValue = "") - - + + @Schema(name = "map_boolean", required = false) public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ - @Schema(name = "mapArrayInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_integer", required = false) public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ - @Schema(name = "mapArrayAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_anytype", required = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ - @Schema(name = "mapMapString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_string", required = false) public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ - @Schema(name = "mapMapAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_anytype", required = false) public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ - @Schema(name = "anytype1", defaultValue = "") - - + + @Schema(name = "anytype_1", required = false) public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ - @Schema(name = "anytype2", defaultValue = "") - - + + @Schema(name = "anytype_2", required = false) public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ - @Schema(name = "anytype3", defaultValue = "") - - + + @Schema(name = "anytype_3", required = false) public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5fea577ab44..ea102c40ed2 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index e6eee612a24..7a3a5d839f8 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index d7116bd7572..22e47f1bc1c 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index d2022be266f..91f47a9e83e 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index 6f096d5069e..ef0fc61b5b6 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -14,19 +14,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ - @Schema(name = "className", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "className", required = true) public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ - @Schema(name = "color", defaultValue = "") - - + + @Schema(name = "color", required = false) public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ebe36ad761a..ad560c9d834 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ - @Schema(name = "arrayArrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayArrayNumber", required = false) public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 8158dd44ab8..4409856d5a3 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ - @Schema(name = "arrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayNumber", required = false) public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 420010561bc..fd25397b6b6 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ - @Schema(name = "arrayOfString", defaultValue = "") - - + + @Schema(name = "array_of_string", required = false) public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @Schema(name = "arrayArrayOfInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_integer", required = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @Schema(name = "arrayArrayOfModel", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_model", required = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java index 7f4a080ad8d..275a075f527 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -72,9 +75,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -83,7 +85,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index d0a47ab5127..3640a6301af 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCatAllOf { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -103,7 +104,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java index 92d9a7245f1..80d6c5b2851 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ - @Schema(name = "smallCamel", defaultValue = "") - - + + @Schema(name = "smallCamel", required = false) public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ - @Schema(name = "capitalCamel", defaultValue = "") - - + + @Schema(name = "CapitalCamel", required = false) public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ - @Schema(name = "smallSnake", defaultValue = "") - - + + @Schema(name = "small_Snake", required = false) public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ - @Schema(name = "capitalSnake", defaultValue = "") - - + + @Schema(name = "Capital_Snake", required = false) public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @Schema(name = "scAETHFlowPoints", defaultValue = "") - - + + @Schema(name = "SCA_ETH_Flow_Points", required = false) public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ - @Schema(name = "ATT_NAME", defaultValue = "Name of the pet ") - - + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java index 2e496fb4acc..0b3c8b8759b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index b732a62b1bc..19ffd6fffea 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index 038fc8df3af..66dd429525d 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java index fa2a736f4fb..13a83893e61 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@Schema(name = "ClassModel",description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "_class", required = false) public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java index e11bd4ff1b1..9fbd7e3b433 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ - @Schema(name = "client", defaultValue = "") - - + + @Schema(name = "client", required = false) public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java index ed5dc71a4ba..36f36600daf 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index 2c99bc376c3..cc0bafc92e3 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index e1b2df0716a..c3e82d4c028 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ - @Schema(name = "justSymbol", defaultValue = "") - - + + @Schema(name = "just_symbol", required = false) public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ - @Schema(name = "arrayEnum", defaultValue = "") - - + + @Schema(name = "array_enum", required = false) public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java index e3d30c1ad45..4e6027d16c4 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 938af53e2b8..19ea0acc7a7 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ - @Schema(name = "enumString", defaultValue = "") - - + + @Schema(name = "enum_string", required = false) public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ - @Schema(name = "enumStringRequired", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "enum_string_required", required = true) public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ - @Schema(name = "enumInteger", defaultValue = "") - - + + @Schema(name = "enum_integer", required = false) public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ - @Schema(name = "enumNumber", defaultValue = "") - - + + @Schema(name = "enum_number", required = false) public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ - @Schema(name = "outerEnum", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "outerEnum", required = false) public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java index 001b30e1475..a2ee29fbfd6 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index c16669d0c25..77868e77410 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ - @Schema(name = "file", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "file", required = false) public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ - @Schema(name = "files", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "files", required = false) public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index 6546370cd32..0c14e2c93c1 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -17,12 +19,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ - @Schema(name = "integer", defaultValue = "") - -@Min(10) @Max(100) + @Min(10) @Max(100) + @Schema(name = "integer", required = false) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ - @Schema(name = "int32", defaultValue = "") - -@Min(20) @Max(200) + @Min(20) @Max(200) + @Schema(name = "int32", required = false) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ - @Schema(name = "int64", defaultValue = "") - - + + @Schema(name = "int64", required = false) public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ - @Schema(name = "number", required = true, defaultValue = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ - @Schema(name = "_float", defaultValue = "") - -@DecimalMin("54.3") @DecimalMax("987.6") + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ - @Schema(name = "_double", defaultValue = "") - -@DecimalMin("67.8") @DecimalMax("123.4") + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ - @Schema(name = "string", defaultValue = "") - -@Pattern(regexp = "/[a-z]/i") + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ - @Schema(name = "_byte", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "byte", required = true) public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ - @Schema(name = "binary", defaultValue = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + @Valid + @Schema(name = "binary", required = false) + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ - @Schema(name = "date", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "date", required = true) public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ - @Schema(name = "password", required = true, defaultValue = "") - @NotNull - -@Size(min = 10, max = 64) + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ - @Schema(name = "bigDecimal", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "BigDecimal", required = false) public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index dfb615a529f..ec728db1f14 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ - @Schema(name = "foo", readOnly = true, defaultValue = "") - - + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index 3ff73062758..2da2a81ac82 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ - @Schema(name = "mapMapOfString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_of_string", required = false) public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ - @Schema(name = "mapOfEnumString", defaultValue = "") - - + + @Schema(name = "map_of_enum_string", required = false) public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ - @Schema(name = "directMap", defaultValue = "") - - + + @Schema(name = "direct_map", required = false) public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ - @Schema(name = "indirectMap", defaultValue = "") - - + + @Schema(name = "indirect_map", required = false) public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 03a7be43cc4..9681c13f29d 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,17 +19,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ - @Schema(name = "uuid", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", required = false) public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ - @Schema(name = "map", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map", required = false) public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 77bf91649b0..48528166d1c 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@Schema(name = "200_response",description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "class", required = false) public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 2443600df22..4312ff4cc72 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index 03dba280141..11078e7094e 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ - @Schema(name = "_123list", defaultValue = "") - - + + @Schema(name = "123-list", required = false) public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index 0301a47e9f3..37c94a6aa80 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@Schema(name = "Return",description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Return", description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ - @Schema(name = "_return", defaultValue = "") - - + + @Schema(name = "return", required = false) public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index 62a16f80ee0..2876e64e991 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@Schema(name = "Name",description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ - @Schema(name = "snakeCase", readOnly = true, defaultValue = "") - - + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ - @Schema(name = "property", defaultValue = "") - - + + @Schema(name = "property", required = false) public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ - @Schema(name = "_123number", readOnly = true, defaultValue = "") - - + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java index 521fad80d5a..05c9f0a7785 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ - @Schema(name = "justNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "JustNumber", required = false) public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java index 05071bdfe2b..90b0d295718 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index a721a3dde6a..14ff8ff8a9f 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ - @Schema(name = "myNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "my_number", required = false) public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ - @Schema(name = "myString", defaultValue = "") - - + + @Schema(name = "my_string", required = false) public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ - @Schema(name = "myBoolean", defaultValue = "") - - + + @Schema(name = "my_boolean", required = false) public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java index ba0cca8a5e8..7fdf6f47de3 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 988eb317134..51d583a02e5 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -20,12 +20,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -92,9 +95,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -112,10 +114,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -133,10 +133,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -159,10 +157,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public Set getPhotoUrls() { return photoUrls; } @@ -189,10 +185,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -210,9 +204,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -221,7 +214,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -248,7 +240,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1c51770a8e6..1d95448aeef 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ - @Schema(name = "baz", defaultValue = "") - - + + @Schema(name = "baz", required = false) public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 75f4be4e9f8..3dcdd9ee3f5 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @Schema(name = "$specialPropertyName", defaultValue = "") - - + + @Schema(name = "$special[property.name]", required = false) public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java index 8722df999bf..6b24df20471 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 19e9bf310f7..66695c3e847 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", required = true) public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", required = true) public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", required = true) public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", required = true) public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index c9a3762bc74..fdc9a096075 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", example = "what", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", example = "what", required = true) public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ - @Schema(name = "floatItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", example = "-2", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", example = "true", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", example = "true", required = true) public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", example = "[0, 1, 2, 3]", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java index 83152a15553..9aae48b0ceb 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index 59a183db0f6..b886d9d3f61 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ - @Schema(name = "attributeString", example = "string", defaultValue = "") - - + + @Schema(name = "attribute_string", example = "string", required = false) public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ - @Schema(name = "attributeNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ - @Schema(name = "attributeInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "attribute_integer", example = "-2", required = false) public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ - @Schema(name = "attributeBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "attribute_boolean", example = "true", required = false) public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ - @Schema(name = "wrappedArray", defaultValue = "") - - + + @Schema(name = "wrapped_array", required = false) public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ - @Schema(name = "nameString", example = "string", defaultValue = "") - - + + @Schema(name = "name_string", example = "string", required = false) public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ - @Schema(name = "nameNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "name_number", example = "1.234", required = false) public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ - @Schema(name = "nameInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "name_integer", example = "-2", required = false) public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ - @Schema(name = "nameBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "name_boolean", example = "true", required = false) public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ - @Schema(name = "nameArray", defaultValue = "") - - + + @Schema(name = "name_array", required = false) public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ - @Schema(name = "nameWrappedArray", defaultValue = "") - - + + @Schema(name = "name_wrapped_array", required = false) public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ - @Schema(name = "prefixString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_string", example = "string", required = false) public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ - @Schema(name = "prefixNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ - @Schema(name = "prefixInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_integer", example = "-2", required = false) public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ - @Schema(name = "prefixBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_boolean", example = "true", required = false) public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ - @Schema(name = "prefixArray", defaultValue = "") - - + + @Schema(name = "prefix_array", required = false) public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ - @Schema(name = "prefixWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_wrapped_array", required = false) public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ - @Schema(name = "namespaceString", example = "string", defaultValue = "") - - + + @Schema(name = "namespace_string", example = "string", required = false) public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ - @Schema(name = "namespaceNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ - @Schema(name = "namespaceInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "namespace_integer", example = "-2", required = false) public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ - @Schema(name = "namespaceBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "namespace_boolean", example = "true", required = false) public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ - @Schema(name = "namespaceArray", defaultValue = "") - - + + @Schema(name = "namespace_array", required = false) public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @Schema(name = "namespaceWrappedArray", defaultValue = "") - - + + @Schema(name = "namespace_wrapped_array", required = false) public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ - @Schema(name = "prefixNsString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_ns_string", example = "string", required = false) public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ - @Schema(name = "prefixNsNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ - @Schema(name = "prefixNsInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ - @Schema(name = "prefixNsBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ - @Schema(name = "prefixNsArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_array", required = false) public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @Schema(name = "prefixNsWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_wrapped_array", required = false) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index ccd404fbf32..26879041d82 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -27,7 +27,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { @@ -44,6 +46,7 @@ public interface AnotherFakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "call123testSpecialTags", summary = "To test special tags", tags = { "$another-fake?" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 720457848da..f34a5b0d2b7 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.v3.oas.annotations.Operation; @@ -36,7 +38,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") public interface FakeApi { @@ -53,6 +57,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createXmlItem", summary = "creates an XmlItem", tags = { "fake" }, responses = { @@ -80,7 +85,7 @@ public interface FakeApi { * @return Output boolean (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterBooleanSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) @@ -107,7 +112,7 @@ public interface FakeApi { * @return Output composite (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterCompositeSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class))) @@ -143,7 +148,7 @@ public interface FakeApi { * @return Output number (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterNumberSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class))) @@ -170,7 +175,7 @@ public interface FakeApi { * @return Output string (status code 200) */ @Operation( - summary = "", + operationId = "fakeOuterStringSerialize", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))) @@ -197,7 +202,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithFileSchema", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -224,7 +229,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testBodyWithQueryParams", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -252,6 +257,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClientModel", summary = "To test \"client\" model", tags = { "fake" }, responses = { @@ -303,6 +309,7 @@ public interface FakeApi { * or User not found (status code 404) */ @Operation( + operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags = { "fake" }, responses = { @@ -329,8 +336,8 @@ public interface FakeApi { @Parameter(name = "float", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "float", required = false) Float _float, @Parameter(name = "string", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "string", required = false) String string, @Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "date", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @Parameter(name = "password", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "password", required = false) String password, @Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { @@ -355,6 +362,7 @@ public interface FakeApi { * or Not found (status code 404) */ @Operation( + operationId = "testEnumParameters", summary = "To test enum parameters", tags = { "fake" }, responses = { @@ -395,6 +403,7 @@ public interface FakeApi { * @return Someting wrong (status code 400) */ @Operation( + operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", tags = { "fake" }, responses = { @@ -425,6 +434,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", tags = { "fake" }, responses = { @@ -452,6 +462,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testJsonFormData", summary = "test json serialization of form data", tags = { "fake" }, responses = { @@ -484,7 +495,7 @@ public interface FakeApi { * @return Success (status code 200) */ @Operation( - summary = "", + operationId = "testQueryParameterCollectionFormat", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "Success") @@ -515,6 +526,7 @@ public interface FakeApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 62e37859725..ff42c358bc4 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -27,7 +27,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { @@ -44,6 +46,7 @@ public interface FakeClassnameTestApi { * @return successful operation (status code 200) */ @Operation( + operationId = "testClassname", summary = "To test class name in snake case", tags = { "fake_classname_tags 123#$%^" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index f28b85a8343..5f049169a64 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -29,7 +30,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "the pet API") public interface PetApi { @@ -46,6 +49,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -78,6 +82,7 @@ public interface PetApi { * or Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -110,6 +115,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -157,6 +163,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -204,6 +211,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -252,6 +260,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -286,6 +295,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -319,6 +329,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index de9b9d16f83..2709d5b98b6 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "the store API") public interface StoreApi { @@ -46,6 +48,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -72,6 +75,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -104,6 +108,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -147,6 +152,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 5a85648b515..9c87066a553 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "the user API") public interface UserApi { @@ -46,6 +48,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -71,6 +74,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -96,6 +100,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -123,6 +128,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -151,6 +157,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -195,6 +202,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -222,6 +230,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -250,6 +259,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 0c57ae7dd14..88ea058c0c5 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5285ec2f29..0d4d67f1a9e 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index f8ca38c286d..219d797ee64 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dfd28ccb996..b2245551ad3 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ - @Schema(name = "mapString", defaultValue = "") - - + + @Schema(name = "map_string", required = false) public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ - @Schema(name = "mapNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_number", required = false) public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ - @Schema(name = "mapInteger", defaultValue = "") - - + + @Schema(name = "map_integer", required = false) public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ - @Schema(name = "mapBoolean", defaultValue = "") - - + + @Schema(name = "map_boolean", required = false) public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ - @Schema(name = "mapArrayInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_integer", required = false) public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ - @Schema(name = "mapArrayAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_array_anytype", required = false) public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ - @Schema(name = "mapMapString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_string", required = false) public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ - @Schema(name = "mapMapAnytype", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_anytype", required = false) public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ - @Schema(name = "anytype1", defaultValue = "") - - + + @Schema(name = "anytype_1", required = false) public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ - @Schema(name = "anytype2", defaultValue = "") - - + + @Schema(name = "anytype_2", required = false) public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ - @Schema(name = "anytype3", defaultValue = "") - - + + @Schema(name = "anytype_3", required = false) public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5fea577ab44..ea102c40ed2 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index e6eee612a24..7a3a5d839f8 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index d7116bd7572..22e47f1bc1c 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index d2022be266f..91f47a9e83e 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 6f096d5069e..ef0fc61b5b6 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -14,19 +14,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ - @Schema(name = "className", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "className", required = true) public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ - @Schema(name = "color", defaultValue = "") - - + + @Schema(name = "color", required = false) public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ebe36ad761a..ad560c9d834 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ - @Schema(name = "arrayArrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayArrayNumber", required = false) public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 8158dd44ab8..4409856d5a3 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ - @Schema(name = "arrayNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "ArrayNumber", required = false) public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 420010561bc..fd25397b6b6 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ - @Schema(name = "arrayOfString", defaultValue = "") - - + + @Schema(name = "array_of_string", required = false) public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @Schema(name = "arrayArrayOfInteger", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_integer", required = false) public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @Schema(name = "arrayArrayOfModel", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "array_array_of_model", required = false) public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 7f4a080ad8d..275a075f527 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -72,9 +75,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -83,7 +85,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index d0a47ab5127..3640a6301af 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCatAllOf { * Get kind * @return kind */ - @Schema(name = "kind", defaultValue = "") - - + + @Schema(name = "kind", required = false) public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -103,7 +104,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 92d9a7245f1..80d6c5b2851 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ - @Schema(name = "smallCamel", defaultValue = "") - - + + @Schema(name = "smallCamel", required = false) public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ - @Schema(name = "capitalCamel", defaultValue = "") - - + + @Schema(name = "CapitalCamel", required = false) public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ - @Schema(name = "smallSnake", defaultValue = "") - - + + @Schema(name = "small_Snake", required = false) public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ - @Schema(name = "capitalSnake", defaultValue = "") - - + + @Schema(name = "Capital_Snake", required = false) public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @Schema(name = "scAETHFlowPoints", defaultValue = "") - - + + @Schema(name = "SCA_ETH_Flow_Points", required = false) public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ - @Schema(name = "ATT_NAME", defaultValue = "Name of the pet ") - - + + @Schema(name = "ATT_NAME", description = "Name of the pet ", required = false) public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 2e496fb4acc..0b3c8b8759b 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index b732a62b1bc..19ffd6fffea 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ - @Schema(name = "declawed", defaultValue = "") - - + + @Schema(name = "declawed", required = false) public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index 038fc8df3af..66dd429525d 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index fa2a736f4fb..13a83893e61 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@Schema(name = "ClassModel",description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "_class", required = false) public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index e11bd4ff1b1..9fbd7e3b433 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ - @Schema(name = "client", defaultValue = "") - - + + @Schema(name = "client", required = false) public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index ed5dc71a4ba..36f36600daf 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index 2c99bc376c3..cc0bafc92e3 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ - @Schema(name = "breed", defaultValue = "") - - + + @Schema(name = "breed", required = false) public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index e1b2df0716a..c3e82d4c028 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ - @Schema(name = "justSymbol", defaultValue = "") - - + + @Schema(name = "just_symbol", required = false) public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ - @Schema(name = "arrayEnum", defaultValue = "") - - + + @Schema(name = "array_enum", required = false) public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java index e3d30c1ad45..4e6027d16c4 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 938af53e2b8..19ea0acc7a7 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ - @Schema(name = "enumString", defaultValue = "") - - + + @Schema(name = "enum_string", required = false) public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ - @Schema(name = "enumStringRequired", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "enum_string_required", required = true) public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ - @Schema(name = "enumInteger", defaultValue = "") - - + + @Schema(name = "enum_integer", required = false) public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ - @Schema(name = "enumNumber", defaultValue = "") - - + + @Schema(name = "enum_number", required = false) public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ - @Schema(name = "outerEnum", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "outerEnum", required = false) public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index 001b30e1475..a2ee29fbfd6 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "File", description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - + + @Schema(name = "sourceURI", description = "Test capitalization", required = false) public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index c16669d0c25..77868e77410 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ - @Schema(name = "file", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "file", required = false) public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ - @Schema(name = "files", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "files", required = false) public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 6546370cd32..0c14e2c93c1 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -17,12 +19,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ - @Schema(name = "integer", defaultValue = "") - -@Min(10) @Max(100) + @Min(10) @Max(100) + @Schema(name = "integer", required = false) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ - @Schema(name = "int32", defaultValue = "") - -@Min(20) @Max(200) + @Min(20) @Max(200) + @Schema(name = "int32", required = false) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ - @Schema(name = "int64", defaultValue = "") - - + + @Schema(name = "int64", required = false) public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ - @Schema(name = "number", required = true, defaultValue = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") + @Schema(name = "number", required = true) public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ - @Schema(name = "_float", defaultValue = "") - -@DecimalMin("54.3") @DecimalMax("987.6") + @DecimalMin("54.3") @DecimalMax("987.6") + @Schema(name = "float", required = false) public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ - @Schema(name = "_double", defaultValue = "") - -@DecimalMin("67.8") @DecimalMax("123.4") + @DecimalMin("67.8") @DecimalMax("123.4") + @Schema(name = "double", required = false) public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ - @Schema(name = "string", defaultValue = "") - -@Pattern(regexp = "/[a-z]/i") + @Pattern(regexp = "/[a-z]/i") + @Schema(name = "string", required = false) public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ - @Schema(name = "_byte", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "byte", required = true) public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ - @Schema(name = "binary", defaultValue = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + @Valid + @Schema(name = "binary", required = false) + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ - @Schema(name = "date", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "date", required = true) public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", required = false) public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ - @Schema(name = "password", required = true, defaultValue = "") - @NotNull - -@Size(min = 10, max = 64) + @NotNull @Size(min = 10, max = 64) + @Schema(name = "password", required = true) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ - @Schema(name = "bigDecimal", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "BigDecimal", required = false) public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index dfb615a529f..ec728db1f14 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ - @Schema(name = "foo", readOnly = true, defaultValue = "") - - + + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 3ff73062758..2da2a81ac82 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ - @Schema(name = "mapMapOfString", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map_map_of_string", required = false) public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ - @Schema(name = "mapOfEnumString", defaultValue = "") - - + + @Schema(name = "map_of_enum_string", required = false) public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ - @Schema(name = "directMap", defaultValue = "") - - + + @Schema(name = "direct_map", required = false) public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ - @Schema(name = "indirectMap", defaultValue = "") - - + + @Schema(name = "indirect_map", required = false) public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 03a7be43cc4..9681c13f29d 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,17 +19,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ - @Schema(name = "uuid", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "uuid", required = false) public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ - @Schema(name = "dateTime", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "dateTime", required = false) public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ - @Schema(name = "map", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "map", required = false) public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 77bf91649b0..48528166d1c 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@Schema(name = "200_response",description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "200_response", description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ - @Schema(name = "propertyClass", defaultValue = "") - - + + @Schema(name = "class", required = false) public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 2443600df22..4312ff4cc72 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 03dba280141..11078e7094e 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ - @Schema(name = "_123list", defaultValue = "") - - + + @Schema(name = "123-list", required = false) public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 0301a47e9f3..37c94a6aa80 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@Schema(name = "Return",description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Return", description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ - @Schema(name = "_return", defaultValue = "") - - + + @Schema(name = "return", required = false) public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 62a16f80ee0..2876e64e991 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@Schema(name = "Name",description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Name", description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ - @Schema(name = "name", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", required = true) public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ - @Schema(name = "snakeCase", readOnly = true, defaultValue = "") - - + + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ - @Schema(name = "property", defaultValue = "") - - + + @Schema(name = "property", required = false) public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ - @Schema(name = "_123number", readOnly = true, defaultValue = "") - - + + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, required = false) public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index 521fad80d5a..05c9f0a7785 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ - @Schema(name = "justNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "JustNumber", required = false) public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 05071bdfe2b..90b0d295718 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index a721a3dde6a..14ff8ff8a9f 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ - @Schema(name = "myNumber", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "my_number", required = false) public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ - @Schema(name = "myString", defaultValue = "") - - + + @Schema(name = "my_string", required = false) public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ - @Schema(name = "myBoolean", defaultValue = "") - - + + @Schema(name = "my_boolean", required = false) public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java index ba0cca8a5e8..7fdf6f47de3 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 988eb317134..51d583a02e5 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -20,12 +20,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -92,9 +95,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -112,10 +114,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -133,10 +133,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -159,10 +157,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public Set getPhotoUrls() { return photoUrls; } @@ -189,10 +185,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -210,9 +204,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -221,7 +214,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -248,7 +240,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1c51770a8e6..1d95448aeef 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ - @Schema(name = "bar", readOnly = true, defaultValue = "") - - + + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, required = false) public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ - @Schema(name = "baz", defaultValue = "") - - + + @Schema(name = "baz", required = false) public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 75f4be4e9f8..3dcdd9ee3f5 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @Schema(name = "$specialPropertyName", defaultValue = "") - - + + @Schema(name = "$special[property.name]", required = false) public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 8722df999bf..6b24df20471 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index 19e9bf310f7..66695c3e847 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", required = true) public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", required = true) public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", required = true) public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", required = true) public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index c9a3762bc74..fdc9a096075 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ - @Schema(name = "stringItem", example = "what", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "string_item", example = "what", required = true) public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ - @Schema(name = "numberItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - @Valid - + @NotNull @Valid + @Schema(name = "number_item", example = "1.234", required = true) public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ - @Schema(name = "floatItem", example = "1.234", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "float_item", example = "1.234", required = true) public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ - @Schema(name = "integerItem", example = "-2", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "integer_item", example = "-2", required = true) public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ - @Schema(name = "boolItem", example = "true", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "bool_item", example = "true", required = true) public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ - @Schema(name = "arrayItem", example = "[0, 1, 2, 3]", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "array_item", example = "[0, 1, 2, 3]", required = true) public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 83152a15553..9aae48b0ceb 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 59a183db0f6..b886d9d3f61 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ - @Schema(name = "attributeString", example = "string", defaultValue = "") - - + + @Schema(name = "attribute_string", example = "string", required = false) public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ - @Schema(name = "attributeNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "attribute_number", example = "1.234", required = false) public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ - @Schema(name = "attributeInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "attribute_integer", example = "-2", required = false) public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ - @Schema(name = "attributeBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "attribute_boolean", example = "true", required = false) public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ - @Schema(name = "wrappedArray", defaultValue = "") - - + + @Schema(name = "wrapped_array", required = false) public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ - @Schema(name = "nameString", example = "string", defaultValue = "") - - + + @Schema(name = "name_string", example = "string", required = false) public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ - @Schema(name = "nameNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "name_number", example = "1.234", required = false) public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ - @Schema(name = "nameInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "name_integer", example = "-2", required = false) public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ - @Schema(name = "nameBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "name_boolean", example = "true", required = false) public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ - @Schema(name = "nameArray", defaultValue = "") - - + + @Schema(name = "name_array", required = false) public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ - @Schema(name = "nameWrappedArray", defaultValue = "") - - + + @Schema(name = "name_wrapped_array", required = false) public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ - @Schema(name = "prefixString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_string", example = "string", required = false) public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ - @Schema(name = "prefixNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_number", example = "1.234", required = false) public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ - @Schema(name = "prefixInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_integer", example = "-2", required = false) public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ - @Schema(name = "prefixBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_boolean", example = "true", required = false) public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ - @Schema(name = "prefixArray", defaultValue = "") - - + + @Schema(name = "prefix_array", required = false) public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ - @Schema(name = "prefixWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_wrapped_array", required = false) public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ - @Schema(name = "namespaceString", example = "string", defaultValue = "") - - + + @Schema(name = "namespace_string", example = "string", required = false) public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ - @Schema(name = "namespaceNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "namespace_number", example = "1.234", required = false) public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ - @Schema(name = "namespaceInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "namespace_integer", example = "-2", required = false) public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ - @Schema(name = "namespaceBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "namespace_boolean", example = "true", required = false) public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ - @Schema(name = "namespaceArray", defaultValue = "") - - + + @Schema(name = "namespace_array", required = false) public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @Schema(name = "namespaceWrappedArray", defaultValue = "") - - + + @Schema(name = "namespace_wrapped_array", required = false) public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ - @Schema(name = "prefixNsString", example = "string", defaultValue = "") - - + + @Schema(name = "prefix_ns_string", example = "string", required = false) public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ - @Schema(name = "prefixNsNumber", example = "1.234", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "prefix_ns_number", example = "1.234", required = false) public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ - @Schema(name = "prefixNsInteger", example = "-2", defaultValue = "") - - + + @Schema(name = "prefix_ns_integer", example = "-2", required = false) public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ - @Schema(name = "prefixNsBoolean", example = "true", defaultValue = "") - - + + @Schema(name = "prefix_ns_boolean", example = "true", required = false) public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ - @Schema(name = "prefixNsArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_array", required = false) public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @Schema(name = "prefixNsWrappedArray", defaultValue = "") - - + + @Schema(name = "prefix_ns_wrapped_array", required = false) public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 0bec586d693..f27571c387b 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -28,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "the pet API") public interface PetApi { @@ -45,6 +48,7 @@ public interface PetApi { * or Invalid input (status code 405) */ @Operation( + operationId = "addPet", summary = "Add a new pet to the store", tags = { "pet" }, responses = { @@ -91,6 +95,7 @@ public interface PetApi { * @return Invalid pet value (status code 400) */ @Operation( + operationId = "deletePet", summary = "Deletes a pet", tags = { "pet" }, responses = { @@ -122,6 +127,7 @@ public interface PetApi { * or Invalid status value (status code 400) */ @Operation( + operationId = "findPetsByStatus", summary = "Finds Pets by status", tags = { "pet" }, responses = { @@ -169,6 +175,7 @@ public interface PetApi { * @deprecated */ @Operation( + operationId = "findPetsByTags", summary = "Finds Pets by tags", tags = { "pet" }, responses = { @@ -216,6 +223,7 @@ public interface PetApi { * or Pet not found (status code 404) */ @Operation( + operationId = "getPetById", summary = "Find pet by ID", tags = { "pet" }, responses = { @@ -264,6 +272,7 @@ public interface PetApi { * or Validation exception (status code 405) */ @Operation( + operationId = "updatePet", summary = "Update an existing pet", tags = { "pet" }, responses = { @@ -313,6 +322,7 @@ public interface PetApi { * @return Invalid input (status code 405) */ @Operation( + operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", tags = { "pet" }, responses = { @@ -346,6 +356,7 @@ public interface PetApi { * @return successful operation (status code 200) */ @Operation( + operationId = "uploadFile", summary = "uploads an image", tags = { "pet" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 98cbb475200..04b786a8ba4 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -28,7 +28,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "the store API") public interface StoreApi { @@ -46,6 +48,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "deleteOrder", summary = "Delete purchase order by ID", tags = { "store" }, responses = { @@ -72,6 +75,7 @@ public interface StoreApi { * @return successful operation (status code 200) */ @Operation( + operationId = "getInventory", summary = "Returns pet inventories by status", tags = { "store" }, responses = { @@ -104,6 +108,7 @@ public interface StoreApi { * or Order not found (status code 404) */ @Operation( + operationId = "getOrderById", summary = "Find purchase order by ID", tags = { "store" }, responses = { @@ -147,6 +152,7 @@ public interface StoreApi { * or Invalid Order (status code 400) */ @Operation( + operationId = "placeOrder", summary = "Place an order for a pet", tags = { "store" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 899416135fc..3268f2475c0 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -29,7 +29,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "the user API") public interface UserApi { @@ -46,6 +48,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUser", summary = "Create user", tags = { "user" }, responses = { @@ -75,6 +78,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -104,6 +108,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", tags = { "user" }, responses = { @@ -135,6 +140,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "deleteUser", summary = "Delete user", tags = { "user" }, responses = { @@ -166,6 +172,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "getUserByName", summary = "Get user by user name", tags = { "user" }, responses = { @@ -210,6 +217,7 @@ public interface UserApi { * or Invalid username/password supplied (status code 400) */ @Operation( + operationId = "loginUser", summary = "Logs user into the system", tags = { "user" }, responses = { @@ -237,6 +245,7 @@ public interface UserApi { * @return successful operation (status code 200) */ @Operation( + operationId = "logoutUser", summary = "Logs out current logged in user session", tags = { "user" }, responses = { @@ -268,6 +277,7 @@ public interface UserApi { * or User not found (status code 404) */ @Operation( + operationId = "updateUser", summary = "Updated user", tags = { "user" }, responses = { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index 463de0ed39a..823adb2ae4d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ -@Schema(name = "Category",description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - -@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index 0ef610e38f0..ea4f1e40264 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ -@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index 528598b79ea..e624a0d7c1f 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -14,13 +15,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ -@Schema(name = "Order",description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 7c2986fea84..ddff66759ba 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -17,13 +17,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ -@Schema(name = "Pet",description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index 27166f687a2..5c3ac82ba6e 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ -@Schema(name = "Tag",description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index ba24f681c1d..328569672eb 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -12,13 +12,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ -@Schema(name = "User",description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java index b5835986bec..e8a00e182c5 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Category.java @@ -16,15 +16,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; import java.util.*; +import javax.annotation.Generated; /** * A category for a pet */ -@Schema(name = "Category",description = "A category for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Category") + +@Schema(name = "Category", description = "A category for a pet") +@JacksonXmlRootElement(localName = "Category") @XmlRootElement(name = "Category") @XmlAccessorType(XmlAccessType.FIELD) + +@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Category { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; @@ -42,9 +47,8 @@ public class Category { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -62,9 +66,8 @@ public class Category { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - -@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Schema(name = "name", required = false) public String getName() { return name; } @@ -73,7 +76,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -96,7 +98,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java index 4029a7a8be3..9be10750783 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -16,15 +16,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; import java.util.*; +import javax.annotation.Generated; /** * Describes the result of uploading an image resource */ -@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "ModelApiResponse") + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@JacksonXmlRootElement(localName = "ModelApiResponse") @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) + +@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class ModelApiResponse { + @JsonProperty("code") @JacksonXmlProperty(localName = "code") private Integer code; @@ -46,9 +51,8 @@ public class ModelApiResponse { * Get code * @return code */ - @Schema(name = "code", defaultValue = "") - - + + @Schema(name = "code", required = false) public Integer getCode() { return code; } @@ -66,9 +70,8 @@ public class ModelApiResponse { * Get type * @return type */ - @Schema(name = "type", defaultValue = "") - - + + @Schema(name = "type", required = false) public String getType() { return type; } @@ -86,9 +89,8 @@ public class ModelApiResponse { * Get message * @return message */ - @Schema(name = "message", defaultValue = "") - - + + @Schema(name = "message", required = false) public String getMessage() { return message; } @@ -97,7 +99,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -121,7 +122,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java index 50fc948d4d5..5e8e4d0fc1a 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Order.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,15 +19,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; import java.util.*; +import javax.annotation.Generated; /** * An order for a pets from the pet store */ -@Schema(name = "Order",description = "An order for a pets from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Order") + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@JacksonXmlRootElement(localName = "Order") @XmlRootElement(name = "Order") @XmlAccessorType(XmlAccessType.FIELD) + +@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Order { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; @@ -41,7 +47,7 @@ public class Order { @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private Date shipDate; /** @@ -98,9 +104,8 @@ public class Order { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -118,9 +123,8 @@ public class Order { * Get petId * @return petId */ - @Schema(name = "petId", defaultValue = "") - - + + @Schema(name = "petId", required = false) public Long getPetId() { return petId; } @@ -138,9 +142,8 @@ public class Order { * Get quantity * @return quantity */ - @Schema(name = "quantity", defaultValue = "") - - + + @Schema(name = "quantity", required = false) public Integer getQuantity() { return quantity; } @@ -158,10 +161,8 @@ public class Order { * Get shipDate * @return shipDate */ - @Schema(name = "shipDate", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "shipDate", required = false) public Date getShipDate() { return shipDate; } @@ -179,9 +180,8 @@ public class Order { * Order Status * @return status */ - @Schema(name = "status", defaultValue = "Order Status") - - + + @Schema(name = "status", description = "Order Status", required = false) public StatusEnum getStatus() { return status; } @@ -199,9 +199,8 @@ public class Order { * Get complete * @return complete */ - @Schema(name = "complete", defaultValue = "") - - + + @Schema(name = "complete", required = false) public Boolean getComplete() { return complete; } @@ -210,7 +209,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -237,7 +235,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index 04fe97643f6..22b7ba48291 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -21,15 +21,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; import java.util.*; +import javax.annotation.Generated; /** * A pet for sale in the pet store */ -@Schema(name = "Pet",description = "A pet for sale in the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Pet") + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@JacksonXmlRootElement(localName = "Pet") @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) + +@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Pet { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; @@ -102,9 +107,8 @@ public class Pet { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -122,10 +126,8 @@ public class Pet { * Get category * @return category */ - @Schema(name = "category", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "category", required = false) public Category getCategory() { return category; } @@ -143,10 +145,8 @@ public class Pet { * Get name * @return name */ - @Schema(name = "name", example = "doggie", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "name", example = "doggie", required = true) public String getName() { return name; } @@ -169,10 +169,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ - @Schema(name = "photoUrls", required = true, defaultValue = "") - @NotNull - - + @NotNull + @Schema(name = "photoUrls", required = true) public List getPhotoUrls() { return photoUrls; } @@ -198,10 +196,8 @@ public class Pet { * Get tags * @return tags */ - @Schema(name = "tags", defaultValue = "") - - @Valid - + @Valid + @Schema(name = "tags", required = false) public List getTags() { return tags; } @@ -219,9 +215,8 @@ public class Pet { * pet status in the store * @return status */ - @Schema(name = "status", defaultValue = "pet status in the store") - - + + @Schema(name = "status", description = "pet status in the store", required = false) public StatusEnum getStatus() { return status; } @@ -230,7 +225,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -257,7 +251,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java index 1c26d879995..a7beefc2415 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Tag.java @@ -16,15 +16,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; import java.util.*; +import javax.annotation.Generated; /** * A tag for a pet */ -@Schema(name = "Tag",description = "A tag for a pet") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "Tag") + +@Schema(name = "Tag", description = "A tag for a pet") +@JacksonXmlRootElement(localName = "Tag") @XmlRootElement(name = "Tag") @XmlAccessorType(XmlAccessType.FIELD) + +@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class Tag { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; @@ -42,9 +47,8 @@ public class Tag { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -62,9 +66,8 @@ public class Tag { * Get name * @return name */ - @Schema(name = "name", defaultValue = "") - - + + @Schema(name = "name", required = false) public String getName() { return name; } @@ -73,7 +76,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -96,7 +98,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java index e6943a48f32..f8b1176d41b 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/User.java @@ -16,15 +16,20 @@ import io.swagger.v3.oas.annotations.media.Schema; import javax.xml.bind.annotation.*; import java.util.*; +import javax.annotation.Generated; /** * A User who is purchasing from the pet store */ -@Schema(name = "User",description = "A User who is purchasing from the pet store") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen")@JacksonXmlRootElement(localName = "User") + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@JacksonXmlRootElement(localName = "User") @XmlRootElement(name = "User") @XmlAccessorType(XmlAccessType.FIELD) + +@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen") public class User { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") private Long id; @@ -66,9 +71,8 @@ public class User { * Get id * @return id */ - @Schema(name = "id", defaultValue = "") - - + + @Schema(name = "id", required = false) public Long getId() { return id; } @@ -86,9 +90,8 @@ public class User { * Get username * @return username */ - @Schema(name = "username", defaultValue = "") - - + + @Schema(name = "username", required = false) public String getUsername() { return username; } @@ -106,9 +109,8 @@ public class User { * Get firstName * @return firstName */ - @Schema(name = "firstName", defaultValue = "") - - + + @Schema(name = "firstName", required = false) public String getFirstName() { return firstName; } @@ -126,9 +128,8 @@ public class User { * Get lastName * @return lastName */ - @Schema(name = "lastName", defaultValue = "") - - + + @Schema(name = "lastName", required = false) public String getLastName() { return lastName; } @@ -146,9 +147,8 @@ public class User { * Get email * @return email */ - @Schema(name = "email", defaultValue = "") - - + + @Schema(name = "email", required = false) public String getEmail() { return email; } @@ -166,9 +166,8 @@ public class User { * Get password * @return password */ - @Schema(name = "password", defaultValue = "") - - + + @Schema(name = "password", required = false) public String getPassword() { return password; } @@ -186,9 +185,8 @@ public class User { * Get phone * @return phone */ - @Schema(name = "phone", defaultValue = "") - - + + @Schema(name = "phone", required = false) public String getPhone() { return phone; } @@ -206,9 +204,8 @@ public class User { * User Status * @return userStatus */ - @Schema(name = "userStatus", defaultValue = "User Status") - - + + @Schema(name = "userStatus", description = "User Status", required = false) public Integer getUserStatus() { return userStatus; } @@ -217,7 +214,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -246,7 +242,6 @@ public class User { 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"); diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index f4cc86e3817..cf414337bbc 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "test-headers", description = "the test-headers API") public interface TestHeadersApi { diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java index 503c9cea661..cdc9e71f434 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.toto.base-path:}") public class TestHeadersApiController implements TestHeadersApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public TestHeadersApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index 208840a0b05..e585fe05b84 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "test-query-params", description = "the test-query-params API") public interface TestQueryParamsApi { diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java index 8ded34a79bb..1884ac71c22 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.toto.base-path:}") public class TestQueryParamsApiController implements TestQueryParamsApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public TestQueryParamsApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java index e7115a5f13b..cae289f03d1 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TestResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TestResponse { + @JsonProperty("id") private Integer id; @@ -41,10 +44,8 @@ public class TestResponse { * Get id * @return id */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getId() { return id; } @@ -62,10 +63,8 @@ public class TestResponse { * Get stringField * @return stringField */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringField() { return stringField; } @@ -83,11 +82,8 @@ public class TestResponse { * Get numberField * @return numberField */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberField() { return numberField; } @@ -105,10 +101,8 @@ public class TestResponse { * Get booleanField * @return booleanField */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBooleanField() { return booleanField; } @@ -117,7 +111,6 @@ public class TestResponse { this.booleanField = booleanField; } - @Override public boolean equals(Object o) { if (this == o) { @@ -142,7 +135,6 @@ public class TestResponse { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TestResponse {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" stringField: ").append(toIndentedString(stringField)).append("\n"); sb.append(" numberField: ").append(toIndentedString(numberField)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57027ab454f..82d201bd766 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -21,7 +21,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7e8132190d6..81dcb1da85e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 5481edab7a7..8b5f909ae5c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -30,7 +32,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -350,8 +354,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java index 1ac9ecd804c..b81393d39d3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4d7d81f1a1b..05159a4c14f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -21,7 +21,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 68f9c4233e8..3f4a45e1f9f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index 22c715f84ef..053fc844b0d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -23,7 +24,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java index 1485b58cb3e..57cbf21bde7 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index f3637cae181..00a99bf54ba 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -22,7 +22,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java index 3a8489c4176..a1f02f844bf 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 1293676616e..e8b247455d1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -23,7 +23,9 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java index 85e90691158..8efc6418c2e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java index fbf95bc7502..682e77202d1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java @@ -20,8 +20,9 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) @EnableWebMvc diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java index 01abb13330d..8e9d7af8244 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java @@ -1,8 +1,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { @Override diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java index 1fa5ce119f8..691a5378ca4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java @@ -2,8 +2,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7e8132190d6..81dcb1da85e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index bc0af05b90f..8c4c84d2700 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) LocalDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java index 1ac9ecd804c..b81393d39d3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 68f9c4233e8..3f4a45e1f9f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index e969bf66765..90ce18382be 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java index 1485b58cb3e..57cbf21bde7 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java index 3a8489c4176..a1f02f844bf 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 9ab7a9c21f5..acaf496cde7 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java index 85e90691158..8efc6418c2e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java index fbf95bc7502..682e77202d1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java @@ -20,8 +20,9 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) @EnableWebMvc diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java index 01abb13330d..8e9d7af8244 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebApplication.java @@ -1,8 +1,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { @Override diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java index 1fa5ce119f8..691a5378ca4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java @@ -2,8 +2,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java index 1eb518cb89d..63af72a20e4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public LocalDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 04802633a42..d36d85b62d8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public LocalDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java index 593ed335a0f..2a6c352f08b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public LocalDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7e8132190d6..81dcb1da85e 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 71ffda67b0c..f63a9141189 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 1ac9ecd804c..b81393d39d3 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 68f9c4233e8..3f4a45e1f9f 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index e969bf66765..90ce18382be 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 1485b58cb3e..57cbf21bde7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 3a8489c4176..a1f02f844bf 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 85e90691158..8efc6418c2e 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java index 97c36459aa0..7e3d25bb275 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java @@ -19,8 +19,9 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) @EnableWebMvc diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java index 01abb13330d..8e9d7af8244 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebApplication.java @@ -1,8 +1,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { @Override diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java index 1fa5ce119f8..691a5378ca4 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java @@ -2,8 +2,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 54acb563336..73241ece58a 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index af849ea35e7..8ccdac40b27 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index e494b1b2c60..a191e434268 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 00ab9b250fb..b319600c951 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 7e78c62f6e1..989f88c0c63 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index d01dc2c8e74..32e7a118e94 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index ef6da01824a..a9f074c13f6 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 13174a324c5..fcf049c6af9 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java index e61b1eb77b6..c15efd1d937 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -14,19 +14,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 96aec05a743..aecbda603cb 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index d15054d6291..194acd76a43 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index d6ac2177926..8e8b948cac2 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java index d2ece0d81f9..4f3be6ed225 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -72,9 +75,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -83,7 +85,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index a280a3f6cdc..824974fe614 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -70,9 +73,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -81,7 +83,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -103,7 +104,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index a064557cd58..57505b24226 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java index fc4ab35c4fa..b8976cec9e3 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 9a1f6caceff..1ad2fc260c0 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java index 250c280e8b1..96a6580d410 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index 24a57ea3f81..45154ca12c1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java index 2b17053e1e6..fce7506b032 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java index e1f27783a59..20460312997 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 05f26186f9a..5ff01330527 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index e8101183905..5c758075628 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index 6dc082079cf..21a99583f0d 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 20672ddb0ff..f29a046fa29 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java index 05ee5b5aa9b..35dca542482 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 7e130932b58..77b8104b7a7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 0379f1c5c6e..e37ca010913 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -11,18 +11,23 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index f4b869294be..09dc39be6e8 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java index feba6551cdb..d23c0b96ca0 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index abbc1403bb6..0a91f59ff49 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,23 +12,27 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 513c6029234..1270afd57ba 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 8e712843796..8ced5f5e416 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 7685326df76..5dbced071c0 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 0c885910955..37f2d7b22f0 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java index 5551de4c543..d0980783d75 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index 4f9793f1e12..f52e43c1dd8 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java index 89be413bc21..83e683e3d6a 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index e365d6f2f39..50e684f86e5 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 41cfb97d1e6..cb8a02c1e18 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java index 9c5a7d4617d..db4c1ce0513 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -20,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -92,9 +95,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -112,10 +114,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -133,10 +133,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -162,10 +160,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -192,10 +188,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -213,9 +207,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -224,7 +217,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -251,7 +243,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f31a23539b9..6d313020ae9 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 36c8e903bf4..0dca87914af 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java index a6afe72ee64..5c803770a21 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 529910bf9e0..ac0dd3265f7 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -139,10 +133,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -151,7 +143,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -177,7 +168,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index 6f9abf43c41..b13b6e0d1d1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -163,10 +155,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -175,7 +165,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -202,7 +191,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java index 523bd496274..cd278220668 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 2eb5145f197..cd6bf2b1a1d 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7e8132190d6..81dcb1da85e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 14af6c29210..2bc50f00c65 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java index 1ac9ecd804c..b81393d39d3 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 68f9c4233e8..3f4a45e1f9f 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index dc4a8ace4c6..294576ae045 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,11 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -21,7 +24,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -136,7 +141,7 @@ public interface PetApi { ) default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -191,7 +196,7 @@ public interface PetApi { ) default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java index 1485b58cb3e..57cbf21bde7 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java index 3a8489c4176..a1f02f844bf 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java index 85e90691158..8efc6418c2e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java index fbf95bc7502..682e77202d1 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java @@ -20,8 +20,9 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) @EnableWebMvc diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java index 01abb13330d..8e9d7af8244 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebApplication.java @@ -1,8 +1,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { @Override diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java index 1fa5ce119f8..691a5378ca4 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java @@ -2,8 +2,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java index db4f29350de..1dc5fc69c61 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -15,18 +15,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @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"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 729ef7defa5..d330c28e679 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -18,12 +18,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7e8132190d6..81dcb1da85e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 71ffda67b0c..f63a9141189 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index 1ac9ecd804c..b81393d39d3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 68f9c4233e8..3f4a45e1f9f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index e969bf66765..90ce18382be 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java index 1485b58cb3e..57cbf21bde7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java index 3a8489c4176..a1f02f844bf 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java index 85e90691158..8efc6418c2e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java index fbf95bc7502..682e77202d1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java @@ -20,8 +20,9 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Configuration @ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"}) @EnableWebMvc diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java index 01abb13330d..8e9d7af8244 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebApplication.java @@ -1,8 +1,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { @Override diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java index 1fa5ce119f8..691a5378ca4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java @@ -2,8 +2,9 @@ package org.openapitools.configuration; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import javax.annotation.Generated; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class WebMvcConfiguration extends WebMvcConfigurationSupport { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 6de38b1147e..f72d9b894ce 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -35,9 +38,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -46,7 +48,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index cacb0750801..17d2e07868b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -36,9 +39,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -47,7 +49,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 84aa067c80d..5a89a239c7b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -35,9 +38,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -46,7 +48,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index afbcf499d33..e1c617b3a62 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,14 +17,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -83,9 +86,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -111,10 +113,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -140,9 +140,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -168,9 +167,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -196,10 +194,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -225,10 +221,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -254,10 +248,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -283,10 +275,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -304,9 +294,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -324,9 +313,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -344,9 +332,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -355,7 +342,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -387,7 +373,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index acc58a56a36..dc95c5c9454 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -35,9 +38,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -46,7 +48,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index be84ad677c5..7325cfa7dd1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -36,9 +39,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -47,7 +49,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index c9e823070d8..7e8cab02467 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -35,9 +38,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -46,7 +48,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c62dc11f2ed..d14290a194c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -35,9 +38,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -46,7 +48,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java index 14f74376631..aded2bae8cb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Animal.java @@ -15,21 +15,23 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) -@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") -@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -45,10 +47,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -66,9 +66,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -77,7 +76,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -100,7 +98,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 61c61fc9199..f733f6d05d5 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -45,10 +48,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -57,7 +58,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -79,7 +79,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 3ad7d2361f7..948967dfb0e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -45,10 +48,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -57,7 +58,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -79,7 +79,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java index 4bfc2cfbb4d..e9c533969a9 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -53,9 +56,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -81,10 +83,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,10 +110,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -122,7 +120,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -146,7 +143,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java index ada0edb12a9..832369e9ff4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -76,9 +79,8 @@ public enum KindEnum { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -87,7 +89,6 @@ public enum KindEnum { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java index 461ed180406..d52a06bb429 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,14 +14,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -74,9 +77,8 @@ public enum KindEnum { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -85,7 +87,6 @@ public enum KindEnum { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -107,7 +108,6 @@ public enum KindEnum { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java index 437e279449e..63572bf8e8e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -48,9 +51,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -68,9 +70,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -88,9 +89,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -108,9 +108,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -128,9 +127,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -148,9 +146,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -159,7 +156,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -186,7 +182,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java index 12ca73636c6..108e5c8b30a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -35,9 +38,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -46,7 +48,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java index bb4667b4e2c..08432295c3d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +67,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java index 84099ff8042..1497947c1e7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -36,9 +39,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -56,10 +58,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -68,7 +68,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -91,7 +90,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java index f74c32f05c7..359d871aa11 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java @@ -13,15 +13,18 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@ApiModel(description = "Model for testing model with \"_class\" property") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -34,9 +37,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -45,7 +47,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -67,7 +68,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java index 55fa62058c1..a7b07bf268c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -33,9 +36,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -44,7 +46,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +67,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java index 93c91767410..800b5daa10c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -35,9 +38,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -46,7 +48,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java index 025e4d7759b..ce03d365868 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +67,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java index 30fe225638e..816494968a4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -112,9 +115,8 @@ public enum ArrayEnumEnum { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -140,9 +142,8 @@ public enum ArrayEnumEnum { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -151,7 +152,6 @@ public enum ArrayEnumEnum { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +174,6 @@ public enum ArrayEnumEnum { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java index 2d83af41c8e..acf588be02c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; * Gets or Sets EnumClass */ @com.fasterxml.jackson.annotation.JsonFormat + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index 33ea4eacb0f..747b908c75f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -15,14 +15,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -195,9 +198,8 @@ public enum EnumNumberEnum { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -215,10 +217,8 @@ public enum EnumNumberEnum { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -236,9 +236,8 @@ public enum EnumNumberEnum { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -256,9 +255,8 @@ public enum EnumNumberEnum { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -276,10 +274,8 @@ public enum EnumNumberEnum { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -288,7 +284,6 @@ public enum EnumNumberEnum { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -314,7 +309,6 @@ public enum EnumNumberEnum { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java index f483d840515..f0763ba3be8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/File.java @@ -13,15 +13,18 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@ApiModel(description = "Must be named `File` for test.") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -34,9 +37,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -45,7 +47,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -67,7 +68,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 89db3e7f802..c85e7c28fb9 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -40,10 +43,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -69,10 +70,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -81,7 +80,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +102,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java index 86d421a9d88..0964a16e87c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,14 +20,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -51,14 +56,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -81,9 +86,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -103,9 +107,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -123,9 +126,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -145,11 +147,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -169,9 +168,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -191,9 +189,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -211,9 +208,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -231,10 +227,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -243,7 +237,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -252,15 +246,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -273,11 +265,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -295,10 +284,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -316,10 +303,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -337,10 +322,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -358,10 +341,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -370,7 +351,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -405,7 +385,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 97d1a64a22d..94d26e27248 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -36,9 +39,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -56,9 +58,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -67,7 +68,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -90,7 +90,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java index 726c8b5fcf0..a67a2f842a8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java @@ -17,14 +17,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -94,10 +97,8 @@ public enum InnerEnum { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -123,9 +124,8 @@ public enum InnerEnum { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -151,9 +151,8 @@ public enum InnerEnum { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -179,9 +178,8 @@ public enum InnerEnum { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -190,7 +188,6 @@ public enum InnerEnum { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -215,7 +212,6 @@ public enum InnerEnum { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index b20b2dec727..09ac3cd1254 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,19 +20,22 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -47,10 +51,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -68,10 +70,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -97,10 +97,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -109,7 +107,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -133,7 +130,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java index f74c29e604c..df2b0df0924 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java @@ -13,15 +13,18 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@ApiModel(description = "Model for testing model name starting with number") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -37,9 +40,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -57,9 +59,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -68,7 +69,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -91,7 +91,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java index 01d035fa32d..607b3d9db62 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -39,9 +42,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -59,9 +61,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -79,9 +80,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -90,7 +90,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +113,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java index e9926c42798..2ba4741b661 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelList.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -33,9 +36,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -44,7 +46,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +67,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java index d17a0da84c8..0eb9f005974 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,15 +13,18 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@ApiModel(description = "Model for testing reserved words") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -34,9 +37,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -45,7 +47,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -67,7 +68,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java index c5882dc983a..9afeb6c3d0a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java @@ -13,15 +13,18 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@ApiModel(description = "Model for testing model name same as property name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -43,10 +46,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -64,9 +65,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -84,9 +84,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -104,9 +103,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -115,7 +113,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -140,7 +137,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java index fc212048b08..e78ca1fb663 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,14 +14,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -34,10 +37,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -46,7 +47,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -68,7 +68,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java index ede10667c9d..05b93a9c0c7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -33,7 +37,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -89,9 +93,8 @@ public enum StatusEnum { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -109,9 +112,8 @@ public enum StatusEnum { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -129,9 +131,8 @@ public enum StatusEnum { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -149,10 +150,8 @@ public enum StatusEnum { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -170,9 +169,8 @@ public enum StatusEnum { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -190,9 +188,8 @@ public enum StatusEnum { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -201,7 +198,6 @@ public enum StatusEnum { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -228,7 +224,6 @@ public enum StatusEnum { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java index 0e0d3dc1c39..6b6318d1e2c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,14 +14,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -40,10 +43,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -61,9 +62,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -81,9 +81,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -92,7 +91,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -116,7 +114,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java index e293d46d7b4..1adaf1da0cd 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -18,6 +19,8 @@ import com.fasterxml.jackson.annotation.JsonValue; * Gets or Sets OuterEnum */ @com.fasterxml.jackson.annotation.JsonFormat + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java index 7f2bff42e91..07fb58bfa1f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java @@ -21,14 +21,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -96,9 +99,8 @@ public enum StatusEnum { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -116,10 +118,8 @@ public enum StatusEnum { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -137,10 +137,8 @@ public enum StatusEnum { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -163,10 +161,8 @@ public enum StatusEnum { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -193,10 +189,8 @@ public enum StatusEnum { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -214,9 +208,8 @@ public enum StatusEnum { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -225,7 +218,6 @@ public enum StatusEnum { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -252,7 +244,6 @@ public enum StatusEnum { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 1ddffebe8f5..f54ba1923dc 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -36,9 +39,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -56,9 +58,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -67,7 +68,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -90,7 +90,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java index 32a7f5a8851..240ccd25647 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -33,9 +36,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -44,7 +46,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +67,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java index 96053497912..ddc332d3870 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -36,9 +39,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -56,9 +58,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -67,7 +68,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -90,7 +90,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java index 91863ff730f..42fd3375bfd 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -49,10 +52,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -113,10 +109,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -139,10 +133,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -151,7 +143,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -177,7 +168,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java index 9d2b6059352..48b53ae02b8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -52,10 +55,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -73,11 +74,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -95,10 +93,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -116,10 +112,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -137,10 +131,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -163,10 +155,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -175,7 +165,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -202,7 +191,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java index 3fa19e61270..f889aba17b7 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java @@ -13,14 +13,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -54,9 +57,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -74,9 +76,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -94,9 +95,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -114,9 +114,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -134,9 +133,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -154,9 +152,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -174,9 +171,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -194,9 +190,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -205,7 +200,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -234,7 +228,6 @@ public class User { 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"); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java index 5d477653f0c..699a0dc8500 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java @@ -16,14 +16,17 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") +@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name") @com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -129,9 +132,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -149,10 +151,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -170,9 +170,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -190,9 +189,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -218,9 +216,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -238,9 +235,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -258,10 +254,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -279,9 +273,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -299,9 +292,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -327,9 +319,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -355,9 +346,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -375,9 +365,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -395,10 +384,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -416,9 +403,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -436,9 +422,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -464,9 +449,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -492,9 +476,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -512,9 +495,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -532,10 +514,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -553,9 +533,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -573,9 +552,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -601,9 +579,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -629,9 +606,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -649,9 +625,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -669,10 +644,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -690,9 +663,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -710,9 +682,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -738,9 +709,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -766,9 +736,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -777,7 +746,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -827,7 +795,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4da37da2c..5a4e5b8c884 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index e8f022846bf..c9ae29ba1fe 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -20,14 +21,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index ce2e0775f78..b14b9f6feca 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -25,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -295,8 +299,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 76034668bf3..aa5e668384e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -29,14 +32,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } @@ -209,8 +214,8 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f482b6bf5ac..ccd8d276dc6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index b705c60d83b..e1119b1010d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -20,14 +21,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index f0ab551e4d9..c32bead4406 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; @@ -18,7 +19,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index f5625cea3f9..ba115c2cd0a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -22,14 +24,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index cb72ccb357f..5dce0416efb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -17,7 +17,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 203faf80f73..d25fe52ea15 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -21,14 +22,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 3f8d7b71b28..07fe60cce88 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -18,7 +18,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 224d437db48..af6939bbb16 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -22,14 +23,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 66ec6689678..3792eec6748 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index aeb477e916f..7bbca47bb99 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4631883198a..386a47d6460 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 8b8eaffbe71..47118d90ba4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -79,9 +82,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -107,10 +109,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -136,9 +136,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -164,9 +163,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -192,10 +190,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -221,10 +217,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -250,10 +244,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -279,10 +271,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -300,9 +290,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -320,9 +309,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -340,9 +328,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -351,7 +338,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -383,7 +369,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 30654d0bec8..995edc19323 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 1a2c2a018f1..114425f840c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 4f14fb1747d..c655acde2d4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 3cbd66fa930..62824a37251 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -31,9 +34,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -42,7 +44,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java index 65534bbd4e3..188d2098d77 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java @@ -13,19 +13,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -41,10 +43,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -62,9 +62,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -73,7 +72,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -96,7 +94,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 6366e913a32..0b434e5d80d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -41,10 +44,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -53,7 +54,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -75,7 +75,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 373e9f19c38..704b68432d7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -41,10 +44,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -53,7 +54,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -75,7 +75,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 209d51c584d..5ca8ee5b7d8 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -49,9 +52,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -77,10 +79,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -106,10 +106,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -118,7 +116,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -142,7 +139,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java index f0fa16873cb..56f1dd720fd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java index a296dfc5819..1c40cb56ac2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -69,9 +72,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -80,7 +82,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +103,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java index 638fd85562a..6bad3f78e73 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -44,9 +47,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -64,9 +66,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -84,9 +85,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -104,9 +104,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -124,9 +123,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -144,9 +142,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -155,7 +152,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -182,7 +178,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java index f1a6ba0ecd8..bd2f9fc3ca0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java index 166fdfaf7c8..f47941a937a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -29,9 +32,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -40,7 +42,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java index 3ca43362428..49c5f68bebd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -32,9 +35,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -52,10 +54,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -64,7 +64,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +86,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java index 314cec6e205..f5363eb06dc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java @@ -11,13 +11,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -30,9 +33,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -41,7 +43,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java index 1853eeff5f0..fd5095aade6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -29,9 +32,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -40,7 +42,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java index e1d49d61348..df2817a964b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java index 0249347555d..25131d8dc35 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -29,9 +32,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -40,7 +42,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 2c22712b9ce..27bbf28c2b3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -106,9 +109,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -134,9 +136,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -145,7 +146,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -168,7 +168,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java index 344a5cc7f8d..1e8800e0b67 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java @@ -8,6 +8,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -15,6 +16,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java index 47feac7def2..45037721559 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -187,9 +190,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -207,10 +209,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -228,9 +228,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -248,9 +247,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -268,10 +266,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -280,7 +276,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -306,7 +301,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java index cbbbf5213c1..f0a6777289c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java @@ -11,13 +11,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -30,9 +33,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -41,7 +43,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b9090cdc97..ecb3820b0cf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -36,10 +39,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -65,10 +66,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -77,7 +76,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -100,7 +98,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index d7d44db402c..063aed84e30 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; @@ -16,12 +18,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -47,14 +52,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -77,9 +82,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -99,9 +103,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -119,9 +122,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -141,11 +143,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -165,9 +164,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -187,9 +185,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -207,9 +204,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -227,10 +223,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -239,7 +233,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -248,15 +242,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -269,11 +261,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -291,10 +280,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -312,10 +299,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -333,10 +318,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -354,10 +337,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -366,7 +347,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -401,7 +381,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 055eaea6221..a6100dec7e6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -32,9 +35,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -52,9 +54,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -63,7 +64,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -86,7 +86,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 777ec8f061f..53e126c34fe 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -89,10 +92,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -118,9 +119,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -146,9 +146,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -174,9 +173,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -185,7 +183,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -210,7 +207,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 31f0e9691e4..68e45376819 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -11,23 +11,27 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -43,10 +47,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -64,10 +66,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -93,10 +93,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -105,7 +103,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -129,7 +126,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index a523a095a0d..ff5f1cbfd76 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java @@ -11,13 +11,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -33,9 +36,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -53,9 +55,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -64,7 +65,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index e2c8aca9fcc..61fd70ab599 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -35,9 +38,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -55,9 +57,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -75,9 +76,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -86,7 +86,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -110,7 +109,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 5fbabcc7122..029b4bf191e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -29,9 +32,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -40,7 +42,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 2887e82ae24..6e7190a8bb6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java @@ -11,13 +11,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -30,9 +33,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -41,7 +43,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index e90e446667d..ac665b62dd9 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java @@ -11,13 +11,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -39,10 +42,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -60,9 +61,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -80,9 +80,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -100,9 +99,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -111,7 +109,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -136,7 +133,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index e7453ce9262..ce78534bcf7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -30,10 +33,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -42,7 +43,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +64,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index d90339edc7e..a9627499bf7 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java @@ -7,18 +7,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -29,7 +33,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -84,9 +88,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -104,9 +107,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -124,9 +126,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -144,10 +145,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -165,9 +164,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -185,9 +183,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -196,7 +193,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -223,7 +219,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 44d5a9dc16d..2300973669e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -36,10 +39,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -57,9 +58,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -77,9 +77,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -88,7 +87,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +110,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 214947f375c..874cedf63cf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java @@ -8,6 +8,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -15,6 +16,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 7c8eeae0204..90683df8d08 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -19,12 +19,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -91,9 +94,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -111,10 +113,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -132,10 +132,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -161,10 +159,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -191,10 +187,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -212,9 +206,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -223,7 +216,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -250,7 +242,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index af3367a7ffc..a374f2899ff 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -32,9 +35,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -52,9 +54,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -63,7 +64,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -86,7 +86,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 6cde569d9c0..d9c67e23a77 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -29,9 +32,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -40,7 +42,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -62,7 +63,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index 219b5ef9b87..e24b0968e5c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -32,9 +35,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -52,9 +54,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -63,7 +64,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -86,7 +86,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 5ddbf1ebca1..922da4c45a3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -45,10 +48,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -66,11 +67,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -88,10 +86,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -109,10 +105,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -138,10 +132,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -150,7 +142,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -176,7 +167,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index ad778640909..c090002fead 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -48,10 +51,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -69,11 +70,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -91,10 +89,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -112,10 +108,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -133,10 +127,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -162,10 +154,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -174,7 +164,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -201,7 +190,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index 6e56bc32a2e..f2b4ed4a98e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java @@ -11,12 +11,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -50,9 +53,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -70,9 +72,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -90,9 +91,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -110,9 +110,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -130,9 +129,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -150,9 +148,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -170,9 +167,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -190,9 +186,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -201,7 +196,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -230,7 +224,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 621f973ebae..c9267532f45 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -125,9 +128,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -145,10 +147,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -166,9 +166,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -186,9 +185,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -214,9 +212,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -234,9 +231,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -254,10 +250,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -275,9 +269,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -295,9 +288,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -323,9 +315,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -351,9 +342,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -371,9 +361,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -391,10 +380,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -412,9 +399,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -432,9 +418,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -460,9 +445,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -488,9 +472,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -508,9 +491,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -528,10 +510,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -549,9 +529,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -569,9 +548,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -597,9 +575,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -625,9 +602,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -645,9 +621,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -665,10 +640,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -686,9 +659,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -706,9 +678,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -734,9 +705,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -762,9 +732,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -773,7 +742,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -823,7 +791,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 71ffda67b0c..f63a9141189 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index e969bf66765..90ce18382be 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index ff5677cd8c3..25aa61f48d6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index df11134c806..f57c395c28a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index a86542ddf22..2d5e24bcd5f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 52267c03910..960fdd4fbb2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -25,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -315,8 +319,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java index 6b22c1aba66..501419787ef 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index d3a949e65d8..3796fc00ce5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -19,12 +21,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f76698310b4..a1b0656bc43 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 58497641e4c..0e301ab5f9b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index ed5a6bfc09a..fb689b13f94 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index c62662ff8c9..289e898a683 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; @@ -18,7 +19,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java index 5fa088c6f10..03b76f0b64b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index e3adc7d4bca..9c616c14aaa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -12,12 +13,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 39f4c0b7c7e..0f4dda3730f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -17,7 +17,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java index 9e08c646ae9..8209043ac02 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index dfe4bb31496..e9b7146b52a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -11,12 +11,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index b45b075f924..e7aa6f28b61 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -18,7 +18,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java index bc2d33598fd..82725d16025 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index 2efbd71c9dc..c39231c6b29 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -12,12 +12,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index ff5677cd8c3..25aa61f48d6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index df11134c806..f57c395c28a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index a86542ddf22..2d5e24bcd5f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 52267c03910..960fdd4fbb2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -25,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -315,8 +319,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 6b22c1aba66..501419787ef 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index d3a949e65d8..3796fc00ce5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -19,12 +21,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f76698310b4..a1b0656bc43 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 58497641e4c..0e301ab5f9b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index ed5a6bfc09a..fb689b13f94 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index c62662ff8c9..289e898a683 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; @@ -18,7 +19,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 5fa088c6f10..03b76f0b64b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index e3adc7d4bca..9c616c14aaa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -12,12 +13,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 39f4c0b7c7e..0f4dda3730f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -17,7 +17,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 9e08c646ae9..8209043ac02 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index dfe4bb31496..e9b7146b52a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -11,12 +11,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index b45b075f924..e7aa6f28b61 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -18,7 +18,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index bc2d33598fd..82725d16025 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index 2efbd71c9dc..c39231c6b29 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -12,12 +12,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 08fad3c33bf..f32b3ca03b6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 940a7484519..037a13dee30 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -363,8 +367,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 902ff4d6600..b52a218dd3e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 9ea20fa7979..19270de6e6e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 60aaea2af9a..565feb9ad1c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 47da1e2faf2..fa813d7e946 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3fb97da7def..0f78f294433 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index df11134c806..f57c395c28a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2ef11c811c1..575a4e23910 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -14,12 +14,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index c01306b7fd4..5471ba1820d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -327,8 +331,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Flux binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index 6b22c1aba66..501419787ef 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index dbe78fa1c7f..0193067433b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -23,12 +25,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4d2d37f1a59..6a78bd00fe9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 58497641e4c..0e301ab5f9b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 4127d96d9e3..bd1f7f3542f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -14,12 +14,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 877603ff009..4277d5fc01b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; @@ -22,7 +23,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 5fa088c6f10..03b76f0b64b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 8dc1be776ea..b4c51ede918 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -2,6 +2,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -16,12 +17,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 1b8cd862203..6d31ec91832 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 9e08c646ae9..8209043ac02 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 02daadf024a..d4f1e2efbf9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -15,12 +15,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 60a2f999e4b..923cedcc646 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index bc2d33598fd..82725d16025 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 3985dd30ecd..063cd6d0ee8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -16,12 +16,13 @@ import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4da37da2c..5a4e5b8c884 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index f1ca88a6a5e..26b35dd8398 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -13,20 +13,23 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 17244270c85..0e0027d4bc3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -6,12 +6,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 1030dcc870c..df8e2292377 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -25,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -295,8 +299,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 76cc2bb9575..78cddbd6dd5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -22,20 +24,23 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = delegate; } @@ -185,8 +190,8 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index e88b7aa6ca5..717b8a75310 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.ResponseEntity; @@ -15,12 +17,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f482b6bf5ac..ccd8d276dc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 65de19a78d3..498a7ee2e45 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -13,20 +13,23 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 31b94ac1095..414a09aed4e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -6,12 +6,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index c8b2da14ebf..9cf42e2e281 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,11 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -17,7 +20,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -122,7 +127,7 @@ public interface PetApi { ) ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ); @@ -160,7 +165,7 @@ public interface PetApi { ) ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 5583546f3e5..18e06dce43d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -1,7 +1,10 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -14,20 +17,23 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = delegate; } @@ -72,7 +78,7 @@ public class PetApiController implements PetApi { */ public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final Pageable pageable + @ApiIgnore final Pageable pageable ) { return delegate.findPetsByStatus(status, pageable); } @@ -89,7 +95,7 @@ public class PetApiController implements PetApi { */ public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final Pageable pageable + @ApiIgnore final Pageable pageable ) { return delegate.findPetsByTags(tags, pageable); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 94d3c58d332..2537ce30da0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -1,18 +1,22 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { /** @@ -46,7 +50,7 @@ public interface PetApiDelegate { * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - ResponseEntity> findPetsByStatus(List status, final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByStatus(List status, final Pageable pageable); /** * GET /pet/findByTags : Finds Pets by tags @@ -58,7 +62,7 @@ public interface PetApiDelegate { * @deprecated * @see PetApi#findPetsByTags */ - ResponseEntity> findPetsByTags(List tags, final org.springframework.data.domain.Pageable pageable); + ResponseEntity> findPetsByTags(List tags, final Pageable pageable); /** * GET /pet/{petId} : Find pet by ID diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index cb72ccb357f..5dce0416efb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -17,7 +17,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 3becdad6f4a..9cc8ee421f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -14,20 +14,23 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index a6ad2c60995..5d4bde80620 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -7,12 +7,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 3f8d7b71b28..07fe60cce88 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -18,7 +18,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index a9721c9a469..777032bef5d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -15,20 +15,23 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = delegate; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index f41ca92fd59..f1d806c05fd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -8,12 +8,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { /** diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 46281c6456d..2874aee40b5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 474278b1b19..303eb0c55db 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index c670f89cdfc..1cac5fc9adc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 9f89c16c1bc..167352b3656 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5ef4af43bbd..faeaecb95cd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 95a74229727..522c7e8dda0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 9969c2fe720..617d4fb867f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 757c0a536fd..74e04286771 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index 22249d7cc27..4bdbbcad59d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -14,18 +14,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @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"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -41,10 +43,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -62,9 +62,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -73,7 +72,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -96,7 +94,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 995bebadda8..622be10459e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 922dc7a5666..b0eb6b00dd7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 6937756d45c..8f34930a5e8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 19ab1f8baff..60748a7366a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java index ebf9c7cec80..9fd111c8430 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index 257322699ab..8e08090e24a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index 3c2a6be2b25..06d98844c50 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java index 4d88c1e45a8..2bffe7eecb0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java index bb63f835363..9bc13add64a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java index 21a27eb4e45..daf01294455 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 09bb08f9458..6792f7900e9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 14bf9e2c281..aacc863a201 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java index ed676c3662e..233a854ff58 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 3a9a9e85a8c..cf2427d7be1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java index 2042a57883e..baed9c12618 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b71b91db26b..1d839540169 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 7f83ebda6cb..d44579f78f9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; @@ -17,12 +19,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index a712d19243f..001a3cea286 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index a4f10eadf35..d9bc6491e74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index b6607ec1de2..a3e6d4338bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -18,17 +19,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 8e51dc7b0bf..a308820b4be 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 1c50e0984df..a932355454b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java index f0fbf712e6b..55133349d68 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index f71f60f5970..2c67234126d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index 8336bed2c94..96cadd49736 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 87c0551edfc..4ed41292ec0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index c03246a0acb..6c5cc6ed8b2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -14,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 34098a524fc..2fa1e8576af 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 33f64f0954e..542939a2a63 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index 8e56b7045ab..1a4e757a147 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -89,9 +92,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -109,10 +111,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -130,10 +130,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -156,10 +154,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -185,10 +181,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -206,9 +200,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -217,7 +210,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -244,7 +236,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 655154d2cf2..5cf483cb584 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index beddd922ad4..6f360adf416 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java index c7dba2565ee..0131b8854d8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 9dbb6eeeb09..66adede6dd1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 998c11fb323..b03cc5c37ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java index ac48b7bd3ac..f443caa28bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index fa83623c4bf..4c6f7d42bd9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index ff5677cd8c3..25aa61f48d6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java index df11134c806..f57c395c28a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final AnotherFakeApiDelegate delegate; - public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { + public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index a86542ddf22..2d5e24bcd5f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link AnotherFakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface AnotherFakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 0abbadcd381..7dee6868f6e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -25,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -315,8 +319,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java index 6b22c1aba66..501419787ef 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final FakeApiDelegate delegate; - public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { + public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java index de03df40267..b8e9dd88d45 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import org.springframework.http.HttpStatus; @@ -19,12 +21,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f76698310b4..a1b0656bc43 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 58497641e4c..0e301ab5f9b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final FakeClassnameTestApiDelegate delegate; - public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { + public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index ed5a6bfc09a..fb689b13f94 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -10,12 +10,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link FakeClassnameTestApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface FakeClassnameTestApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index ad5e552b083..84d8d7bb47b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,11 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -17,7 +20,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -130,7 +135,7 @@ public interface PetApi { ) default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ) { return getDelegate().findPetsByStatus(status, pageable); } @@ -170,7 +175,7 @@ public interface PetApi { ) default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ) { return getDelegate().findPetsByTags(tags, pageable); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java index 5fa088c6f10..03b76f0b64b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final PetApiDelegate delegate; - public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { + public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java index 02d3eee8e53..2fa88df6b0c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -1,7 +1,10 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -11,12 +14,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link PetApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface PetApiDelegate { default Optional getRequest() { @@ -60,7 +64,7 @@ public interface PetApiDelegate { * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status, final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByStatus(List status, final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -89,7 +93,7 @@ public interface PetApiDelegate { * @deprecated * @see PetApi#findPetsByTags */ - default ResponseEntity> findPetsByTags(List tags, final org.springframework.data.domain.Pageable pageable) { + default ResponseEntity> findPetsByTags(List tags, final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 39f4c0b7c7e..0f4dda3730f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -17,7 +17,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java index 9e08c646ae9..8209043ac02 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final StoreApiDelegate delegate; - public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { + public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java index dfe4bb31496..e9b7146b52a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -11,12 +11,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link StoreApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface StoreApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index b45b075f924..e7aa6f28b61 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -18,7 +18,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java index bc2d33598fd..82725d16025 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java @@ -2,15 +2,18 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final UserApiDelegate delegate; - public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { + public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java index 2efbd71c9dc..c39231c6b29 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -12,12 +12,13 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.annotation.Generated; /** * A delegate to be called by the {@link UserApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface UserApiDelegate { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index db4f29350de..1dc5fc69c61 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java @@ -15,18 +15,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @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"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index 729ef7defa5..d330c28e679 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -18,12 +18,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4da37da2c..5a4e5b8c884 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index e8f022846bf..c9ae29ba1fe 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -20,14 +21,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 1030dcc870c..df8e2292377 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -25,7 +27,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -295,8 +299,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 9a5306056e8..e0f6cf75c83 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,12 +2,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import org.threeten.bp.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -29,14 +32,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } @@ -209,8 +214,8 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f482b6bf5ac..ccd8d276dc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -16,7 +16,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index b705c60d83b..e1119b1010d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -20,14 +21,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index c8b2da14ebf..9cf42e2e281 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,11 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -17,7 +20,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -122,7 +127,7 @@ public interface PetApi { ) ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ); @@ -160,7 +165,7 @@ public interface PetApi { ) ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 32b8031cf83..139d599af04 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -1,7 +1,10 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -14,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -21,14 +25,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } @@ -76,7 +82,7 @@ public class PetApiController implements PetApi { */ public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final Pageable pageable + @ApiIgnore final Pageable pageable ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -106,7 +112,7 @@ public class PetApiController implements PetApi { */ public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final Pageable pageable + @ApiIgnore final Pageable pageable ) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index cb72ccb357f..5dce0416efb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -17,7 +17,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 203faf80f73..d25fe52ea15 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -21,14 +22,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 3f8d7b71b28..07fe60cce88 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -18,7 +18,9 @@ import javax.validation.Valid; import javax.validation.constraints.*; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 224d437db48..af6939bbb16 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -22,14 +23,16 @@ import javax.validation.constraints.*; import javax.validation.Valid; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 46281c6456d..2874aee40b5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 474278b1b19..303eb0c55db 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index c670f89cdfc..1cac5fc9adc 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 9f89c16c1bc..167352b3656 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -80,9 +83,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -108,10 +110,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -137,9 +137,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -165,9 +164,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -193,10 +191,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -222,10 +218,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -251,10 +245,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -280,10 +272,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -301,9 +291,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -321,9 +310,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -341,9 +329,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -352,7 +339,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -384,7 +370,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5ef4af43bbd..faeaecb95cd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 95a74229727..522c7e8dda0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 9969c2fe720..617d4fb867f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 757c0a536fd..74e04286771 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -32,9 +35,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -43,7 +45,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index 22249d7cc27..4bdbbcad59d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java @@ -14,18 +14,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @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"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -41,10 +43,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -62,9 +62,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -73,7 +72,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -96,7 +94,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 995bebadda8..622be10459e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 922dc7a5666..b0eb6b00dd7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -42,10 +45,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -54,7 +55,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -76,7 +76,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 6937756d45c..8f34930a5e8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -50,9 +53,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -78,10 +80,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -107,10 +107,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -119,7 +117,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -143,7 +140,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 19ab1f8baff..60748a7366a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -45,9 +48,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -65,9 +67,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -85,9 +86,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -105,9 +105,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -125,9 +124,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -145,9 +143,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -156,7 +153,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -183,7 +179,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java index ebf9c7cec80..9fd111c8430 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -32,9 +35,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -43,7 +45,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java index 257322699ab..8e08090e24a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -30,9 +33,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -41,7 +43,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index 3c2a6be2b25..06d98844c50 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -53,10 +55,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -65,7 +65,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +87,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java index 4d88c1e45a8..2bffe7eecb0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -31,9 +34,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -42,7 +44,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java index bb63f835363..9bc13add64a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -30,9 +33,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -41,7 +43,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java index 21a27eb4e45..daf01294455 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -32,9 +35,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -43,7 +45,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java index 09bb08f9458..6792f7900e9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -30,9 +33,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -41,7 +43,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 14bf9e2c281..aacc863a201 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -107,9 +110,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -135,9 +137,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -146,7 +147,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -169,7 +169,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java index ed676c3662e..233a854ff58 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 3a9a9e85a8c..cf2427d7be1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -188,9 +191,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -208,10 +210,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -229,9 +229,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -249,9 +248,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -269,10 +267,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -281,7 +277,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -307,7 +302,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java index 2042a57883e..baed9c12618 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -31,9 +34,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -42,7 +44,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b71b91db26b..1d839540169 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -37,10 +40,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -66,10 +67,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -78,7 +77,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -101,7 +99,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 7f83ebda6cb..d44579f78f9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; @@ -17,12 +19,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -48,14 +53,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -78,9 +83,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -100,9 +104,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -120,9 +123,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -142,11 +144,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -166,9 +165,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -188,9 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -208,9 +205,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -228,10 +224,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -240,7 +234,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -249,15 +243,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -270,11 +262,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -292,10 +281,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -313,10 +300,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -334,10 +319,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -355,10 +338,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -367,7 +348,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -402,7 +382,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index a712d19243f..001a3cea286 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -64,7 +65,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index a4f10eadf35..d9bc6491e74 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -90,10 +93,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -119,9 +120,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -147,9 +147,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -175,9 +174,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -186,7 +184,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -211,7 +208,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index b6607ec1de2..a3e6d4338bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -18,17 +19,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -44,10 +48,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -65,10 +67,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -94,10 +94,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -106,7 +104,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -130,7 +127,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index 8e51dc7b0bf..a308820b4be 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -34,9 +37,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -54,9 +56,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -65,7 +66,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 1c50e0984df..a932355454b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -36,9 +39,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -56,9 +58,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -76,9 +77,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -87,7 +87,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -111,7 +110,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java index f0fbf712e6b..55133349d68 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -30,9 +33,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -41,7 +43,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index f71f60f5970..2c67234126d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -31,9 +34,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -42,7 +44,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index 8336bed2c94..96cadd49736 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java @@ -12,13 +12,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -40,10 +43,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -61,9 +62,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -81,9 +81,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -101,9 +100,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -112,7 +110,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -137,7 +134,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 87c0551edfc..4ed41292ec0 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -31,10 +34,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -43,7 +44,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +65,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index c03246a0acb..6c5cc6ed8b2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; import org.threeten.bp.OffsetDateTime; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -14,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -30,7 +34,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -85,9 +89,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -105,9 +108,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -125,9 +127,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -145,10 +146,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -166,9 +165,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -186,9 +184,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -197,7 +194,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -224,7 +220,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 34098a524fc..2fa1e8576af 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -37,10 +40,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -58,9 +59,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -78,9 +78,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -89,7 +88,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -113,7 +111,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 33f64f0954e..542939a2a63 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -16,6 +17,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index 8e56b7045ab..1a4e757a147 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -89,9 +92,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -109,10 +111,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -130,10 +130,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -156,10 +154,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -185,10 +181,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -206,9 +200,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -217,7 +210,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -244,7 +236,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 655154d2cf2..5cf483cb584 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -33,9 +36,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -53,9 +55,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -64,7 +65,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index beddd922ad4..6f360adf416 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -30,9 +33,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -41,7 +43,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -63,7 +64,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java index c7dba2565ee..0131b8854d8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -33,9 +36,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -53,9 +55,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -64,7 +65,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -87,7 +87,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 9dbb6eeeb09..66adede6dd1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -46,10 +49,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -67,11 +68,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -89,10 +87,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -110,10 +106,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -136,10 +130,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -148,7 +140,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -174,7 +165,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 998c11fb323..b03cc5c37ec 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -49,10 +52,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -70,11 +71,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -92,10 +90,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -113,10 +109,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -134,10 +128,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -160,10 +152,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -172,7 +162,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -199,7 +188,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java index ac48b7bd3ac..f443caa28bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -51,9 +54,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -71,9 +73,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -91,9 +92,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -111,9 +111,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -131,9 +130,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -151,9 +149,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -171,9 +168,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -191,9 +187,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -202,7 +197,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -231,7 +225,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index fa83623c4bf..4c6f7d42bd9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -126,9 +129,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -146,10 +148,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -167,9 +167,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -187,9 +186,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -215,9 +213,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -235,9 +232,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -255,10 +251,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -276,9 +270,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -296,9 +289,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -324,9 +316,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -352,9 +343,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -372,9 +362,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -392,10 +381,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -413,9 +400,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -433,9 +419,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -461,9 +446,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -489,9 +473,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -509,9 +492,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -529,10 +511,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -550,9 +530,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -570,9 +549,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -598,9 +576,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -626,9 +603,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -646,9 +622,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -666,10 +641,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -687,9 +660,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -707,9 +679,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -735,9 +706,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -763,9 +733,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -774,7 +743,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -824,7 +792,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 14af6c29210..2bc50f00c65 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index dc4a8ace4c6..294576ae045 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -5,8 +5,11 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -21,7 +24,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -136,7 +141,7 @@ public interface PetApi { ) default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -191,7 +196,7 @@ public interface PetApi { ) default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, - @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable + @ApiIgnore final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index db4f29350de..1dc5fc69c61 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java @@ -15,18 +15,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @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"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -42,10 +44,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -63,9 +63,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -74,7 +73,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -97,7 +95,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 729ef7defa5..d330c28e679 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -18,12 +18,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -90,9 +93,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -110,10 +112,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -131,10 +131,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -157,10 +155,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getPhotoUrls() { return photoUrls; } @@ -186,10 +182,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -207,9 +201,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -218,7 +211,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -245,7 +237,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 8a9cd128c46..b558d892cbb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index a5de2295a58..559dc219a4f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 6504bc555c2..244f5f910bd 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") @VirtualService diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java index 78ba74424cb..7245dbfc644 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.virtualan.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 8cfa7936f84..3c59680b33c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.virtualan.api; import java.math.BigDecimal; import org.openapitools.virtualan.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.virtualan.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.virtualan.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.virtualan.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.virtualan.model.User; import org.openapitools.virtualan.model.XmlItem; import io.swagger.annotations.*; @@ -31,7 +33,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") @VirtualService @@ -357,8 +361,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java index 4d76ead3667..ece740199a6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.virtualan.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 4eb9dd69cdd..4278ca71264 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @VirtualService diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java index a737205f48f..b49aa3047d7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.virtualan.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index cc2491e204f..ed063f0a8b7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.virtualan.api; import org.openapitools.virtualan.model.ModelApiResponse; import org.openapitools.virtualan.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import io.virtualan.annotation.ApiVirtual; @@ -24,7 +25,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") @VirtualService diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java index 0abcfc3c713..944d8536c30 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.virtualan.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 3a23f5a9125..2f5b01082fb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -23,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") @VirtualService diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java index 8302e160778..d7441d6c6e0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.virtualan.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 9d2430db562..3d8032a80bc 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -24,7 +24,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") @VirtualService diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java index 46bbd55b84f..676266d1702 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.virtualan.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java index 22fa90b899c..7a9d204bd40 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java index 83acca5c876..a286c969cdc 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java index 8d09220b9cb..b379ee89c6c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index d51807ac976..e88acdf7366 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java index cac69369d0a..72f7d357b89 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java index b58b9bc950c..d6ee16b057d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java index 67b8b985fed..bc35d0c6c34 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java index 51c6a305466..afe4036afff 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java index 51c6715f728..f6ff1b04411 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java index bafe2d77003..15759a42b45 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java index e7c79260c17..d2cd808c864 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java index 620e277c374..3d8904d1860 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java index 4ed49f643a6..21f41931c65 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java index 94323193320..ec9f1f735d1 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java index d21f7764706..c8b98732c14 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java index 395738af94c..9575c51db52 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java index b0ad30eb11c..07df0cf4f63 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index c626fa4b8cf..89b1e16c956 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java index cef8cd8b90a..e2fbb4c8484 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java index 28b2c3b1b5f..0d17cf36c36 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java index 8af075378f7..ad083982b12 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java index 678e4809263..03a99e51d04 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java index c2d6663545f..fc07498099e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java index 85be2a8ca87..395fca337a5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index d27c78376ab..716aa26971a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java index b3ec7aef407..a10d9cf3cba 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java index b7c9bd3b216..1bdf0037dbb 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index b17cb35148c..7495eb4765b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java index e74e246e1ee..d80b97c6a2a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java index 1aac4a7b761..8668bdd5229 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3b7c1d6f066..d3062bf298a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.virtualan.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java index d6ee65d5da4..57d1ea9cf5a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java index 7aa0db2e770..3245ee17d3f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java index 17c4c30952e..74de2ea47b2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java index beccd82a057..d201058acd3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index 09c2ff8ded9..ca925033ab9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java index ac7912f6bb3..ec8823c6d1d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java index f7053b1ef4c..f87bbe4c5b6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java index 654297922e7..6fa8aa39a0b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java index 574ca853a37..3f9a0619579 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index 997db40fa47..d5f7277f336 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java index 0da3f27957b..945a44bdc55 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index 030ff057ae4..8b156545d7f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java index 05f100a5113..ba86da8547f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index 603dceb1369..ac1bbc67404 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index a8470a066d8..21ceeea10b8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java index 8232f1059a4..14aeefb90b4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java index 0a23cfea116..01e81e5fdc6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 1667ef188ae..1883d899779 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java index d8efcca7f8a..4bad7b07b87 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public AnotherFakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 71ffda67b0c..f63a9141189 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -7,12 +7,14 @@ package org.openapitools.api; import java.math.BigDecimal; import org.openapitools.model.Client; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.model.FileSchemaTestClass; import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; +import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; import io.swagger.annotations.*; @@ -29,7 +31,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -345,8 +349,8 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java index c4b88419aab..c150dba343e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2459cc308c..138c4a9bf95 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -20,7 +20,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 85458b255da..1fb4dc597f8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public FakeClassnameTestApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index e969bf66765..90ce18382be 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; @@ -22,7 +23,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "the pet API") public interface PetApi { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index e72c57e3cbe..4ad9ef06158 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public PetApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 19ab0bb614b..bc6e370299d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -21,7 +21,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "the store API") public interface StoreApi { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index 1293b5c8f6e..293d3035f80 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public StoreApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 97583359e3b..c4a0e46979f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "the user API") public interface UserApi { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index 3f6c4d9a2d6..aab4767a50d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -2,16 +2,19 @@ package org.openapitools.api; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { private final NativeWebRequest request; - @org.springframework.beans.factory.annotation.Autowired + @Autowired public UserApiController(NativeWebRequest request) { this.request = request; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 847d9f37777..ea719cc4ad8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesAnyType */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesAnyType extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 31b7fad0c94..a4ec39252eb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesArray */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesArray extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5c23bc8d768..47db34f7b50 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesBoolean */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesBoolean extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 82d25ab6e74..5851aa2c249 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesClass { + @JsonProperty("map_string") @Valid private Map mapString = null; @@ -81,9 +84,8 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString */ + @ApiModelProperty(value = "") - - public Map getMapString() { return mapString; } @@ -109,10 +111,8 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMapNumber() { return mapNumber; } @@ -138,9 +138,8 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger */ + @ApiModelProperty(value = "") - - public Map getMapInteger() { return mapInteger; } @@ -166,9 +165,8 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean */ + @ApiModelProperty(value = "") - - public Map getMapBoolean() { return mapBoolean; } @@ -194,10 +192,8 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -223,10 +219,8 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,10 +246,8 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapString() { return mapMapString; } @@ -281,10 +273,8 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -302,9 +292,8 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 */ + @ApiModelProperty(value = "") - - public Object getAnytype1() { return anytype1; } @@ -322,9 +311,8 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 */ + @ApiModelProperty(value = "") - - public Object getAnytype2() { return anytype2; } @@ -342,9 +330,8 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 */ + @ApiModelProperty(value = "") - - public Object getAnytype3() { return anytype3; } @@ -353,7 +340,6 @@ public class AdditionalPropertiesClass { this.anytype3 = anytype3; } - @Override public boolean equals(Object o) { if (this == o) { @@ -385,7 +371,6 @@ public class AdditionalPropertiesClass { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 802674f7820..bba3dce1a55 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesInteger */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesInteger extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 787a4262026..5f48487e05d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesNumber */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") private String name; @@ -34,9 +37,8 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -45,7 +47,6 @@ public class AdditionalPropertiesNumber extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 271b66cf682..40ca1af6ab4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesObject */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesObject extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 08ba6bfe63c..ddc76e27b19 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * AdditionalPropertiesString */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") private String name; @@ -33,9 +36,8 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -44,7 +46,6 @@ public class AdditionalPropertiesString extends HashMap { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java index 7598b6f5561..fcd78770a43 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Animal.java @@ -15,19 +15,21 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Animal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Animal { + @JsonProperty("className") private String className; @@ -43,10 +45,8 @@ public class Animal { * Get className * @return className */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getClassName() { return className; } @@ -64,9 +64,8 @@ public class Animal { * Get color * @return color */ + @ApiModelProperty(value = "") - - public String getColor() { return color; } @@ -75,7 +74,6 @@ public class Animal { this.color = color; } - @Override public boolean equals(Object o) { if (this == o) { @@ -98,7 +96,6 @@ public class Animal { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bf1b74e83fc..3859dcfdcc0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") @Valid private List> arrayArrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayNumber() { return arrayArrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index f1ced8ef71a..a90ce117c23 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayOfNumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") @Valid private List arrayNumber = null; @@ -43,10 +46,8 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getArrayNumber() { return arrayNumber; } @@ -55,7 +56,6 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -77,7 +77,6 @@ public class ArrayOfNumberOnly { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java index 81c7ab3dd78..e8f37b16d5c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ArrayTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ArrayTest { + @JsonProperty("array_of_string") @Valid private List arrayOfString = null; @@ -51,9 +54,8 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString */ + @ApiModelProperty(value = "") - - public List getArrayOfString() { return arrayOfString; } @@ -79,10 +81,8 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -108,10 +108,8 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @@ -120,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(Object o) { if (this == o) { @@ -144,7 +141,6 @@ public class ArrayTest { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java index 1835c7bf211..68a00f5edd4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCat extends Cat { + /** * Gets or Sets kind */ @@ -73,9 +76,8 @@ public class BigCat extends Cat { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -84,7 +86,6 @@ public class BigCat extends Cat { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java index 43555f5bfed..0a8bd522873 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * BigCatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class BigCatAllOf { + /** * Gets or Sets kind */ @@ -71,9 +74,8 @@ public class BigCatAllOf { * Get kind * @return kind */ + @ApiModelProperty(value = "") - - public KindEnum getKind() { return kind; } @@ -82,7 +84,6 @@ public class BigCatAllOf { this.kind = kind; } - @Override public boolean equals(Object o) { if (this == o) { @@ -104,7 +105,6 @@ public class BigCatAllOf { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java index 2ccf1e812e5..37c928a7948 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Capitalization */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel; @@ -46,9 +49,8 @@ public class Capitalization { * Get smallCamel * @return smallCamel */ + @ApiModelProperty(value = "") - - public String getSmallCamel() { return smallCamel; } @@ -66,9 +68,8 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel */ + @ApiModelProperty(value = "") - - public String getCapitalCamel() { return capitalCamel; } @@ -86,9 +87,8 @@ public class Capitalization { * Get smallSnake * @return smallSnake */ + @ApiModelProperty(value = "") - - public String getSmallSnake() { return smallSnake; } @@ -106,9 +106,8 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake */ + @ApiModelProperty(value = "") - - public String getCapitalSnake() { return capitalSnake; } @@ -126,9 +125,8 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints */ + @ApiModelProperty(value = "") - - public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -146,9 +144,8 @@ public class Capitalization { * Name of the pet * @return ATT_NAME */ + @ApiModelProperty(value = "Name of the pet ") - - public String getATTNAME() { return ATT_NAME; } @@ -157,7 +154,6 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +180,6 @@ public class Capitalization { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java index 0876d9f30a0..9fb7bfef180 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Cat */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Cat extends Animal { + @JsonProperty("declawed") private Boolean declawed; @@ -33,9 +36,8 @@ public class Cat extends Animal { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -44,7 +46,6 @@ public class Cat extends Animal { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java index d59a3783d0a..c4acf4858c3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * CatAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class CatAllOf { + @JsonProperty("declawed") private Boolean declawed; @@ -31,9 +34,8 @@ public class CatAllOf { * Get declawed * @return declawed */ + @ApiModelProperty(value = "") - - public Boolean getDeclawed() { return declawed; } @@ -42,7 +44,6 @@ public class CatAllOf { this.declawed = declawed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class CatAllOf { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index ef9a938298b..8adf35c2fa0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Category */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Category { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Category { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,10 +56,8 @@ public class Category { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -66,7 +66,6 @@ public class Category { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +88,6 @@ public class Category { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java index af4c7442312..72e9288b53a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model with \"_class\" property */ + @ApiModel(description = "Model for testing model with \"_class\" property") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ClassModel { + @JsonProperty("_class") private String propertyClass; @@ -32,9 +35,8 @@ public class ClassModel { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -43,7 +45,6 @@ public class ClassModel { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ClassModel { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java index 298c69c03b1..9891fe7dafc 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Client */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Client { + @JsonProperty("client") private String client; @@ -31,9 +34,8 @@ public class Client { * Get client * @return client */ + @ApiModelProperty(value = "") - - public String getClient() { return client; } @@ -42,7 +44,6 @@ public class Client { this.client = client; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class Client { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java index 09938cd0f5f..3ee8ac59689 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Dog */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Dog extends Animal { + @JsonProperty("breed") private String breed; @@ -33,9 +36,8 @@ public class Dog extends Animal { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -44,7 +46,6 @@ public class Dog extends Animal { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java index d95ac4a329d..d6ff0e0564f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * DogAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class DogAllOf { + @JsonProperty("breed") private String breed; @@ -31,9 +34,8 @@ public class DogAllOf { * Get breed * @return breed */ + @ApiModelProperty(value = "") - - public String getBreed() { return breed; } @@ -42,7 +44,6 @@ public class DogAllOf { this.breed = breed; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class DogAllOf { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java index beeff77d9e5..b85ad3e155e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumArrays */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumArrays { + /** * Gets or Sets justSymbol */ @@ -108,9 +111,8 @@ public class EnumArrays { * Get justSymbol * @return justSymbol */ + @ApiModelProperty(value = "") - - public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -136,9 +138,8 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum */ + @ApiModelProperty(value = "") - - public List getArrayEnum() { return arrayEnum; } @@ -147,7 +148,6 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -170,7 +170,6 @@ public class EnumArrays { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java index 8f82b2f7843..c2abaaed430 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets EnumClass */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum EnumClass { _ABC("_abc"), diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index 0ce7ab0f2fa..5e0e3b8a65e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -15,12 +15,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * EnumTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class EnumTest { + /** * Gets or Sets enumString */ @@ -189,9 +192,8 @@ public class EnumTest { * Get enumString * @return enumString */ + @ApiModelProperty(value = "") - - public EnumStringEnum getEnumString() { return enumString; } @@ -209,10 +211,8 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -230,9 +230,8 @@ public class EnumTest { * Get enumInteger * @return enumInteger */ + @ApiModelProperty(value = "") - - public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -250,9 +249,8 @@ public class EnumTest { * Get enumNumber * @return enumNumber */ + @ApiModelProperty(value = "") - - public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -270,10 +268,8 @@ public class EnumTest { * Get outerEnum * @return outerEnum */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OuterEnum getOuterEnum() { return outerEnum; } @@ -282,7 +278,6 @@ public class EnumTest { this.outerEnum = outerEnum; } - @Override public boolean equals(Object o) { if (this == o) { @@ -308,7 +303,6 @@ public class EnumTest { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/File.java index 2bcc6d7db84..68539466497 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/File.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Must be named `File` for test. */ + @ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class File { + @JsonProperty("sourceURI") private String sourceURI; @@ -32,9 +35,8 @@ public class File { * Test capitalization * @return sourceURI */ + @ApiModelProperty(value = "Test capitalization") - - public String getSourceURI() { return sourceURI; } @@ -43,7 +45,6 @@ public class File { this.sourceURI = sourceURI; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class File { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5df5cbac52a..01149ce8f6a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FileSchemaTestClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FileSchemaTestClass { + @JsonProperty("file") private File file; @@ -38,10 +41,8 @@ public class FileSchemaTestClass { * Get file * @return file */ + @Valid @ApiModelProperty(value = "") - - @Valid - public File getFile() { return file; } @@ -67,10 +68,8 @@ public class FileSchemaTestClass { * Get files * @return files */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getFiles() { return files; } @@ -79,7 +78,6 @@ public class FileSchemaTestClass { this.files = files; } - @Override public boolean equals(Object o) { if (this == o) { @@ -102,7 +100,6 @@ public class FileSchemaTestClass { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java index 352d758ce6e..91d370eeb05 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java @@ -11,6 +11,8 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.springframework.core.io.Resource; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -18,12 +20,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * FormatTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class FormatTest { + @JsonProperty("integer") private Integer integer; @@ -49,14 +54,14 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private Resource binary; @JsonProperty("date") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) private LocalDate date; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("uuid") @@ -79,9 +84,8 @@ public class FormatTest { * maximum: 100 * @return integer */ + @Min(10) @Max(100) @ApiModelProperty(value = "") - -@Min(10) @Max(100) public Integer getInteger() { return integer; } @@ -101,9 +105,8 @@ public class FormatTest { * maximum: 200 * @return int32 */ + @Min(20) @Max(200) @ApiModelProperty(value = "") - -@Min(20) @Max(200) public Integer getInt32() { return int32; } @@ -121,9 +124,8 @@ public class FormatTest { * Get int64 * @return int64 */ + @ApiModelProperty(value = "") - - public Long getInt64() { return int64; } @@ -143,11 +145,8 @@ public class FormatTest { * maximum: 543.2 * @return number */ + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid -@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -167,9 +166,8 @@ public class FormatTest { * maximum: 987.6 * @return _float */ + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") - -@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -189,9 +187,8 @@ public class FormatTest { * maximum: 123.4 * @return _double */ + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") - -@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -209,9 +206,8 @@ public class FormatTest { * Get string * @return string */ + @Pattern(regexp = "/[a-z]/i") @ApiModelProperty(value = "") - -@Pattern(regexp = "/[a-z]/i") public String getString() { return string; } @@ -229,10 +225,8 @@ public class FormatTest { * Get _byte * @return _byte */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public byte[] getByte() { return _byte; } @@ -241,7 +235,7 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(Resource binary) { this.binary = binary; return this; } @@ -250,15 +244,13 @@ public class FormatTest { * Get binary * @return binary */ + @Valid @ApiModelProperty(value = "") - - @Valid - - public org.springframework.core.io.Resource getBinary() { + public Resource getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(Resource binary) { this.binary = binary; } @@ -271,11 +263,8 @@ public class FormatTest { * Get date * @return date */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public LocalDate getDate() { return date; } @@ -293,10 +282,8 @@ public class FormatTest { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -314,10 +301,8 @@ public class FormatTest { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -335,10 +320,8 @@ public class FormatTest { * Get password * @return password */ + @NotNull @Size(min = 10, max = 64) @ApiModelProperty(required = true, value = "") - @NotNull - -@Size(min = 10, max = 64) public String getPassword() { return password; } @@ -356,10 +339,8 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getBigDecimal() { return bigDecimal; } @@ -368,7 +349,6 @@ public class FormatTest { this.bigDecimal = bigDecimal; } - @Override public boolean equals(Object o) { if (this == o) { @@ -403,7 +383,6 @@ public class FormatTest { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 10e514bb172..2b64dcf5f9d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * HasOnlyReadOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class HasOnlyReadOnly { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class HasOnlyReadOnly { * Get foo * @return foo */ + @ApiModelProperty(readOnly = true, value = "") - - public String getFoo() { return foo; } @@ -65,7 +66,6 @@ public class HasOnlyReadOnly { this.foo = foo; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java index 36754fec8c9..27e3cea8e6e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java @@ -17,12 +17,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MapTest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MapTest { + @JsonProperty("map_map_of_string") @Valid private Map> mapMapOfString = null; @@ -91,10 +94,8 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map> getMapMapOfString() { return mapMapOfString; } @@ -120,9 +121,8 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString */ + @ApiModelProperty(value = "") - - public Map getMapOfEnumString() { return mapOfEnumString; } @@ -148,9 +148,8 @@ public class MapTest { * Get directMap * @return directMap */ + @ApiModelProperty(value = "") - - public Map getDirectMap() { return directMap; } @@ -176,9 +175,8 @@ public class MapTest { * Get indirectMap * @return indirectMap */ + @ApiModelProperty(value = "") - - public Map getIndirectMap() { return indirectMap; } @@ -187,7 +185,6 @@ public class MapTest { this.indirectMap = indirectMap; } - @Override public boolean equals(Object o) { if (this == o) { @@ -212,7 +209,6 @@ public class MapTest { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8238e3227a6..e490e2a61ef 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -19,17 +20,20 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * MixedPropertiesAndAdditionalPropertiesClass */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid; @JsonProperty("dateTime") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime dateTime; @JsonProperty("map") @@ -45,10 +49,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid */ + @Valid @ApiModelProperty(value = "") - - @Valid - public UUID getUuid() { return uuid; } @@ -66,10 +68,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getDateTime() { return dateTime; } @@ -95,10 +95,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Map getMap() { return map; } @@ -107,7 +105,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } - @Override public boolean equals(Object o) { if (this == o) { @@ -131,7 +128,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java index 3f8bdc54450..89575c6bad3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name starting with number */ + @ApiModel(description = "Model for testing model name starting with number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Model200Response { + @JsonProperty("name") private Integer name; @@ -35,9 +38,8 @@ public class Model200Response { * Get name * @return name */ + @ApiModelProperty(value = "") - - public Integer getName() { return name; } @@ -55,9 +57,8 @@ public class Model200Response { * Get propertyClass * @return propertyClass */ + @ApiModelProperty(value = "") - - public String getPropertyClass() { return propertyClass; } @@ -66,7 +67,6 @@ public class Model200Response { this.propertyClass = propertyClass; } - @Override public boolean equals(Object o) { if (this == o) { @@ -89,7 +89,6 @@ public class Model200Response { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index 99a06748ac1..98f2d63bf77 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelApiResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelApiResponse { + @JsonProperty("code") private Integer code; @@ -37,9 +40,8 @@ public class ModelApiResponse { * Get code * @return code */ + @ApiModelProperty(value = "") - - public Integer getCode() { return code; } @@ -57,9 +59,8 @@ public class ModelApiResponse { * Get type * @return type */ + @ApiModelProperty(value = "") - - public String getType() { return type; } @@ -77,9 +78,8 @@ public class ModelApiResponse { * Get message * @return message */ + @ApiModelProperty(value = "") - - public String getMessage() { return message; } @@ -88,7 +88,6 @@ public class ModelApiResponse { this.message = message; } - @Override public boolean equals(Object o) { if (this == o) { @@ -112,7 +111,6 @@ public class ModelApiResponse { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java index a00be9952d8..6b5e61562ad 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ModelList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelList { + @JsonProperty("123-list") private String _123list; @@ -31,9 +34,8 @@ public class ModelList { * Get _123list * @return _123list */ + @ApiModelProperty(value = "") - - public String get123list() { return _123list; } @@ -42,7 +44,6 @@ public class ModelList { this._123list = _123list; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class ModelList { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java index d9cc6193aee..84b54d38a08 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing reserved words */ + @ApiModel(description = "Model for testing reserved words") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ModelReturn { + @JsonProperty("return") private Integer _return; @@ -32,9 +35,8 @@ public class ModelReturn { * Get _return * @return _return */ + @ApiModelProperty(value = "") - - public Integer getReturn() { return _return; } @@ -43,7 +45,6 @@ public class ModelReturn { this._return = _return; } - @Override public boolean equals(Object o) { if (this == o) { @@ -65,7 +66,6 @@ public class ModelReturn { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java index 880351d2843..febe2115a66 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java @@ -13,13 +13,16 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Model for testing model name same as property name */ + @ApiModel(description = "Model for testing model name same as property name") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Name { + @JsonProperty("name") private Integer name; @@ -41,10 +44,8 @@ public class Name { * Get name * @return name */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getName() { return name; } @@ -62,9 +63,8 @@ public class Name { * Get snakeCase * @return snakeCase */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer getSnakeCase() { return snakeCase; } @@ -82,9 +82,8 @@ public class Name { * Get property * @return property */ + @ApiModelProperty(value = "") - - public String getProperty() { return property; } @@ -102,9 +101,8 @@ public class Name { * Get _123number * @return _123number */ + @ApiModelProperty(readOnly = true, value = "") - - public Integer get123number() { return _123number; } @@ -113,7 +111,6 @@ public class Name { this._123number = _123number; } - @Override public boolean equals(Object o) { if (this == o) { @@ -138,7 +135,6 @@ public class Name { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java index 4af42224ae5..dcf5c5e801a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * NumberOnly */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber; @@ -32,10 +35,8 @@ public class NumberOnly { * Get justNumber * @return justNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getJustNumber() { return justNumber; } @@ -44,7 +45,6 @@ public class NumberOnly { this.justNumber = justNumber; } - @Override public boolean equals(Object o) { if (this == o) { @@ -66,7 +66,6 @@ public class NumberOnly { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index ba0b3b2e313..6bd55e5a154 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; @@ -15,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Order */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Order { + @JsonProperty("id") private Long id; @@ -31,7 +35,7 @@ public class Order { private Integer quantity; @JsonProperty("shipDate") - @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime shipDate; /** @@ -86,9 +90,8 @@ public class Order { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -106,9 +109,8 @@ public class Order { * Get petId * @return petId */ + @ApiModelProperty(value = "") - - public Long getPetId() { return petId; } @@ -126,9 +128,8 @@ public class Order { * Get quantity * @return quantity */ + @ApiModelProperty(value = "") - - public Integer getQuantity() { return quantity; } @@ -146,10 +147,8 @@ public class Order { * Get shipDate * @return shipDate */ + @Valid @ApiModelProperty(value = "") - - @Valid - public OffsetDateTime getShipDate() { return shipDate; } @@ -167,9 +166,8 @@ public class Order { * Order Status * @return status */ + @ApiModelProperty(value = "Order Status") - - public StatusEnum getStatus() { return status; } @@ -187,9 +185,8 @@ public class Order { * Get complete * @return complete */ + @ApiModelProperty(value = "") - - public Boolean getComplete() { return complete; } @@ -198,7 +195,6 @@ public class Order { this.complete = complete; } - @Override public boolean equals(Object o) { if (this == o) { @@ -225,7 +221,6 @@ public class Order { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java index cdac99f37e4..eca5e7cd4fa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java @@ -14,12 +14,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * OuterComposite */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber; @@ -38,10 +41,8 @@ public class OuterComposite { * Get myNumber * @return myNumber */ + @Valid @ApiModelProperty(value = "") - - @Valid - public BigDecimal getMyNumber() { return myNumber; } @@ -59,9 +60,8 @@ public class OuterComposite { * Get myString * @return myString */ + @ApiModelProperty(value = "") - - public String getMyString() { return myString; } @@ -79,9 +79,8 @@ public class OuterComposite { * Get myBoolean * @return myBoolean */ + @ApiModelProperty(value = "") - - public Boolean getMyBoolean() { return myBoolean; } @@ -90,7 +89,6 @@ public class OuterComposite { this.myBoolean = myBoolean; } - @Override public boolean equals(Object o) { if (this == o) { @@ -114,7 +112,6 @@ public class OuterComposite { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java index d74006b9d33..1f09d0a5d17 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Gets or Sets OuterEnum */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public enum OuterEnum { PLACED("placed"), diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 9aa5cb53c51..9f17ad305da 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -21,12 +21,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Pet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Pet { + @JsonProperty("id") private Long id; @@ -93,9 +96,8 @@ public class Pet { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -113,10 +115,8 @@ public class Pet { * Get category * @return category */ + @Valid @ApiModelProperty(value = "") - - @Valid - public Category getCategory() { return category; } @@ -134,10 +134,8 @@ public class Pet { * Get name * @return name */ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @NotNull - - public String getName() { return name; } @@ -160,10 +158,8 @@ public class Pet { * Get photoUrls * @return photoUrls */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Set getPhotoUrls() { return photoUrls; } @@ -190,10 +186,8 @@ public class Pet { * Get tags * @return tags */ + @Valid @ApiModelProperty(value = "") - - @Valid - public List getTags() { return tags; } @@ -211,9 +205,8 @@ public class Pet { * pet status in the store * @return status */ + @ApiModelProperty(value = "pet status in the store") - - public StatusEnum getStatus() { return status; } @@ -222,7 +215,6 @@ public class Pet { this.status = status; } - @Override public boolean equals(Object o) { if (this == o) { @@ -249,7 +241,6 @@ public class Pet { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java index f872289b8da..e2ddfcdfcb1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * ReadOnlyFirst */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class ReadOnlyFirst { + @JsonProperty("bar") private String bar; @@ -34,9 +37,8 @@ public class ReadOnlyFirst { * Get bar * @return bar */ + @ApiModelProperty(readOnly = true, value = "") - - public String getBar() { return bar; } @@ -54,9 +56,8 @@ public class ReadOnlyFirst { * Get baz * @return baz */ + @ApiModelProperty(value = "") - - public String getBaz() { return baz; } @@ -65,7 +66,6 @@ public class ReadOnlyFirst { this.baz = baz; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class ReadOnlyFirst { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java index 31cc434cd51..effca9c97da 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * SpecialModelName */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { + @JsonProperty("$special[property.name]") private Long $specialPropertyName; @@ -31,9 +34,8 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ + @ApiModelProperty(value = "") - - public Long get$SpecialPropertyName() { return $specialPropertyName; } @@ -42,7 +44,6 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(Object o) { if (this == o) { @@ -64,7 +65,6 @@ public class SpecialModelName { 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(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index 2d1ac94412f..03b4ffcdadc 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class Tag { + @JsonProperty("id") private Long id; @@ -34,9 +37,8 @@ public class Tag { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -54,9 +56,8 @@ public class Tag { * Get name * @return name */ + @ApiModelProperty(value = "") - - public String getName() { return name; } @@ -65,7 +66,6 @@ public class Tag { this.name = name; } - @Override public boolean equals(Object o) { if (this == o) { @@ -88,7 +88,6 @@ public class Tag { 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("}"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java index fb29f038fc6..01e5d5f3fcc 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderDefault */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderDefault { + @JsonProperty("string_item") private String stringItem = "what"; @@ -47,10 +50,8 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -68,11 +69,8 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -90,10 +88,8 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -111,10 +107,8 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -137,10 +131,8 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -149,7 +141,6 @@ public class TypeHolderDefault { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -175,7 +166,6 @@ public class TypeHolderDefault { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java index 096b4ada099..e907ad9c28e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * TypeHolderExample */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class TypeHolderExample { + @JsonProperty("string_item") private String stringItem; @@ -50,10 +53,8 @@ public class TypeHolderExample { * Get stringItem * @return stringItem */ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") - @NotNull - - public String getStringItem() { return stringItem; } @@ -71,11 +72,8 @@ public class TypeHolderExample { * Get numberItem * @return numberItem */ + @NotNull @Valid @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - @Valid - public BigDecimal getNumberItem() { return numberItem; } @@ -93,10 +91,8 @@ public class TypeHolderExample { * Get floatItem * @return floatItem */ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") - @NotNull - - public Float getFloatItem() { return floatItem; } @@ -114,10 +110,8 @@ public class TypeHolderExample { * Get integerItem * @return integerItem */ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") - @NotNull - - public Integer getIntegerItem() { return integerItem; } @@ -135,10 +129,8 @@ public class TypeHolderExample { * Get boolItem * @return boolItem */ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") - @NotNull - - public Boolean getBoolItem() { return boolItem; } @@ -161,10 +153,8 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem */ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @NotNull - - public List getArrayItem() { return arrayItem; } @@ -173,7 +163,6 @@ public class TypeHolderExample { this.arrayItem = arrayItem; } - @Override public boolean equals(Object o) { if (this == o) { @@ -200,7 +189,6 @@ public class TypeHolderExample { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index 3cadd5d4ec5..cff62427bf1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -13,12 +13,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class User { + @JsonProperty("id") private Long id; @@ -52,9 +55,8 @@ public class User { * Get id * @return id */ + @ApiModelProperty(value = "") - - public Long getId() { return id; } @@ -72,9 +74,8 @@ public class User { * Get username * @return username */ + @ApiModelProperty(value = "") - - public String getUsername() { return username; } @@ -92,9 +93,8 @@ public class User { * Get firstName * @return firstName */ + @ApiModelProperty(value = "") - - public String getFirstName() { return firstName; } @@ -112,9 +112,8 @@ public class User { * Get lastName * @return lastName */ + @ApiModelProperty(value = "") - - public String getLastName() { return lastName; } @@ -132,9 +131,8 @@ public class User { * Get email * @return email */ + @ApiModelProperty(value = "") - - public String getEmail() { return email; } @@ -152,9 +150,8 @@ public class User { * Get password * @return password */ + @ApiModelProperty(value = "") - - public String getPassword() { return password; } @@ -172,9 +169,8 @@ public class User { * Get phone * @return phone */ + @ApiModelProperty(value = "") - - public String getPhone() { return phone; } @@ -192,9 +188,8 @@ public class User { * User Status * @return userStatus */ + @ApiModelProperty(value = "User Status") - - public Integer getUserStatus() { return userStatus; } @@ -203,7 +198,6 @@ public class User { this.userStatus = userStatus; } - @Override public boolean equals(Object o) { if (this == o) { @@ -232,7 +226,6 @@ public class User { 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"); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java index 62cfbcc6b28..930edebcef7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java @@ -16,12 +16,15 @@ import javax.validation.constraints.*; import java.util.*; +import javax.annotation.Generated; /** * XmlItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class XmlItem { + @JsonProperty("attribute_string") private String attributeString; @@ -127,9 +130,8 @@ public class XmlItem { * Get attributeString * @return attributeString */ + @ApiModelProperty(example = "string", value = "") - - public String getAttributeString() { return attributeString; } @@ -147,10 +149,8 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -168,9 +168,8 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getAttributeInteger() { return attributeInteger; } @@ -188,9 +187,8 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -216,9 +214,8 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray */ + @ApiModelProperty(value = "") - - public List getWrappedArray() { return wrappedArray; } @@ -236,9 +233,8 @@ public class XmlItem { * Get nameString * @return nameString */ + @ApiModelProperty(example = "string", value = "") - - public String getNameString() { return nameString; } @@ -256,10 +252,8 @@ public class XmlItem { * Get nameNumber * @return nameNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNameNumber() { return nameNumber; } @@ -277,9 +271,8 @@ public class XmlItem { * Get nameInteger * @return nameInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNameInteger() { return nameInteger; } @@ -297,9 +290,8 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNameBoolean() { return nameBoolean; } @@ -325,9 +317,8 @@ public class XmlItem { * Get nameArray * @return nameArray */ + @ApiModelProperty(value = "") - - public List getNameArray() { return nameArray; } @@ -353,9 +344,8 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray */ + @ApiModelProperty(value = "") - - public List getNameWrappedArray() { return nameWrappedArray; } @@ -373,9 +363,8 @@ public class XmlItem { * Get prefixString * @return prefixString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixString() { return prefixString; } @@ -393,10 +382,8 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -414,9 +401,8 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixInteger() { return prefixInteger; } @@ -434,9 +420,8 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -462,9 +447,8 @@ public class XmlItem { * Get prefixArray * @return prefixArray */ + @ApiModelProperty(value = "") - - public List getPrefixArray() { return prefixArray; } @@ -490,9 +474,8 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -510,9 +493,8 @@ public class XmlItem { * Get namespaceString * @return namespaceString */ + @ApiModelProperty(example = "string", value = "") - - public String getNamespaceString() { return namespaceString; } @@ -530,10 +512,8 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -551,9 +531,8 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getNamespaceInteger() { return namespaceInteger; } @@ -571,9 +550,8 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -599,9 +577,8 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray */ + @ApiModelProperty(value = "") - - public List getNamespaceArray() { return namespaceArray; } @@ -627,9 +604,8 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray */ + @ApiModelProperty(value = "") - - public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -647,9 +623,8 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString */ + @ApiModelProperty(example = "string", value = "") - - public String getPrefixNsString() { return prefixNsString; } @@ -667,10 +642,8 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber */ + @Valid @ApiModelProperty(example = "1.234", value = "") - - @Valid - public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -688,9 +661,8 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger */ + @ApiModelProperty(example = "-2", value = "") - - public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -708,9 +680,8 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean */ + @ApiModelProperty(example = "true", value = "") - - public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -736,9 +707,8 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsArray() { return prefixNsArray; } @@ -764,9 +734,8 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ + @ApiModelProperty(value = "") - - public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } @@ -775,7 +744,6 @@ public class XmlItem { this.prefixNsWrappedArray = prefixNsWrappedArray; } - @Override public boolean equals(Object o) { if (this == o) { @@ -825,7 +793,6 @@ public class XmlItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); From c8fff9a6219d9e0f42cfede77ca3e8061b6d758a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 17 Jan 2022 16:09:49 +0800 Subject: [PATCH 061/113] =?UTF-8?q?add=20=E7=99=BE=E5=BA=A6=E8=90=A5?= =?UTF-8?q?=E9=94=80=20as=20a=20user=20of=20openapi-generator=20(#11337)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + website/src/dynamic/users.yml | 5 +++++ website/static/img/companies/ebaidu.jpeg | Bin 0 -> 7985 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/ebaidu.jpeg diff --git a/README.md b/README.md index d4d90f83134..6a23fc7554a 100644 --- a/README.md +++ b/README.md @@ -577,6 +577,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [ASKUL](https://www.askul.co.jp) - [Arduino](https://www.arduino.cc/) - [b<>com](https://b-com.com/en) +- [百度营销](https://e.baidu.com) - [Banzai Cloud](https://banzaicloud.com) - [BIMData.io](https://bimdata.io) - [Bithost GmbH](https://www.bithost.ch) diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 6c8d8667df5..59c93067b4d 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -48,6 +48,11 @@ image: "img/companies/b-com.png" infoLink: "https://b-com.com/en" pinned: false +- + caption: "百度营销" + image: "img/companies/ebaidu.jpeg" + infoLink: "https://e.baidu.com" + pinned: false - caption: "Banzai Cloud" image: "img/companies/banzai_cloud.png" diff --git a/website/static/img/companies/ebaidu.jpeg b/website/static/img/companies/ebaidu.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..9b7f305b66b645bb215586af83fb554411289f1f GIT binary patch literal 7985 zcmb_>1yEdD^XI^z3C`de+$Rj~5}e>R!9BP`a0nJ01_D8XWCjQ@cyLW{2ohXE@Zb>K zWqEJE_pN+YyZ^1)d#n1??f#wazUQ85Irm}qVHrT6qM)n*KtTZjP#$lj}&+%FhpZ6oMrn{QM7J0fblpCzNp@3IhO@5Cuqx^3V;S1^`e|fq%LB?+X(R1Bi}= zg8C@cAON7EprW8Z!N$TuLq~svpr8T)glOm(M9+9JiDk5OEZkGa#z7=x4BEPHVJV~# z0T0hl)n6F-_+=3_-zF@>I=h%&Sb4#j!&lc19~DwQT6(nhKbr$SYWv$53n9v*FDU4L zJM`bZd9?Ou?9rACv4#6vhU!Dm!#n^7_=qC}5(1hQR$UV-S(+Vb~)WwqBXW6tO?9& z@nEZ3nh07q7Y-Ah3lXbUC1JFzriwWKMgzM39`fUP*s+mt<&sh+M(LaZ=NDe+Pk9Ao zLizqOiA7&EVH1^XibQYmRMI4$A&ex6%52rLya94OA=EZ}dEok|yk2E+uZ&1xTnDMN zZ{~`%T`ocLA&&d#r#t6NpHXi?CmgX%p7A56P&YS+P@A)`?0^A!vT8aePjY&wC2#5X zgNhVzM1+oE$cY*8xu}Bx(Wx_G7OnXjUgfLe?|Ae?oLNHPG7`i8|0X7S88Hhuq<1O<*rm-hOS}Fm1G?$xk}S{u=h? zrQZ>u?5wp6V+415DjXj-_UX-b!V3F#Wj7n27Bukh_ogMv&AOEh7a&25I5j`dc=cK{ z1!6bHUmnD&HxKR$`bZ)jH2oWp2UM?Xd5_!7!4ECq_^d4dRZ7?`cBlfYkv@^PBK#os z(g#4~gW{=*&lw($iQMnF-lEjivZBNY|*DME=!Fbgi4JrG^Rg`J!L6*jXOmmJ#u>= zNXqoJ(JL8Ee;h(0>3s%eUoE>z%NStt*_YJH)ZJIbce|R*06=szDlf;#)UZZfhAo(-k#l(XZi&etFLY3w1;}XDb%P5 z9El*qe8%lS#0_#a_#Vj|wi*NEzTnp0V)b#18sRt^>i|cGJKLO&wO31j#y{M%XP!tB zp13mm@;`~1m)jPh;!o%R0M7MSV~@|m1Jw2f^E^5Xdn_5~c=F?D(o_b?Sz=;y@|qW{ z>MKbS?euywP=%x0bk>g$0#@stz0?zlAu6~k1D7mmVM$q%p6+<_UwqS_F1>gFurxHE ziIVHdzXu41R+U1Vy;~am5`xoRhY~{K{el=m0aO^JH}KdQP0-^CD3wnUP$QVX-Wi8{ z*D##4I`PC5`;d)KohXf->Ea~#^oM8SdFzW`3V#t3{9`dz|Bq4t#JZ3AnQ$budojJ*_F`4gf`C}$8%x^jWNV^A3o!}3fzP;2z zdbWDGSr?|i#)>_*=WRkgP8M{Wmq#^wgiPAuftzzEx|#)P*~Y3OdGSn#3YzVT;%GS2 zX3E$aB#D=^)fDCeWZ*mRVvdC@%{=V9sEI$wjVyd|ER*X7{OyLm|y>rq3q z$eUU$T$G**t$gA3osiq+f!x}Trxy;%E#(>(flTIi$TxPR*TA@gis+&02f*j$_D=A3 z!|`?QABQR3RKyG~m}kj*vuA-D*;|JR-Y%V%+R$;OpUN~ZIPpjrmUlPu)m_RX-t_&l zvZWfbTzMLNnpJ_WV*sR|BTl-j-z&QJ-CWP$Qa?;)3J)+C=h6KY_Y?~3xtNX{oLnrS zgZ`RFKl-LTpgh%J6L{IKE`R+vg)Xh6ODDY$4ne&`t-1@p1 z(q+)%>R%GYf1pplg(f@2JkGAH1b#?OU3M8X|4+;)*+74X{;&5Z3)7G$L39q?a27aM zi195($-REjnbLLd!33rNq^Z}!sv8mkF7!rA<~R9ZzmA<&_M}DqMz(6bRMu zGlLiT1LJrO`D#?Ll-xiHcin9&MRj)lQ~%iD+wau}oHmA(#) z9LO#00OjlqL=7$E5tqSM(oD!9^{G4NE_n58`S}NZ5o6sl+#RoopKT{pUMgSc2lZB` zrxIgJiD>K5>881EXm}gGksF?KuTrQ&hcIQCdfFurl~I|gCp9Dek}@xEX(1xk&~AU8 z6oTa(q6SjZnazlsEq*a%5W|uU-F2zYT1VaRIqL~y@qe=NFMPOc(>chSgyV8EX_vzA zgI+E;V!r8lsqht6vdz2@G+-vOl=NU|Q;PB$(=JQxWe#L+cgcP-P;YqP*0VT?HJF&~1@}b>;eLb6 zRQZHeX`wa*`xUt;uRdiL&{7nuDA(Qw5fi=rGf-{RKd!6!y}*z|+AW7Qj}wRdY+9PXnd`}4!%xUd_-xD)w|3UK=~QOQ z`JGFfehFrIu$0Qj_i?7)9kC*QIrUTKS5Y=@6wv2lPm*P}7-}e0tevWPD7qBpD>t7> zIwmp*UnY*JccMlWVOGKAlx@Iw5%a+=q{NDNIDXyiH@O*;~9< z`E+tQ`pbfwMQS!4!sp+De{!vUr{HW1(7QePPGo-Qp+TnhGnq zDY>Hp&%~W*=c^Q4>Gd8%L&D4sw0;{<4OrY`hcxMOwA-FsSaN0Wb|y~O^p7-u;2 z{iNYr(1$r0ZVH&Owuej@k|bs88}f3N4>nohU;;U=y6SmD08P3C@|R%vO* zpjhfx{*2#$dSyn@*EC^%IBto@ru+%9;VKU<*vS(M6#V&Eg~;b`#ZL^n#&*h!zkSi@ z7=gy~*@hG?wF-}N;W4)BwT%QPba_c_4CpJ)`m>36&}Fp&4~x>3ItO@Mm8tDU_V#VG zJe;GookURzoumZ(F;_Iy2HO*p_L**b^VQdmC0WpM`H2(?w!*e_Nvj3X4rht?irssm zk(#Q!PXN=(EMM_F>|0vEd&waS_yg(huOuy~tCePIloFlm2X}fG&Ouc8DYFj%oou9o zq^i~3V=yks`>g>SSe3+j05mD4iQ}_IUozhRM(tX!mzvzznXg@*ct_Y=gu`hk&nJ-> z%@K>e+%zso+oe2d1Q3oa7KCy|#$}?xEPlhV=^>vi+>3WX*TYbg=TKd5j$IswLHXD! zX)MOj#oFw&AR4-P<=c%4uP5a{P7J7GdtH-dO@svb!W_t4^;=SN&sJYVp7 zdF{!;mMIXhHRmIY6h201eRV+rrMmA4#jbB+yXl#iJ|89s`H6!m&dtl@1$S?kRcYEy znRTl;cGRLpA~#DAH=1r+nBg^}2|8I{#;8%Z_wfbNKAXY{G&{sm&*Gy4K`rNx$Kv6^ z;G(~F#dX0RVm(*=j7v&4=RH;kt(Al;;mr3%?Eb<- z`QW~oC^ME+vdk;6ens|2VEb@Se#7>-;C-Fux0PH2Y)Ue#ukic(XCvM^1_CwUupV3b z78+JYn@hk3U5o&o?x@OYR?vr0GMe%f?qjM!xwNBo@msMctVdsY zLs$PbJx3TcCltj)L!gA@qn~{>^xgXf@UZ-;rkR{qj`d0ED;lYUtD1u##k<0L1@-wI zi9y;le@X;qS?tur{)d7>hgMq*=;Ff4!d0Tn$I(tv@}RZc;;P+}Ln18t*>E?79|~29 z67v0B#A6b%S%&;f0FSk^p4Dj#?-lV9An87ePgB2?`ZO6-Cq@zV z%F1`a#6+cPgJEiL!q-!7UP9wKy?2d8qHmTVy@uNfvMBrE$+|EzctZ&@t1E2t!YJbg zYn!uPY)+sU$?PDoz% z$2+R1t&m}VnaM_v+-D#T4Gy+hBv&lropw~!jLZbcK)`pCY**)O{G#}11U&tDxA2dq zS2@YBsYuWDc6fp*3JV$fD=Ev{5zN4&^}R=63lnD4kzFHbJcl{+CeN4T>Z2JiPQT#rW*__=w^|O{9S%sGBu4|EZdeDk*plJS(&zuWndq%VSfI zQjnsouS_Eg$d7!?v0ut#=-r+gR@71kZhVgm3mw@S0dj1W0Iqr$_z|NY|0J<-J!9~_ zsOjD&5gLCYUCG%HnFv`mFl}p9TeCe+mK6IMQ5+jLMGR=wFdl_wooQPhbw*ARoK5 z;62sl9a4Zl$9laJysjW|Leg$$Br9gWb**hWbFQg*YsJdVYWSAC24~R=$Vs63IA&+sQ$r^?;vrBIxf#59w@2-_Tf`anXh_g*e`crIy_4-)x)Pph4qelSomS zg`hAEa(T=}bQO3_%jY#K**19W(boS6K*&g)3!Q60vr4j!LR3ihRazF5;_$gD7s|T% zyjsEPIV^ON95+-uEaxgR&22mNaF^+b5ip|<10{`%Ok+3Z=N#j+_?O;#yeYoIOqI|J z77?4OJ6a^3&fm4#NA&q>7>1W8)raf-S5RS@xlM&{!-3+}(nRu4;q&Uwejpn8=vg&3 z_R(fRHw$$PXo}r>iV2CHqJbb@Vayn-902c2mxXdH=EkO!!b&sUi8YdOPlCi~VRLIi z=*7KLnt6|8te86|of}Jd#538Kv7Y7cd_^A(1k-rFJKjG4p3vqP%T1@EbJ;W0!eTT7x4zd}L`Gk2m-`+FH~JW; z5#S*zK8S2*W=i&I@%xJ4wGg3-+=wmEl^pOB@P*)KU$*d^S|;x-u4m~rJpi6=Z#BsO z8P+7xtLUFsU=syp z`)HbY+%};;EhG2oR=&qBA`Bm8$?Z4}-zz1qYNAIcW5V@8y+IM(6WNsn;?*b>A2X?_ zH_@re`+Lbqg>Hg2hjD&bDazsZZ(D|P8y#UQdyKA$Yft-tk zzP}5S!v)P_v=uGPd=>y{f-lTqA26{MY$OTbJ1RSiucwe<@59O1=a}-S&L?MP-C@j~NHFVuMJ7Bvv-SVL6VAL+{u@_L8W2Pm ze?xY!BOTdg#k@p(ni6<+cYgX#!mG^_kL(O~=Y4NsA|b8a=M$0{aXlWwp(C1Z^yPMl zbvpG*J6xmj&wkBac(9Z1?}GMqJPbi;CA6M^PH(~ySjpUc?;)fyZql5 zk*PY*bn1Il?s_Z#9bM8k_7v}V=&I>5&JO;Uf{hIxi_b39TyF%i#30eg#Law19pBJ# zr5P&uMJJ`{MsnF^P&j{PdZkaahMja{`CR{6));6z4i%!`8h#YoIW zMG|2oS&7FR-oy@x2LLCzdtVdBalP7em3|*w2j9s(sfhy0D54C%;Z&im)AxP@9wL2M z_XtF8amz2m)#DHrDare$dl&X^DOT%OQA{ec)feaYDG2Q!J+@ zi|>`oTM!Eruqt}OPOzCb8Edb;@Z|oJ{L@IlWa%c00MB?TA2c&S9%PX8N%wAY^gjFV z*0_Qs)=sZCuGpgcE8zh@^|u1yt;UUtj3ZOJdYH!Rb5l z5@8(b)PBZDoD{(xli+b5woTDUuaMZo+XxdwAAP&$TVegNh!|b)iVUWZhill1Mc8u2 z4-7^N=Q2fJO9z&KwFqGxom5LJ-pc9JQ^$*{@;i%MG<{EZ~<0 zTOE=&F?dLMLwYmO$&UvC})M2n+-I zVRHKZZaQ%{GZV?%$FFPoxGN(Ds@Tyj;t5=^5@ayrsT}gvTq+df@n`!k+ngK7qzZfP zlpX+CDt5#Ftb19|y1^v5(pvikCG+`KvC-+Qrcwb$fR(lJr&v@)fO0XWIc8QXVCVCl zTp${kvK@kHpBa=o?kqEmF9>T9gsrh`F51HyH_$HzHpj#kL*s>jyyo4&E_3v2d43F3 z!Wy=F^u3ZN`3|U^;X9Ab;$N|cBQq~Emv^v6PIe^hYmThkv={Ucx)46%d%)vmFfE?m z$Lnz8=g@=D-o&w$?& Date: Mon, 17 Jan 2022 11:08:15 -0500 Subject: [PATCH 062/113] if discriminator is not defined with useOneOfDiscriminatorLookup set to true, we generated as useOneOfDiscriminatorLookup false (#11178) --- .../main/resources/go/model_oneof.mustache | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache index 45562dcc7c3..6938308d763 100644 --- a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache @@ -48,8 +48,38 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } {{/mappedModels}} - {{/discriminator}} return nil + {{/discriminator}} + {{^discriminator}} + match := 0 + {{#oneOf}} + // try to unmarshal data into {{{.}}} + err = json.Unmarshal(data, &dst.{{{.}}}) + if err == nil { + json{{{.}}}, _ := json.Marshal(dst.{{{.}}}) + if string(json{{{.}}}) == "{}" { // empty struct + dst.{{{.}}} = nil + } else { + match++ + } + } else { + dst.{{{.}}} = nil + } + + {{/oneOf}} + if match > 1 { // more than 1 match + // reset to nil + {{#oneOf}} + dst.{{{.}}} = nil + {{/oneOf}} + + return fmt.Errorf("Data matches more than one schema in oneOf({{classname}})") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf({{classname}})") + } + {{/discriminator}} {{/useOneOfDiscriminatorLookup}} {{^useOneOfDiscriminatorLookup}} match := 0 From 90972c638ab17a8dfcafe5bf60705f2efd8e21e8 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 18 Jan 2022 18:21:00 +0800 Subject: [PATCH 063/113] add type check in the equal method (#11346) --- .../codegen/languages/JavaPlayFrameworkCodegen.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 a152d69cf39..400ed76f95a 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 @@ -451,6 +451,14 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea @Override public boolean equals(Object o) { + if (o == null) { + return false; + } + + if (this.getClass() != o.getClass()) { + return false; + } + boolean result = super.equals(o); JavaPlayFrameworkCodegen.ExtendedCodegenSecurity that = (JavaPlayFrameworkCodegen.ExtendedCodegenSecurity) o; return result && From 0cb88ce024ade086e673b2e6c32260b2f61e4233 Mon Sep 17 00:00:00 2001 From: Ananta Dwi Prasetya Purna Yuda Date: Tue, 18 Jan 2022 18:39:29 +0700 Subject: [PATCH 064/113] [KOTLIN] add `modelMutable` additional properties parser (#11332) * [kotlin] add modelMutable parser * [kotlin] fix kotlin vertx samples --- .../languages/AbstractKotlinCodegen.java | 4 ++++ .../openapitools/server/api/model/Category.kt | 4 ++-- .../server/api/model/ModelApiResponse.kt | 6 +++--- .../openapitools/server/api/model/Order.kt | 12 +++++------ .../org/openapitools/server/api/model/Pet.kt | 20 +++++++++---------- .../org/openapitools/server/api/model/Tag.kt | 4 ++-- .../org/openapitools/server/api/model/User.kt | 16 +++++++-------- 7 files changed, 35 insertions(+), 31 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index a00fc670c3c..e980427505e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -416,6 +416,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } + if (additionalProperties.containsKey(MODEL_MUTABLE)) { + additionalProperties.put(MODEL_MUTABLE, Boolean.parseBoolean(additionalProperties.get(MODEL_MUTABLE).toString())); + } + if (additionalProperties.containsKey(CodegenConstants.ENUM_PROPERTY_NAMING)) { setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING)); } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt index 29aaa19c2c2..7768072a83d 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Category.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Category ( - var id: kotlin.Long? = null, - var name: kotlin.String? = null + val id: kotlin.Long? = null, + val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt index ce832696033..332a3c0f6e7 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt @@ -25,9 +25,9 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class ModelApiResponse ( - var code: kotlin.Int? = null, - var type: kotlin.String? = null, - var message: kotlin.String? = null + val code: kotlin.Int? = null, + val type: kotlin.String? = null, + val message: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt index a25f7e74bc7..9078e0bdd25 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt @@ -28,13 +28,13 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Order ( - var id: kotlin.Long? = null, - var petId: kotlin.Long? = null, - var quantity: kotlin.Int? = null, - var shipDate: java.time.OffsetDateTime? = null, + val id: kotlin.Long? = null, + val petId: kotlin.Long? = null, + val quantity: kotlin.Int? = null, + val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ - var status: Order.Status? = null, - var complete: kotlin.Boolean? = false + val status: Order.Status? = null, + val complete: kotlin.Boolean? = false ) { /** diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index e80d49fc3f5..6061c8e0154 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -30,13 +30,13 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Pet ( - @SerializedName("name") private var _name: kotlin.String?, - @SerializedName("photoUrls") private var _photoUrls: kotlin.Array?, - var id: kotlin.Long? = null, - var category: Category? = null, - var tags: kotlin.Array? = null, + @SerializedName("name") private val _name: kotlin.String?, + @SerializedName("photoUrls") private val _photoUrls: kotlin.Array?, + val id: kotlin.Long? = null, + val category: Category? = null, + val tags: kotlin.Array? = null, /* pet status in the store */ - var status: Pet.Status? = null + val status: Pet.Status? = null ) { /** @@ -53,9 +53,9 @@ data class Pet ( } - var name get() = _name ?: throw IllegalArgumentException("name is required") - set(value){ _name = value } - var photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") - set(value){ _photoUrls = value } + val name get() = _name ?: throw IllegalArgumentException("name is required") + + val photoUrls get() = _photoUrls ?: throw IllegalArgumentException("photoUrls is required") + } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt index 359a53af609..b444b341a9e 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Tag.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class Tag ( - var id: kotlin.Long? = null, - var name: kotlin.String? = null + val id: kotlin.Long? = null, + val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt index 791d0b88233..e8b5bb5e705 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/User.kt @@ -30,15 +30,15 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) data class User ( - var id: kotlin.Long? = null, - var username: kotlin.String? = null, - var firstName: kotlin.String? = null, - var lastName: kotlin.String? = null, - var email: kotlin.String? = null, - var password: kotlin.String? = null, - var phone: kotlin.String? = null, + val id: kotlin.Long? = null, + val username: kotlin.String? = null, + val firstName: kotlin.String? = null, + val lastName: kotlin.String? = null, + val email: kotlin.String? = null, + val password: kotlin.String? = null, + val phone: kotlin.String? = null, /* User Status */ - var userStatus: kotlin.Int? = null + val userStatus: kotlin.Int? = null ) { } From 2d927a738b1758c2213464e10985ee5124a091c6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 19 Jan 2022 18:43:39 +0800 Subject: [PATCH 065/113] Improve example value handling in C# generators (#11355) * improve example value handling in C# generators * fix typo * update samples --- .../languages/AbstractCSharpCodegen.java | 150 ++++++++++++++---- .../docs/MultipartApi.md | 4 +- .../docs/FakeApi.md | 44 ++--- .../docs/PetApi.md | 24 +-- .../docs/StoreApi.md | 4 +- .../docs/UserApi.md | 10 +- .../OpenAPIClient-httpclient/docs/FakeApi.md | 44 ++--- .../OpenAPIClient-httpclient/docs/PetApi.md | 24 +-- .../OpenAPIClient-httpclient/docs/StoreApi.md | 4 +- .../OpenAPIClient-httpclient/docs/UserApi.md | 10 +- .../OpenAPIClient-net47/docs/FakeApi.md | 44 ++--- .../OpenAPIClient-net47/docs/PetApi.md | 24 +-- .../OpenAPIClient-net47/docs/StoreApi.md | 4 +- .../OpenAPIClient-net47/docs/UserApi.md | 10 +- .../OpenAPIClient-net5.0/docs/FakeApi.md | 44 ++--- .../OpenAPIClient-net5.0/docs/PetApi.md | 24 +-- .../OpenAPIClient-net5.0/docs/StoreApi.md | 4 +- .../OpenAPIClient-net5.0/docs/UserApi.md | 10 +- .../OpenAPIClient/docs/FakeApi.md | 44 ++--- .../OpenAPIClient/docs/PetApi.md | 24 +-- .../OpenAPIClient/docs/StoreApi.md | 4 +- .../OpenAPIClient/docs/UserApi.md | 10 +- .../OpenAPIClientCore/docs/FakeApi.md | 44 ++--- .../OpenAPIClientCore/docs/PetApi.md | 24 +-- .../OpenAPIClientCore/docs/StoreApi.md | 4 +- .../OpenAPIClientCore/docs/UserApi.md | 10 +- .../OpenAPIClientCoreAndNet47/docs/PetApi.md | 18 +-- .../docs/StoreApi.md | 4 +- .../OpenAPIClientCoreAndNet47/docs/UserApi.md | 10 +- .../csharp/OpenAPIClient/docs/FakeApi.md | 52 +++--- .../csharp/OpenAPIClient/docs/PetApi.md | 24 +-- .../csharp/OpenAPIClient/docs/StoreApi.md | 4 +- .../csharp/OpenAPIClient/docs/UserApi.md | 10 +- 33 files changed, 425 insertions(+), 343 deletions(-) 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 2a8977310f7..bb8f9901765 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 @@ -1261,42 +1261,124 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } @Override - public void setParameterExampleValue(CodegenParameter codegenParameter) { + public void setParameterExampleValue(CodegenParameter p) { + String example; - // set the example value - // if not specified in x-example, generate a default value - // TODO need to revise how to obtain the example value - if (codegenParameter.vendorExtensions != null && codegenParameter.vendorExtensions.containsKey("x-example")) { - codegenParameter.example = Json.pretty(codegenParameter.vendorExtensions.get("x-example")); - } else if (Boolean.TRUE.equals(codegenParameter.isBoolean)) { - codegenParameter.example = "true"; - } else if (Boolean.TRUE.equals(codegenParameter.isLong)) { - codegenParameter.example = "789"; - } else if (Boolean.TRUE.equals(codegenParameter.isInteger)) { - codegenParameter.example = "56"; - } else if (Boolean.TRUE.equals(codegenParameter.isFloat)) { - codegenParameter.example = "3.4F"; - } else if (Boolean.TRUE.equals(codegenParameter.isDouble)) { - codegenParameter.example = "1.2D"; - } else if (Boolean.TRUE.equals(codegenParameter.isNumber)) { - codegenParameter.example = "8.14"; - } else if (Boolean.TRUE.equals(codegenParameter.isBinary)) { - codegenParameter.example = "BINARY_DATA_HERE"; - } else if (Boolean.TRUE.equals(codegenParameter.isByteArray)) { - codegenParameter.example = "BYTE_ARRAY_DATA_HERE"; - } else if (Boolean.TRUE.equals(codegenParameter.isFile)) { - codegenParameter.example = "/path/to/file.txt"; - } else if (Boolean.TRUE.equals(codegenParameter.isDate)) { - codegenParameter.example = "2013-10-20"; - } else if (Boolean.TRUE.equals(codegenParameter.isDateTime)) { - codegenParameter.example = "2013-10-20T19:20:30+01:00"; - } else if (Boolean.TRUE.equals(codegenParameter.isUuid)) { - codegenParameter.example = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; - } else if (Boolean.TRUE.equals(codegenParameter.isUri)) { - codegenParameter.example = "https://openapi-generator.tech"; - } else if (Boolean.TRUE.equals(codegenParameter.isString)) { - codegenParameter.example = codegenParameter.paramName + "_example"; + boolean hasAllowableValues = p.allowableValues != null && !p.allowableValues.isEmpty(); + if (hasAllowableValues) { + //support examples for inline enums + final List values = (List) p.allowableValues.get("values"); + example = String.valueOf(values.get(0)); + } else if (p.defaultValue == null) { + example = p.example; + } else { + example = p.defaultValue; } + + String type = p.baseType; + if (type == null) { + type = p.dataType; + } + + if (p.isString) { + if (example == null) { + example = p.paramName + "_example"; + } + example = "\"" + escapeText(example) + "\""; + } else if (p.isInteger || p.isShort) { + if (example == null) { + example = "56"; + } + } else if (p.isLong) { + if (example == null) { + example = "789"; + } + example = StringUtils.appendIfMissingIgnoreCase(example, "L"); + } else if (p.isFloat) { + if (example == null) { + example = "3.4F"; + } + example = StringUtils.appendIfMissingIgnoreCase(example, "F"); + } else if (p.isDouble) { + if (example == null) { + example = "1.2D"; + } + example = StringUtils.appendIfMissingIgnoreCase(example, "D"); + } else if (p.isNumber) { + if (example == null) { + example = "8.14"; + } + example = StringUtils.appendIfMissingIgnoreCase(example, "D"); + } else if (p.isBoolean) { + if (example == null) { + example = "true"; + } + } else if (p.isBinary || p.isFile) { + if (example == null) { + example = "/path/to/file.txt"; + } + example = "new System.IO.MemoryStream(System.IO.File.ReadAllBytes(\"" + escapeText(example) + "\"))"; + } else if (p.isByteArray) { + if (example == null) { + example = "BYTE_ARRAY_DATA_HERE"; + } + example = "System.Text.Encoding.ASCII.GetBytes(\"" + escapeText(example) + "\")"; + } else if (p.isDate) { + if (example == null) { + example = "DateTime.Parse(\"2013-10-20\")"; + } else { + example = "DateTime.Parse(\"" + example + "\")"; + } + } else if (p.isDateTime) { + if (example == null) { + example = "DateTime.Parse(\"2013-10-20T19:20:30+01:00\")"; + } else { + example = "DateTime.Parse(\"" + example + "\")"; + } + } else if (p.isDecimal) { + if (example == null) { + example = "8.9M"; + } + example = StringUtils.appendIfMissingIgnoreCase(example, "M"); + } else if (p.isUuid) { + if (example == null) { + example = "\"38400000-8cf0-11bd-b23e-10b96e4ef00d\""; + } else { + example = "\"" + example + "\""; + } + } else if (p.isUri) { + if (example == null) { + example = "new Uri(\"https://openapi-generator.tech\")"; + } else { + example = "new Uri(\"" + example + "\")"; + } + } else if (hasAllowableValues) { + //parameter is enum defined as a schema component + example = "(" + type + ") \"" + example + "\""; + } else if (!languageSpecificPrimitives.contains(type)) { + // type is a model class, e.g. User + example = "new " + type + "()"; + } + + if (example == null) { + example = "null"; + } else if (Boolean.TRUE.equals(p.isArray)) { + if (p.items.defaultValue != null) { + String innerExample; + if ("String".equals(p.items.dataType)) { + innerExample = "\"" + p.items.defaultValue + "\""; + } else { + innerExample = p.items.defaultValue; + } + example = "new List<" + p.items.dataType + ">({" + innerExample + "})"; + } else { + example = "new List<" + p.items.dataType + ">()"; + } + } else if (Boolean.TRUE.equals(p.isMap)) { + example = "new Dictionary"; + } + + p.example = example; } @Override diff --git a/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md b/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md index dbf9ae08743..c16dc5314f5 100644 --- a/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md +++ b/samples/client/others/csharp-netcore-complex-files/docs/MultipartApi.md @@ -103,7 +103,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://localhost"; var apiInstance = new MultipartApi(config); - var file = BINARY_DATA_HERE; // System.IO.Stream | a file + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | a file var marker = new MultipartMixedMarker(); // MultipartMixedMarker | (optional) try @@ -174,7 +174,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://localhost"; var apiInstance = new MultipartApi(config); - var file = BINARY_DATA_HERE; // System.IO.Stream | One file (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | One file (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md index 87c4c957148..8a5cb9aaf42 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md @@ -251,7 +251,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -321,7 +321,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -669,20 +669,20 @@ namespace Example config.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(config); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -767,13 +767,13 @@ namespace Example config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -856,10 +856,10 @@ namespace Example var apiInstance = new FakeApi(config); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1000,8 +1000,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/PetApi.md index aa5cd9f497b..f429575063c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/PetApi.md @@ -112,8 +112,8 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -339,7 +339,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -486,9 +486,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -561,9 +561,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { @@ -637,9 +637,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/StoreApi.md index 24e2480d5de..963ecda9c14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/StoreApi.md @@ -35,7 +35,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -178,7 +178,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/UserApi.md index aa12c26c69f..2f478081dc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/UserApi.md @@ -245,7 +245,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -314,7 +314,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -385,8 +385,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md index 635f38544d5..42e8aea5310 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md @@ -267,7 +267,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -341,7 +341,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -555,7 +555,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -709,20 +709,20 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // FileParameter | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // FileParameter | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -811,13 +811,13 @@ namespace Example HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -904,10 +904,10 @@ namespace Example var apiInstance = new FakeApi(httpClient, config, httpClientHandler); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1056,8 +1056,8 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/PetApi.md index 43033c45b59..505380841a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/PetApi.md @@ -120,8 +120,8 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new PetApi(httpClient, config, httpClientHandler); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -359,7 +359,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new PetApi(httpClient, config, httpClientHandler); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -514,9 +514,9 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new PetApi(httpClient, config, httpClientHandler); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -593,9 +593,9 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new PetApi(httpClient, config, httpClientHandler); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // FileParameter | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // FileParameter | file to upload (optional) try { @@ -673,9 +673,9 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new PetApi(httpClient, config, httpClientHandler); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // FileParameter | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // FileParameter | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/StoreApi.md index 248bf31f849..44bf0ce59ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/StoreApi.md @@ -39,7 +39,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new StoreApi(httpClient, config, httpClientHandler); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -190,7 +190,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new StoreApi(httpClient, config, httpClientHandler); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/UserApi.md index 417d9002cf9..fe9ac2db818 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/UserApi.md @@ -261,7 +261,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new UserApi(httpClient, config, httpClientHandler); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -334,7 +334,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new UserApi(httpClient, config, httpClientHandler); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -409,8 +409,8 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new UserApi(httpClient, config, httpClientHandler); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -555,7 +555,7 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new UserApi(httpClient, config, httpClientHandler); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md index 87c4c957148..8a5cb9aaf42 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md @@ -251,7 +251,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -321,7 +321,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -669,20 +669,20 @@ namespace Example config.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(config); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -767,13 +767,13 @@ namespace Example config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -856,10 +856,10 @@ namespace Example var apiInstance = new FakeApi(config); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1000,8 +1000,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/PetApi.md index aa5cd9f497b..f429575063c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/PetApi.md @@ -112,8 +112,8 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -339,7 +339,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -486,9 +486,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -561,9 +561,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { @@ -637,9 +637,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/StoreApi.md index 24e2480d5de..963ecda9c14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/StoreApi.md @@ -35,7 +35,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -178,7 +178,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/UserApi.md index aa12c26c69f..2f478081dc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/UserApi.md @@ -245,7 +245,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -314,7 +314,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -385,8 +385,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md index 87c4c957148..8a5cb9aaf42 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md @@ -251,7 +251,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -321,7 +321,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -669,20 +669,20 @@ namespace Example config.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(config); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -767,13 +767,13 @@ namespace Example config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -856,10 +856,10 @@ namespace Example var apiInstance = new FakeApi(config); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1000,8 +1000,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/PetApi.md index aa5cd9f497b..f429575063c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/PetApi.md @@ -112,8 +112,8 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -339,7 +339,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -486,9 +486,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -561,9 +561,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { @@ -637,9 +637,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/StoreApi.md index 24e2480d5de..963ecda9c14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/StoreApi.md @@ -35,7 +35,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -178,7 +178,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/UserApi.md index aa12c26c69f..2f478081dc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/UserApi.md @@ -245,7 +245,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -314,7 +314,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -385,8 +385,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md index 87c4c957148..8a5cb9aaf42 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md @@ -251,7 +251,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -321,7 +321,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -669,20 +669,20 @@ namespace Example config.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(config); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -767,13 +767,13 @@ namespace Example config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -856,10 +856,10 @@ namespace Example var apiInstance = new FakeApi(config); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1000,8 +1000,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md index aa5cd9f497b..f429575063c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md @@ -112,8 +112,8 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -339,7 +339,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -486,9 +486,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -561,9 +561,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { @@ -637,9 +637,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md index 24e2480d5de..963ecda9c14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md @@ -35,7 +35,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -178,7 +178,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md index aa12c26c69f..2f478081dc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md @@ -245,7 +245,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -314,7 +314,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -385,8 +385,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md index 87c4c957148..8a5cb9aaf42 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md @@ -251,7 +251,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -321,7 +321,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -669,20 +669,20 @@ namespace Example config.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(config); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse(""2010-02-01T10:20:10.111110+01:00""); // DateTime? | None (optional) (default to "2010-02-01T10:20:10.111110+01:00") + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -767,13 +767,13 @@ namespace Example config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -856,10 +856,10 @@ namespace Example var apiInstance = new FakeApi(config); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1000,8 +1000,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md index aa5cd9f497b..f429575063c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md @@ -112,8 +112,8 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -339,7 +339,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -486,9 +486,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -561,9 +561,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { @@ -637,9 +637,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md index 24e2480d5de..963ecda9c14 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md @@ -35,7 +35,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -178,7 +178,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(config); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md index aa12c26c69f..2f478081dc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md @@ -245,7 +245,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -314,7 +314,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -385,8 +385,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -523,7 +523,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/PetApi.md index 4baa360aa75..109fec4f411 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/PetApi.md @@ -113,8 +113,8 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -340,7 +340,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -489,9 +489,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -564,9 +564,9 @@ namespace Example config.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(config); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/StoreApi.md index 8b1ba130f4c..a3c7f1f92be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/StoreApi.md @@ -35,7 +35,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new StoreApi(config); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -178,7 +178,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new StoreApi(config); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/UserApi.md index b7d26019ae9..39895547686 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/docs/UserApi.md @@ -265,7 +265,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -334,7 +334,7 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -405,8 +405,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io/v2"; var apiInstance = new UserApi(config); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -553,7 +553,7 @@ namespace Example // config.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new UserApi(config); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index b38dea5dd37..93a9e0afbf0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -119,8 +119,8 @@ namespace Example var apiInstance = new FakeApi(Configuration.Default); var pet = new Pet(); // Pet | Pet object that needs to be added to the store - var query1 = query1_example; // string | query parameter (optional) - var header1 = header1_example; // string | header parameter (optional) + var query1 = "query1_example"; // string | query parameter (optional) + var header1 = "header1_example"; // string | header parameter (optional) try { @@ -347,7 +347,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14D; // decimal? | Input number as post body (optional) try { @@ -422,7 +422,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var body = body_example; // string | Input string as post body (optional) + var body = "body_example"; // string | Input string as post body (optional) try { @@ -572,7 +572,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var body = BINARY_DATA_HERE; // System.IO.Stream | image to upload + var body = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | image to upload try { @@ -718,7 +718,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var query = query_example; // string | + var query = "query_example"; // string | var user = new User(); // User | try @@ -874,20 +874,20 @@ namespace Example Configuration.Default.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(Configuration.Default); - var number = 8.14; // decimal | None + var number = 8.14D; // decimal | None var _double = 1.2D; // double | None - var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None - var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None + var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // string | None + var _byte = System.Text.Encoding.ASCII.GetBytes("BYTE_ARRAY_DATA_HERE"); // byte[] | None var integer = 56; // int? | None (optional) var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) + var int64 = 789L; // long? | None (optional) var _float = 3.4F; // float? | None (optional) - var _string = _string_example; // string | None (optional) - var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) - var password = password_example; // string | None (optional) - var callback = callback_example; // string | None (optional) + var _string = "_string_example"; // string | None (optional) + var binary = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | None (optional) + var date = DateTime.Parse("2013-10-20"); // DateTime? | None (optional) + var dateTime = DateTime.Parse("2013-10-20T19:20:30+01:00"); // DateTime? | None (optional) + var password = "password_example"; // string | None (optional) + var callback = "callback_example"; // string | None (optional) try { @@ -977,13 +977,13 @@ namespace Example Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) - var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) + var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = new List(); // List | Query parameter enum test (string array) (optional) - var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryString = "_abc"; // string | Query parameter enum test (string) (optional) (default to -efg) + var enumQueryInteger = 1; // int? | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.1D; // double? | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) - var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) + var enumFormString = "_abc"; // string | Form parameter enum test (string) (optional) (default to -efg) try { @@ -1071,10 +1071,10 @@ namespace Example var apiInstance = new FakeApi(Configuration.Default); var requiredStringGroup = 56; // int | Required String in group parameters var requiredBooleanGroup = true; // bool | Required Boolean in group parameters - var requiredInt64Group = 789; // long | Required Integer in group parameters + var requiredInt64Group = 789L; // long | Required Integer in group parameters var stringGroup = 56; // int? | String in group parameters (optional) var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var int64Group = 789L; // long? | Integer in group parameters (optional) try { @@ -1225,8 +1225,8 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var param = param_example; // string | field1 - var param2 = param2_example; // string | field2 + var param = "param_example"; // string | field1 + var param2 = "param2_example"; // string | field2 try { @@ -1307,7 +1307,7 @@ namespace Example var http = new List(); // List | var url = new List(); // List | var context = new List(); // List | - var allowEmpty = allowEmpty_example; // string | + var allowEmpty = "allowEmpty_example"; // string | var language = new Dictionary(); // Dictionary | (optional) try diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md index 8675820ce21..b02d582adc1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md @@ -119,8 +119,8 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long | Pet id to delete - var apiKey = apiKey_example; // string | (optional) + var petId = 789L; // long | Pet id to delete + var apiKey = "apiKey_example"; // string | (optional) try { @@ -362,7 +362,7 @@ namespace Example // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long | ID of pet to return + var petId = 789L; // long | ID of pet to return try { @@ -520,9 +520,9 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long | ID of pet that needs to be updated - var name = name_example; // string | Updated name of the pet (optional) - var status = status_example; // string | Updated status of the pet (optional) + var petId = 789L; // long | ID of pet that needs to be updated + var name = "name_example"; // string | Updated name of the pet (optional) + var status = "status_example"; // string | Updated status of the pet (optional) try { @@ -601,9 +601,9 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long | ID of pet to update - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + var petId = 789L; // long | ID of pet to update + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) + var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional) try { @@ -682,9 +682,9 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long | ID of pet to update - var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload - var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var petId = 789L; // long | ID of pet to update + var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload + var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional) try { diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md index eac4f3fcafc..3a452bc4d69 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md @@ -36,7 +36,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(Configuration.Default); - var orderId = orderId_example; // string | ID of the order that needs to be deleted + var orderId = "orderId_example"; // string | ID of the order that needs to be deleted try { @@ -189,7 +189,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(Configuration.Default); - var orderId = 789; // long | ID of pet that needs to be fetched + var orderId = 789L; // long | ID of pet that needs to be fetched try { diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md index 611bd412da5..5bd0898eac1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md @@ -261,7 +261,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(Configuration.Default); - var username = username_example; // string | The name that needs to be deleted + var username = "username_example"; // string | The name that needs to be deleted try { @@ -335,7 +335,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(Configuration.Default); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -411,8 +411,8 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(Configuration.Default); - var username = username_example; // string | The user name for login - var password = password_example; // string | The password for login in clear text + var username = "username_example"; // string | The user name for login + var password = "password_example"; // string | The password for login in clear text try { @@ -559,7 +559,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new UserApi(Configuration.Default); - var username = username_example; // string | name that need to be deleted + var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object try From 55ffdb791f14cc3aa2f4db00ad82ea94d6edcc11 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 21 Jan 2022 16:36:19 +0800 Subject: [PATCH 066/113] mark retry class as static (#11369) --- .../csharp-netcore/RetryConfiguration.mustache | 4 +++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- .../Org.OpenAPITools/Client/RetryConfiguration.cs | 12 +++++++++++- 9 files changed, 91 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/RetryConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/RetryConfiguration.mustache index 29aa6092681..4cc953487a8 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/RetryConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/RetryConfiguration.mustache @@ -1,3 +1,5 @@ +{{>partial_header}} + using Polly; {{#useRestSharp}} using RestSharp; @@ -11,7 +13,7 @@ namespace {{packageName}}.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { {{#useRestSharp}} /// diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..f589a4482da 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * MultipartFile test + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..91bc7cc6d54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RetryConfiguration.cs index 285b6dac105..139ef334aa0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + + using Polly; using System.Net.Http; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..91bc7cc6d54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..91bc7cc6d54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..91bc7cc6d54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..91bc7cc6d54 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RetryConfiguration.cs index c93633a36d9..92d8f878ca0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RetryConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Polly; using RestSharp; @@ -6,7 +16,7 @@ namespace Org.OpenAPITools.Client /// /// Configuration class to set the polly retry policies to be applied to the requests. /// - public class RetryConfiguration + public static class RetryConfiguration { /// /// Retry policy From 93488f41959b00a7ceb011b05430208d7216e825 Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:54:09 +0100 Subject: [PATCH 067/113] Resolve several issues in generated Go code (#8491) * [go] use regular stdlib import names * [go] support primitive oneOf types See #8489 * [go] improve pbv/pbr handling Improves the way pass-by-value and pass-by-reference variables are used. Closes #8489 * [go] improve generated documentation * [go] adopt pointer changes in interface * [go] regenerate sample * [go] resolve pointer issues * [go] regenerate clients and avoid pointers on primitive return values * [go] improve Exec() return value handling * [go] regernate files * [go] use go modules * [go] properly handle polymorph decode If polymorphism without discriminator was used, the previous code was unable to properly decode the vaules. By using a strict decoder, which rejects unknown fields, type guessing now works. * [go] make GetActualInstance not panic on nil * [go] return GenericOpenAPIError as pointer * [go] clarify helper function godoc * [go] address test regression error type * [go] regenerate go samples * [go] resolve go mod issues and test regressions * [go] resolve merge conflicts and regenerate * [go] resolve merge conflicts * [go] Replace spaces with tabs Co-authored-by: Jiri Kuncar * [go] Replace spaces with tabs Co-authored-by: Jiri Kuncar Co-authored-by: Jiri Kuncar --- .../src/main/resources/go/README.mustache | 14 +- .../src/main/resources/go/api.mustache | 53 +- .../src/main/resources/go/api_doc.mustache | 4 +- .../src/main/resources/go/client.mustache | 7 + .../src/main/resources/go/go.mod.mustache | 2 +- .../main/resources/go/model_oneof.mustache | 35 +- .../main/resources/go/model_simple.mustache | 18 +- .../main/resources/go/nullable_model.mustache | 8 +- samples/client/petstore/go/auth_test.go | 18 +- samples/client/petstore/go/fake_api_test.go | 4 +- .../client/petstore/go/go-petstore/README.md | 10 +- .../go/go-petstore/api_another_fake.go | 44 +- .../petstore/go/go-petstore/api_fake.go | 446 ++++++++-------- .../go-petstore/api_fake_classname_tags123.go | 44 +- .../client/petstore/go/go-petstore/api_pet.go | 310 +++++------ .../petstore/go/go-petstore/api_store.go | 144 +++--- .../petstore/go/go-petstore/api_user.go | 262 +++++----- .../client/petstore/go/go-petstore/client.go | 7 + .../go/go-petstore/docs/AnotherFakeApi.md | 4 +- .../petstore/go/go-petstore/docs/FakeApi.md | 56 +- .../docs/FakeClassnameTags123Api.md | 4 +- .../petstore/go/go-petstore/docs/PetApi.md | 36 +- .../petstore/go/go-petstore/docs/StoreApi.md | 16 +- .../petstore/go/go-petstore/docs/UserApi.md | 32 +- samples/client/petstore/go/go-petstore/go.mod | 2 +- .../model_additional_properties_class.go | 24 +- .../model_array_of_array_of_number_only.go | 8 +- .../go-petstore/model_array_of_number_only.go | 8 +- .../go/go-petstore/model_array_test_.go | 24 +- .../go/go-petstore/model_enum_arrays.go | 8 +- .../model_file_schema_test_class.go | 8 +- .../petstore/go/go-petstore/model_pet.go | 12 +- .../go-petstore/model_type_holder_default.go | 4 +- .../go-petstore/model_type_holder_example.go | 4 +- .../petstore/go/go-petstore/model_xml_item.go | 72 +-- samples/client/petstore/go/go.mod | 11 + samples/client/petstore/go/go.sum | 371 ++++++++++++++ .../client/petstore/go/mock/mock_api_pet.go | 26 +- samples/client/petstore/go/pet_api_test.go | 8 +- samples/client/petstore/go/store_api_test.go | 2 +- samples/client/petstore/go/user_api_test.go | 10 +- .../x-auth-id-alias/go-experimental/README.md | 10 +- .../go-experimental/api_usage.go | 114 ++--- .../x-auth-id-alias/go-experimental/client.go | 7 + .../go-experimental/docs/UsageApi.md | 16 +- .../x-auth-id-alias/go-experimental/go.mod | 2 +- .../openapi3/client/petstore/go/auth_test.go | 18 +- .../client/petstore/go/fake_api_test.go | 4 +- .../client/petstore/go/go-petstore/README.md | 14 +- .../go/go-petstore/api_another_fake.go | 44 +- .../petstore/go/go-petstore/api_default.go | 44 +- .../petstore/go/go-petstore/api_fake.go | 482 +++++++++--------- .../go-petstore/api_fake_classname_tags123.go | 44 +- .../client/petstore/go/go-petstore/api_pet.go | 310 +++++------ .../petstore/go/go-petstore/api_store.go | 144 +++--- .../petstore/go/go-petstore/api_user.go | 262 +++++----- .../client/petstore/go/go-petstore/client.go | 7 + .../go/go-petstore/docs/AnotherFakeApi.md | 4 +- .../go/go-petstore/docs/DefaultApi.md | 4 +- .../petstore/go/go-petstore/docs/FakeApi.md | 60 +-- .../docs/FakeClassnameTags123Api.md | 4 +- .../petstore/go/go-petstore/docs/PetApi.md | 36 +- .../petstore/go/go-petstore/docs/StoreApi.md | 16 +- .../petstore/go/go-petstore/docs/UserApi.md | 32 +- .../client/petstore/go/go-petstore/go.mod | 2 +- .../model_array_of_array_of_number_only.go | 8 +- .../go-petstore/model_array_of_number_only.go | 8 +- .../go/go-petstore/model_array_test_.go | 24 +- .../go/go-petstore/model_enum_arrays.go | 8 +- .../model_file_schema_test_class.go | 8 +- .../petstore/go/go-petstore/model_fruit.go | 15 +- .../go/go-petstore/model_fruit_req.go | 15 +- .../go/go-petstore/model_inline_object.go | 4 +- .../go/go-petstore/model_inline_object_1.go | 4 +- .../go/go-petstore/model_inline_object_2.go | 4 +- .../go/go-petstore/model_inline_object_3.go | 22 +- .../go/go-petstore/model_inline_object_4.go | 14 +- .../go/go-petstore/model_inline_object_5.go | 10 +- .../petstore/go/go-petstore/model_mammal.go | 15 +- .../go/go-petstore/model_nullable_class.go | 32 +- .../model_outer_object_with_enum_property.go | 4 +- .../petstore/go/go-petstore/model_pet.go | 12 +- .../petstore/go/go-petstore/model_user.go | 12 +- samples/openapi3/client/petstore/go/go.mod | 11 + samples/openapi3/client/petstore/go/go.sum | 371 ++++++++++++++ .../client/petstore/go/http_signature_test.go | 4 +- .../openapi3/client/petstore/go/model_test.go | 2 +- .../petstore/go/nullable_marshalling_test.go | 118 ++--- .../client/petstore/go/pet_api_test.go | 6 +- .../client/petstore/go/store_api_test.go | 2 +- .../client/petstore/go/user_api_test.go | 10 +- 91 files changed, 2705 insertions(+), 1898 deletions(-) create mode 100644 samples/client/petstore/go/go.mod create mode 100644 samples/client/petstore/go/go.sum create mode 100644 samples/openapi3/client/petstore/go/go.mod create mode 100644 samples/openapi3/client/petstore/go/go.sum diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index e6d140d28b2..b00e98e55cb 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -30,7 +30,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./{{packageName}}" +import {{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" ``` To use a proxy, set the environment variable `HTTP_PROXY`: @@ -48,7 +48,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerIndex, 1) ``` ### Templated Server URL @@ -56,7 +56,7 @@ ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -70,10 +70,10 @@ An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. ``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +ctx := context.WithValue(context.Background(), {{packageName}}.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), {{packageName}}.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, @@ -117,7 +117,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example ```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` @@ -142,7 +142,7 @@ r, err := client.Service.Operation(auth, args) Example ```golang - authConfig := sw.HttpSignatureAuth{ + authConfig := client.HttpSignatureAuth{ KeyId: "my-key-id", PrivateKeyPath: "rsa.pem", Passphrase: "my-passphrase", diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 4a94d6aaf59..f7a31797b01 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -4,17 +4,17 @@ package {{packageName}} {{#operations}} import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" {{#imports}} "{{import}}" {{/imports}} ) // Linger please var ( - _ _context.Context + _ context.Context ) {{#generateInterfaces}} @@ -28,7 +28,7 @@ type {{classname}} interface { {{{unescapedNotes}}} {{/notes}} - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request {{#isDeprecated}} @@ -36,14 +36,14 @@ type {{classname}} interface { Deprecated {{/isDeprecated}} */ - {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request + {{{nickname}}}(ctx context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request // {{nickname}}Execute executes the request{{#returnType}} // @return {{{.}}}{{/returnType}} {{#isDeprecated}} // Deprecated {{/isDeprecated}} - {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) + {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) {{/operation}} } {{/generateInterfaces}} @@ -53,8 +53,11 @@ type {{classname}}Service service {{#operation}} type {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request struct { - ctx _context.Context - ApiService {{#generateInterfaces}}{{classname}}{{/generateInterfaces}}{{^generateInterfaces}}*{{classname}}Service{{/generateInterfaces}} + ctx context.Context{{#generateInterfaces}} + ApiService {{classname}} +{{/generateInterfaces}}{{^generateInterfaces}} + ApiService *{{classname}}Service +{{/generateInterfaces}} {{#allParams}} {{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}} {{/allParams}} @@ -71,7 +74,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Reques return r }{{/isPathParam}}{{/allParams}} -func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) { return r.ApiService.{{nickname}}Execute(r) } @@ -82,7 +85,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Reques {{{unescapedNotes}}} {{/notes}} - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request {{#isDeprecated}} @@ -90,7 +93,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Reques Deprecated {{/isDeprecated}} */ -func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request{ ApiService: a, ctx: ctx, @@ -105,27 +108,27 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParam {{#isDeprecated}} // Deprecated {{/isDeprecated}} -func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { +func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.Method{{httpMethod}} + localVarHTTPMethod = http.Method{{httpMethod}} localVarPostBody interface{} formFiles []formFile {{#returnType}} - localVarReturnValue {{{.}}} + localVarReturnValue {{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}} {{/returnType}} ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, GenericOpenAPIError{error: err.Error()} + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString(r.{{paramName}}, "{{collectionFormat}}")), -1){{/pathParams}} + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", url.PathEscape(parameterToString(r.{{paramName}}, "{{collectionFormat}}")), -1){{/pathParams}} localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} {{#allParams}} {{#required}} {{^isPathParam}} @@ -265,7 +268,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class } {{/required}} if {{paramName}}LocalVarFile != nil { - fbs, _ := _ioutil.ReadAll({{paramName}}LocalVarFile) + fbs, _ := ioutil.ReadAll({{paramName}}LocalVarFile) {{paramName}}LocalVarFileBytes = fbs {{paramName}}LocalVarFileName = {{paramName}}LocalVarFile.Name() {{paramName}}LocalVarFile.Close() @@ -344,15 +347,15 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -399,7 +402,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{#returnType}} err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/modules/openapi-generator/src/main/resources/go/api_doc.mustache b/modules/openapi-generator/src/main/resources/go/api_doc.mustache index c99fff852bb..c9927461bda 100644 --- a/modules/openapi-generator/src/main/resources/go/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/api_doc.mustache @@ -41,8 +41,8 @@ func main() { {{/allParams}} configuration := {{goImportAlias}}.NewConfiguration() - api_client := {{goImportAlias}}.NewAPIClient(configuration) - resp, r, err := api_client.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() + apiClient := {{goImportAlias}}.NewAPIClient(configuration) + resp, r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 609b362a862..8b9e173fe01 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -477,6 +477,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { diff --git a/modules/openapi-generator/src/main/resources/go/go.mod.mustache b/modules/openapi-generator/src/main/resources/go/go.mod.mustache index 97fceb03a92..c7e0fe117e3 100644 --- a/modules/openapi-generator/src/main/resources/go/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go/go.mod.mustache @@ -3,7 +3,7 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}} go 1.13 require ( - golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 {{#withAWSV4Signature}} github.com/aws/aws-sdk-go v1.34.14 {{/withAWSV4Signature}} diff --git a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache index 6938308d763..dc85c438f10 100644 --- a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache @@ -1,14 +1,16 @@ // {{classname}} - {{{description}}}{{^description}}struct for {{{classname}}}{{/description}} type {{classname}} struct { {{#oneOf}} - {{{.}}} *{{{.}}} + {{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} *{{{.}}} {{/oneOf}} } {{#oneOf}} // {{{.}}}As{{classname}} is a convenience function that returns {{{.}}} wrapped in {{classname}} -func {{{.}}}As{{classname}}(v *{{{.}}}) {{classname}} { - return {{classname}}{ {{{.}}}: v} +func {{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}As{{classname}}(v *{{{.}}}) {{classname}} { + return {{classname}}{ + {{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}: v, + } } {{/oneOf}} @@ -29,7 +31,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { {{#-first}} // use discriminator value to speed up the lookup var jsonDict map[string]interface{} - err = json.Unmarshal(data, &jsonDict) + err = newStrictDecoder(data).Decode(&jsonDict) if err != nil { return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") } @@ -84,24 +86,24 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { {{^useOneOfDiscriminatorLookup}} match := 0 {{#oneOf}} - // try to unmarshal data into {{{.}}} - err = json.Unmarshal(data, &dst.{{{.}}}) + // try to unmarshal data into {{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} + err = newStrictDecoder(data).Decode(&dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}) if err == nil { - json{{{.}}}, _ := json.Marshal(dst.{{{.}}}) - if string(json{{{.}}}) == "{}" { // empty struct - dst.{{{.}}} = nil + json{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}, _ := json.Marshal(dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}) + if string(json{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}) == "{}" { // empty struct + dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} = nil } else { match++ } } else { - dst.{{{.}}} = nil + dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} = nil } {{/oneOf}} if match > 1 { // more than 1 match // reset to nil {{#oneOf}} - dst.{{{.}}} = nil + dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} = nil {{/oneOf}} return fmt.Errorf("Data matches more than one schema in oneOf({{classname}})") @@ -116,8 +118,8 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src {{classname}}) MarshalJSON() ([]byte, error) { {{#oneOf}} - if src.{{{.}}} != nil { - return json.Marshal(&src.{{{.}}}) + if src.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} != nil { + return json.Marshal(&src.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}) } {{/oneOf}} @@ -126,9 +128,12 @@ func (src {{classname}}) MarshalJSON() ([]byte, error) { // Get the actual instance func (obj *{{classname}}) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } {{#oneOf}} - if obj.{{{.}}} != nil { - return obj.{{{.}}} + if obj.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} != nil { + return obj.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} } {{/oneOf}} diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index 97884f910b3..feeefee8875 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -19,7 +19,7 @@ type {{classname}} struct { {{#deprecated}} // Deprecated {{/deprecated}} - {{name}} {{^required}}{{^isNullable}}*{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` + {{name}} {{^required}}{{^isNullable}}{{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/vars}} {{#isAdditionalPropertiesTrue}} AdditionalProperties map[string]interface{} @@ -121,20 +121,20 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { {{#deprecated}} // Deprecated {{/deprecated}} -func (o *{{classname}}) Get{{name}}Ok() (*{{vendorExtensions.x-go-base-type}}, bool) { +func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) { if o == nil {{#isNullable}}{{#vendorExtensions.x-golang-is-container}}|| o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { return nil, false } {{#isNullable}} {{#vendorExtensions.x-golang-is-container}} - return &o.{{name}}, true + return {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}o.{{name}}, true {{/vendorExtensions.x-golang-is-container}} {{^vendorExtensions.x-golang-is-container}} return o.{{name}}.Get(), o.{{name}}.IsSet() {{/vendorExtensions.x-golang-is-container}} {{/isNullable}} {{^isNullable}} - return &o.{{name}}, true + return {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}o.{{name}}, true {{/isNullable}} } @@ -176,7 +176,7 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { {{/vendorExtensions.x-golang-is-container}} {{/isNullable}} {{^isNullable}} - return *o.{{name}} + return {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}o.{{name}} {{/isNullable}} } @@ -188,13 +188,13 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { {{#deprecated}} // Deprecated {{/deprecated}} -func (o *{{classname}}) Get{{name}}Ok() (*{{vendorExtensions.x-go-base-type}}, bool) { +func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) { if o == nil {{^isNullable}}|| o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}}|| o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { return nil, false } {{#isNullable}} {{#vendorExtensions.x-golang-is-container}} - return &o.{{name}}, true + return {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}o.{{name}}, true {{/vendorExtensions.x-golang-is-container}} {{^vendorExtensions.x-golang-is-container}} return o.{{name}}.Get(), o.{{name}}.IsSet() @@ -224,11 +224,11 @@ func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}}) { o.{{name}} = v {{/vendorExtensions.x-golang-is-container}} {{^vendorExtensions.x-golang-is-container}} - o.{{name}}.Set(&v) + o.{{name}}.Set({{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}v) {{/vendorExtensions.x-golang-is-container}} {{/isNullable}} {{^isNullable}} - o.{{name}} = &v + o.{{name}} = {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}v {{/isNullable}} } {{#isNullable}} diff --git a/modules/openapi-generator/src/main/resources/go/nullable_model.mustache b/modules/openapi-generator/src/main/resources/go/nullable_model.mustache index 20d35769130..7b60ce6d3a1 100644 --- a/modules/openapi-generator/src/main/resources/go/nullable_model.mustache +++ b/modules/openapi-generator/src/main/resources/go/nullable_model.mustache @@ -1,13 +1,13 @@ type Nullable{{{classname}}} struct { - value *{{{classname}}} + value {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{{classname}}} isSet bool } -func (v Nullable{{classname}}) Get() *{{classname}} { +func (v Nullable{{classname}}) Get() {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{classname}} { return v.value } -func (v *Nullable{{classname}}) Set(val *{{classname}}) { +func (v *Nullable{{classname}}) Set(val {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{classname}}) { v.value = val v.isSet = true } @@ -21,7 +21,7 @@ func (v *Nullable{{classname}}) Unset() { v.isSet = false } -func NewNullable{{classname}}(val *{{classname}}) *Nullable{{classname}} { +func NewNullable{{classname}}(val {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{classname}}) *Nullable{{classname}} { return &Nullable{{classname}}{value: val, isSet: true} } diff --git a/samples/client/petstore/go/auth_test.go b/samples/client/petstore/go/auth_test.go index c35e5b24fbc..94ba6a1526e 100644 --- a/samples/client/petstore/go/auth_test.go +++ b/samples/client/petstore/go/auth_test.go @@ -10,7 +10,7 @@ import ( "golang.org/x/oauth2" - sw "./go-petstore" + sw "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore" ) func TestOAuth2(t *testing.T) { @@ -39,7 +39,7 @@ func TestOAuth2(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() @@ -74,7 +74,7 @@ func TestBasicAuth(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(auth).Body(newPet).Execute() @@ -104,7 +104,7 @@ func TestAccessToken(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() @@ -130,11 +130,11 @@ func TestAccessToken(t *testing.T) { } func TestAPIKeyNoPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": {Key: "TEST123"}}) newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() @@ -165,11 +165,11 @@ func TestAPIKeyNoPrefix(t *testing.T) { } func TestAPIKeyWithPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": {Key: "TEST123", Prefix: "Bearer"}}) newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() @@ -202,7 +202,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { func TestDefaultHeader(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() diff --git a/samples/client/petstore/go/fake_api_test.go b/samples/client/petstore/go/fake_api_test.go index d27137eeacf..9e163fa565f 100644 --- a/samples/client/petstore/go/fake_api_test.go +++ b/samples/client/petstore/go/fake_api_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - sw "./go-petstore" + sw "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore" ) // TestPutBodyWithFileSchema ensures a model with the name 'File' @@ -15,7 +15,7 @@ func TestPutBodyWithFileSchema(t *testing.T) { schema := sw.FileSchemaTestClass{ File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, - Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} + Files: []sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(schema).Execute() diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index d462bd1be83..70d0040a3a6 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -22,7 +22,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./petstore" +import petstore "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: @@ -40,7 +40,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) ``` ### Templated Server URL @@ -48,7 +48,7 @@ ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -62,10 +62,10 @@ An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. ``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), petstore.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index bb5add0ca9f..8199c4fd370 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -12,15 +12,15 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) // Linger please var ( - _ _context.Context + _ context.Context ) type AnotherFakeApi interface { @@ -30,21 +30,21 @@ type AnotherFakeApi interface { To test special tags and operation ID starting with number - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCall123TestSpecialTagsRequest */ - Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest + Call123TestSpecialTags(ctx context.Context) ApiCall123TestSpecialTagsRequest // Call123TestSpecialTagsExecute executes the request // @return Client - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) + Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (*Client, *http.Response, error) } // AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service type ApiCall123TestSpecialTagsRequest struct { - ctx _context.Context + ctx context.Context ApiService AnotherFakeApi body *Client } @@ -55,7 +55,7 @@ func (r ApiCall123TestSpecialTagsRequest) Body(body Client) ApiCall123TestSpecia return r } -func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiCall123TestSpecialTagsRequest) Execute() (*Client, *http.Response, error) { return r.ApiService.Call123TestSpecialTagsExecute(r) } @@ -64,10 +64,10 @@ Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCall123TestSpecialTagsRequest */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context) ApiCall123TestSpecialTagsRequest { return ApiCall123TestSpecialTagsRequest{ ApiService: a, ctx: ctx, @@ -76,24 +76,24 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) Api // Execute executes the request // @return Client -func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (*Client, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue Client + localVarReturnValue *Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/another-fake/dummy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } @@ -127,15 +127,15 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -144,7 +144,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 40252ad41b5..96a2c5ba9f7 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -12,10 +12,10 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "os" "time" "reflect" @@ -23,7 +23,7 @@ import ( // Linger please var ( - _ _context.Context + _ context.Context ) type FakeApi interface { @@ -33,107 +33,107 @@ type FakeApi interface { this route creates an XmlItem - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateXmlItemRequest */ - CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest + CreateXmlItem(ctx context.Context) ApiCreateXmlItemRequest // CreateXmlItemExecute executes the request - CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) + CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*http.Response, error) /* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterBooleanSerializeRequest */ - FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest + FakeOuterBooleanSerialize(ctx context.Context) ApiFakeOuterBooleanSerializeRequest // FakeOuterBooleanSerializeExecute executes the request // @return bool - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) + FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *http.Response, error) /* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterCompositeSerializeRequest */ - FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest + FakeOuterCompositeSerialize(ctx context.Context) ApiFakeOuterCompositeSerializeRequest // FakeOuterCompositeSerializeExecute executes the request // @return OuterComposite - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) + FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (*OuterComposite, *http.Response, error) /* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterNumberSerializeRequest */ - FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest + FakeOuterNumberSerialize(ctx context.Context) ApiFakeOuterNumberSerializeRequest // FakeOuterNumberSerializeExecute executes the request // @return float32 - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) + FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *http.Response, error) /* FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterStringSerializeRequest */ - FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest + FakeOuterStringSerialize(ctx context.Context) ApiFakeOuterStringSerializeRequest // FakeOuterStringSerializeExecute executes the request // @return string - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) + FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *http.Response, error) /* TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithFileSchemaRequest */ - TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest + TestBodyWithFileSchema(ctx context.Context) ApiTestBodyWithFileSchemaRequest // TestBodyWithFileSchemaExecute executes the request - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) + TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*http.Response, error) /* TestBodyWithQueryParams Method for TestBodyWithQueryParams - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithQueryParamsRequest */ - TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest + TestBodyWithQueryParams(ctx context.Context) ApiTestBodyWithQueryParamsRequest // TestBodyWithQueryParamsExecute executes the request - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) + TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*http.Response, error) /* TestClientModel To test \"client\" model To test "client" model - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClientModelRequest */ - TestClientModel(ctx _context.Context) ApiTestClientModelRequest + TestClientModel(ctx context.Context) ApiTestClientModelRequest // TestClientModelExecute executes the request // @return Client - TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) + TestClientModelExecute(r ApiTestClientModelRequest) (*Client, *http.Response, error) /* TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -143,81 +143,81 @@ type FakeApi interface { 偽のエンドポイント 가짜 엔드 포인트 - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEndpointParametersRequest */ - TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest + TestEndpointParameters(ctx context.Context) ApiTestEndpointParametersRequest // TestEndpointParametersExecute executes the request - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) + TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*http.Response, error) /* TestEnumParameters To test enum parameters To test enum parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEnumParametersRequest */ - TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest + TestEnumParameters(ctx context.Context) ApiTestEnumParametersRequest // TestEnumParametersExecute executes the request - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) + TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*http.Response, error) /* TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestGroupParametersRequest */ - TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest + TestGroupParameters(ctx context.Context) ApiTestGroupParametersRequest // TestGroupParametersExecute executes the request - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) + TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*http.Response, error) /* TestInlineAdditionalProperties test inline additionalProperties - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestInlineAdditionalPropertiesRequest */ - TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest + TestInlineAdditionalProperties(ctx context.Context) ApiTestInlineAdditionalPropertiesRequest // TestInlineAdditionalPropertiesExecute executes the request - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) + TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*http.Response, error) /* TestJsonFormData test json serialization of form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestJsonFormDataRequest */ - TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest + TestJsonFormData(ctx context.Context) ApiTestJsonFormDataRequest // TestJsonFormDataExecute executes the request - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) + TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*http.Response, error) /* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat To test the collection format in query parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestQueryParameterCollectionFormatRequest */ - TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest + TestQueryParameterCollectionFormat(ctx context.Context) ApiTestQueryParameterCollectionFormatRequest // TestQueryParameterCollectionFormatExecute executes the request - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) + TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*http.Response, error) } // FakeApiService FakeApi service type FakeApiService service type ApiCreateXmlItemRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi xmlItem *XmlItem } @@ -228,7 +228,7 @@ func (r ApiCreateXmlItemRequest) XmlItem(xmlItem XmlItem) ApiCreateXmlItemReques return r } -func (r ApiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateXmlItemRequest) Execute() (*http.Response, error) { return r.ApiService.CreateXmlItemExecute(r) } @@ -237,10 +237,10 @@ CreateXmlItem creates an XmlItem this route creates an XmlItem - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateXmlItemRequest */ -func (a *FakeApiService) CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest { +func (a *FakeApiService) CreateXmlItem(ctx context.Context) ApiCreateXmlItemRequest { return ApiCreateXmlItemRequest{ ApiService: a, ctx: ctx, @@ -248,23 +248,23 @@ func (a *FakeApiService) CreateXmlItem(ctx _context.Context) ApiCreateXmlItemReq } // Execute executes the request -func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/create_xml_item" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.xmlItem == nil { return nil, reportError("xmlItem is required and must be specified") } @@ -298,15 +298,15 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -317,7 +317,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth } type ApiFakeOuterBooleanSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *bool } @@ -328,7 +328,7 @@ func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBoolean return r } -func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *http.Response, error) { return r.ApiService.FakeOuterBooleanSerializeExecute(r) } @@ -337,10 +337,10 @@ FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterBooleanSerializeRequest */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context) ApiFakeOuterBooleanSerializeRequest { return ApiFakeOuterBooleanSerializeRequest{ ApiService: a, ctx: ctx, @@ -349,9 +349,9 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFake // Execute executes the request // @return bool -func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue bool @@ -359,14 +359,14 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/boolean" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -397,15 +397,15 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -414,7 +414,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -425,7 +425,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS } type ApiFakeOuterCompositeSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *OuterComposite } @@ -436,7 +436,7 @@ func (r ApiFakeOuterCompositeSerializeRequest) Body(body OuterComposite) ApiFake return r } -func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (*OuterComposite, *http.Response, error) { return r.ApiService.FakeOuterCompositeSerializeExecute(r) } @@ -445,10 +445,10 @@ FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterCompositeSerializeRequest */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context) ApiFakeOuterCompositeSerializeRequest { return ApiFakeOuterCompositeSerializeRequest{ ApiService: a, ctx: ctx, @@ -457,24 +457,24 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFa // Execute executes the request // @return OuterComposite -func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (*OuterComposite, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue OuterComposite + localVarReturnValue *OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/composite" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -505,15 +505,15 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -522,7 +522,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -533,7 +533,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos } type ApiFakeOuterNumberSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *float32 } @@ -544,7 +544,7 @@ func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumbe return r } -func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *http.Response, error) { return r.ApiService.FakeOuterNumberSerializeExecute(r) } @@ -553,10 +553,10 @@ FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterNumberSerializeRequest */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context) ApiFakeOuterNumberSerializeRequest { return ApiFakeOuterNumberSerializeRequest{ ApiService: a, ctx: ctx, @@ -565,9 +565,9 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeO // Execute executes the request // @return float32 -func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue float32 @@ -575,14 +575,14 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/number" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -613,15 +613,15 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -630,7 +630,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -641,7 +641,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer } type ApiFakeOuterStringSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *string } @@ -652,7 +652,7 @@ func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterString return r } -func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *http.Response, error) { return r.ApiService.FakeOuterStringSerializeExecute(r) } @@ -661,10 +661,10 @@ FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterStringSerializeRequest */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { +func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context) ApiFakeOuterStringSerializeRequest { return ApiFakeOuterStringSerializeRequest{ ApiService: a, ctx: ctx, @@ -673,9 +673,9 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeO // Execute executes the request // @return string -func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue string @@ -683,14 +683,14 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/string" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -721,15 +721,15 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -738,7 +738,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -749,7 +749,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer } type ApiTestBodyWithFileSchemaRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *FileSchemaTestClass } @@ -759,7 +759,7 @@ func (r ApiTestBodyWithFileSchemaRequest) Body(body FileSchemaTestClass) ApiTest return r } -func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*http.Response, error) { return r.ApiService.TestBodyWithFileSchemaExecute(r) } @@ -768,10 +768,10 @@ TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithFileSchemaRequest */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { +func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context) ApiTestBodyWithFileSchemaRequest { return ApiTestBodyWithFileSchemaRequest{ ApiService: a, ctx: ctx, @@ -779,23 +779,23 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBod } // Execute executes the request -func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/body-with-file-schema" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -829,15 +829,15 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -848,7 +848,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche } type ApiTestBodyWithQueryParamsRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi query *string body *User @@ -863,17 +863,17 @@ func (r ApiTestBodyWithQueryParamsRequest) Body(body User) ApiTestBodyWithQueryP return r } -func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*http.Response, error) { return r.ApiService.TestBodyWithQueryParamsExecute(r) } /* TestBodyWithQueryParams Method for TestBodyWithQueryParams - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithQueryParamsRequest */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { +func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context) ApiTestBodyWithQueryParamsRequest { return ApiTestBodyWithQueryParamsRequest{ ApiService: a, ctx: ctx, @@ -881,23 +881,23 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBo } // Execute executes the request -func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/body-with-query-params" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.query == nil { return nil, reportError("query is required and must be specified") } @@ -935,15 +935,15 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -954,7 +954,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa } type ApiTestClientModelRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *Client } @@ -965,7 +965,7 @@ func (r ApiTestClientModelRequest) Body(body Client) ApiTestClientModelRequest { return r } -func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClientModelRequest) Execute() (*Client, *http.Response, error) { return r.ApiService.TestClientModelExecute(r) } @@ -974,10 +974,10 @@ TestClientModel To test \"client\" model To test "client" model - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClientModelRequest */ -func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { +func (a *FakeApiService) TestClientModel(ctx context.Context) ApiTestClientModelRequest { return ApiTestClientModelRequest{ ApiService: a, ctx: ctx, @@ -986,24 +986,24 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientMode // Execute executes the request // @return Client -func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { +func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (*Client, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue Client + localVarReturnValue *Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } @@ -1037,15 +1037,15 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1054,7 +1054,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1065,7 +1065,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl } type ApiTestEndpointParametersRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi number *float32 double *float64 @@ -1154,7 +1154,7 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo return r } -func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEndpointParametersRequest) Execute() (*http.Response, error) { return r.ApiService.TestEndpointParametersExecute(r) } @@ -1166,10 +1166,10 @@ Fake endpoint for testing various parameters 偽のエンドポイント 가짜 엔드 포인트 - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEndpointParametersRequest */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { +func (a *FakeApiService) TestEndpointParameters(ctx context.Context) ApiTestEndpointParametersRequest { return ApiTestEndpointParametersRequest{ ApiService: a, ctx: ctx, @@ -1177,23 +1177,23 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEnd } // Execute executes the request -func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.number == nil { return nil, reportError("number is required and must be specified") } @@ -1266,7 +1266,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete binaryLocalVarFile = *r.binary } if binaryLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(binaryLocalVarFile) + fbs, _ := ioutil.ReadAll(binaryLocalVarFile) binaryLocalVarFileBytes = fbs binaryLocalVarFileName = binaryLocalVarFile.Name() binaryLocalVarFile.Close() @@ -1294,15 +1294,15 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1313,7 +1313,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } type ApiTestEnumParametersRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi enumHeaderStringArray *[]string enumHeaderString *string @@ -1366,7 +1366,7 @@ func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiT return r } -func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEnumParametersRequest) Execute() (*http.Response, error) { return r.ApiService.TestEnumParametersExecute(r) } @@ -1375,10 +1375,10 @@ TestEnumParameters To test enum parameters To test enum parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEnumParametersRequest */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { +func (a *FakeApiService) TestEnumParameters(ctx context.Context) ApiTestEnumParametersRequest { return ApiTestEnumParametersRequest{ ApiService: a, ctx: ctx, @@ -1386,23 +1386,23 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumPar } // Execute executes the request -func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.enumQueryStringArray != nil { localVarQueryParams.Add("enum_query_string_array", parameterToString(*r.enumQueryStringArray, "csv")) @@ -1455,15 +1455,15 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1474,7 +1474,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } type ApiTestGroupParametersRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi requiredStringGroup *int32 requiredBooleanGroup *bool @@ -1515,7 +1515,7 @@ func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroup return r } -func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestGroupParametersRequest) Execute() (*http.Response, error) { return r.ApiService.TestGroupParametersExecute(r) } @@ -1524,10 +1524,10 @@ TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestGroupParametersRequest */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { +func (a *FakeApiService) TestGroupParameters(ctx context.Context) ApiTestGroupParametersRequest { return ApiTestGroupParametersRequest{ ApiService: a, ctx: ctx, @@ -1535,23 +1535,23 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupP } // Execute executes the request -func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.requiredStringGroup == nil { return nil, reportError("requiredStringGroup is required and must be specified") } @@ -1601,15 +1601,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1620,7 +1620,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } type ApiTestInlineAdditionalPropertiesRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi param *map[string]string } @@ -1631,17 +1631,17 @@ func (r ApiTestInlineAdditionalPropertiesRequest) Param(param map[string]string) return r } -func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*http.Response, error) { return r.ApiService.TestInlineAdditionalPropertiesExecute(r) } /* TestInlineAdditionalProperties test inline additionalProperties - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestInlineAdditionalPropertiesRequest */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context) ApiTestInlineAdditionalPropertiesRequest { return ApiTestInlineAdditionalPropertiesRequest{ ApiService: a, ctx: ctx, @@ -1649,23 +1649,23 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) Ap } // Execute executes the request -func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/inline-additionalProperties" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.param == nil { return nil, reportError("param is required and must be specified") } @@ -1699,15 +1699,15 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1718,7 +1718,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd } type ApiTestJsonFormDataRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi param *string param2 *string @@ -1735,17 +1735,17 @@ func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataReq return r } -func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestJsonFormDataRequest) Execute() (*http.Response, error) { return r.ApiService.TestJsonFormDataExecute(r) } /* TestJsonFormData test json serialization of form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestJsonFormDataRequest */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { +func (a *FakeApiService) TestJsonFormData(ctx context.Context) ApiTestJsonFormDataRequest { return ApiTestJsonFormDataRequest{ ApiService: a, ctx: ctx, @@ -1753,23 +1753,23 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormD } // Execute executes the request -func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/jsonFormData" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.param == nil { return nil, reportError("param is required and must be specified") } @@ -1806,15 +1806,15 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1825,7 +1825,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( } type ApiTestQueryParameterCollectionFormatRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi pipe *[]string ioutil *[]string @@ -1855,7 +1855,7 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) return r } -func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*http.Response, error) { return r.ApiService.TestQueryParameterCollectionFormatExecute(r) } @@ -1864,10 +1864,10 @@ TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat To test the collection format in query parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx context.Context) ApiTestQueryParameterCollectionFormatRequest { return ApiTestQueryParameterCollectionFormatRequest{ ApiService: a, ctx: ctx, @@ -1875,23 +1875,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context } // Execute executes the request -func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/test-query-parameters" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.pipe == nil { return nil, reportError("pipe is required and must be specified") } @@ -1950,15 +1950,15 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 67f9f95661a..67b8e6a66c7 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -12,15 +12,15 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) // Linger please var ( - _ _context.Context + _ context.Context ) type FakeClassnameTags123Api interface { @@ -30,21 +30,21 @@ type FakeClassnameTags123Api interface { To test class name in snake case - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClassnameRequest */ - TestClassname(ctx _context.Context) ApiTestClassnameRequest + TestClassname(ctx context.Context) ApiTestClassnameRequest // TestClassnameExecute executes the request // @return Client - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) + TestClassnameExecute(r ApiTestClassnameRequest) (*Client, *http.Response, error) } // FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service type ApiTestClassnameRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeClassnameTags123Api body *Client } @@ -55,7 +55,7 @@ func (r ApiTestClassnameRequest) Body(body Client) ApiTestClassnameRequest { return r } -func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClassnameRequest) Execute() (*Client, *http.Response, error) { return r.ApiService.TestClassnameExecute(r) } @@ -64,10 +64,10 @@ TestClassname To test class name in snake case To test class name in snake case - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClassnameRequest */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context) ApiTestClassnameRequest { return ApiTestClassnameRequest{ ApiService: a, ctx: ctx, @@ -76,24 +76,24 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) Api // Execute executes the request // @return Client -func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (*Client, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue Client + localVarReturnValue *Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake_classname_test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } @@ -141,15 +141,15 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -158,7 +158,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index dc8fe016735..1c97ee676fe 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -12,17 +12,17 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" "os" ) // Linger please var ( - _ _context.Context + _ context.Context ) type PetApi interface { @@ -30,127 +30,127 @@ type PetApi interface { /* AddPet Add a new pet to the store - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAddPetRequest */ - AddPet(ctx _context.Context) ApiAddPetRequest + AddPet(ctx context.Context) ApiAddPetRequest // AddPetExecute executes the request - AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) + AddPetExecute(r ApiAddPetRequest) (*http.Response, error) /* DeletePet Deletes a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId Pet id to delete @return ApiDeletePetRequest */ - DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest + DeletePet(ctx context.Context, petId int64) ApiDeletePetRequest // DeletePetExecute executes the request - DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) + DeletePetExecute(r ApiDeletePetRequest) (*http.Response, error) /* FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByStatusRequest */ - FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest + FindPetsByStatus(ctx context.Context) ApiFindPetsByStatusRequest // FindPetsByStatusExecute executes the request // @return []Pet - FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *http.Response, error) /* FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByTagsRequest Deprecated */ - FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest + FindPetsByTags(ctx context.Context) ApiFindPetsByTagsRequest // FindPetsByTagsExecute executes the request // @return []Pet // Deprecated - FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *http.Response, error) /* GetPetById Find pet by ID Returns a single pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to return @return ApiGetPetByIdRequest */ - GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest + GetPetById(ctx context.Context, petId int64) ApiGetPetByIdRequest // GetPetByIdExecute executes the request // @return Pet - GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) + GetPetByIdExecute(r ApiGetPetByIdRequest) (*Pet, *http.Response, error) /* UpdatePet Update an existing pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiUpdatePetRequest */ - UpdatePet(ctx _context.Context) ApiUpdatePetRequest + UpdatePet(ctx context.Context) ApiUpdatePetRequest // UpdatePetExecute executes the request - UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) + UpdatePetExecute(r ApiUpdatePetRequest) (*http.Response, error) /* UpdatePetWithForm Updates a pet in the store with form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet that needs to be updated @return ApiUpdatePetWithFormRequest */ - UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest + UpdatePetWithForm(ctx context.Context, petId int64) ApiUpdatePetWithFormRequest // UpdatePetWithFormExecute executes the request - UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) + UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*http.Response, error) /* UploadFile uploads an image - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileRequest */ - UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest + UploadFile(ctx context.Context, petId int64) ApiUploadFileRequest // UploadFileExecute executes the request // @return ApiResponse - UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse, *http.Response, error) /* UploadFileWithRequiredFile uploads an image (required) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileWithRequiredFileRequest */ - UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest + UploadFileWithRequiredFile(ctx context.Context, petId int64) ApiUploadFileWithRequiredFileRequest // UploadFileWithRequiredFileExecute executes the request // @return ApiResponse - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (*ApiResponse, *http.Response, error) } // PetApiService PetApi service type PetApiService service type ApiAddPetRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi body *Pet } @@ -161,17 +161,17 @@ func (r ApiAddPetRequest) Body(body Pet) ApiAddPetRequest { return r } -func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAddPetRequest) Execute() (*http.Response, error) { return r.ApiService.AddPetExecute(r) } /* AddPet Add a new pet to the store - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAddPetRequest */ -func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { +func (a *PetApiService) AddPet(ctx context.Context) ApiAddPetRequest { return ApiAddPetRequest{ ApiService: a, ctx: ctx, @@ -179,23 +179,23 @@ func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { } // Execute executes the request -func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -229,15 +229,15 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -248,7 +248,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e } type ApiDeletePetRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 apiKey *string @@ -259,18 +259,18 @@ func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { return r } -func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeletePetRequest) Execute() (*http.Response, error) { return r.ApiService.DeletePetExecute(r) } /* DeletePet Deletes a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId Pet id to delete @return ApiDeletePetRequest */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { +func (a *PetApiService) DeletePet(ctx context.Context, petId int64) ApiDeletePetRequest { return ApiDeletePetRequest{ ApiService: a, ctx: ctx, @@ -279,24 +279,24 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePe } // Execute executes the request -func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -328,15 +328,15 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -347,7 +347,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } type ApiFindPetsByStatusRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi status *[]string } @@ -358,7 +358,7 @@ func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusR return r } -func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *http.Response, error) { return r.ApiService.FindPetsByStatusExecute(r) } @@ -367,10 +367,10 @@ FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByStatusRequest */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { +func (a *PetApiService) FindPetsByStatus(ctx context.Context) ApiFindPetsByStatusRequest { return ApiFindPetsByStatusRequest{ ApiService: a, ctx: ctx, @@ -379,9 +379,9 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStat // Execute executes the request // @return []Pet -func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue []Pet @@ -389,14 +389,14 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/findByStatus" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.status == nil { return localVarReturnValue, nil, reportError("status is required and must be specified") } @@ -429,15 +429,15 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -446,7 +446,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -457,7 +457,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } type ApiFindPetsByTagsRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi tags *[]string } @@ -468,7 +468,7 @@ func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { return r } -func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *http.Response, error) { return r.ApiService.FindPetsByTagsExecute(r) } @@ -477,12 +477,12 @@ FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByTagsRequest Deprecated */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { +func (a *PetApiService) FindPetsByTags(ctx context.Context) ApiFindPetsByTagsRequest { return ApiFindPetsByTagsRequest{ ApiService: a, ctx: ctx, @@ -492,9 +492,9 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRe // Execute executes the request // @return []Pet // Deprecated -func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue []Pet @@ -502,14 +502,14 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/findByTags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.tags == nil { return localVarReturnValue, nil, reportError("tags is required and must be specified") } @@ -542,15 +542,15 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -559,7 +559,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -570,13 +570,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } type ApiGetPetByIdRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 } -func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { +func (r ApiGetPetByIdRequest) Execute() (*Pet, *http.Response, error) { return r.ApiService.GetPetByIdExecute(r) } @@ -585,11 +585,11 @@ GetPetById Find pet by ID Returns a single pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to return @return ApiGetPetByIdRequest */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { +func (a *PetApiService) GetPetById(ctx context.Context, petId int64) ApiGetPetByIdRequest { return ApiGetPetByIdRequest{ ApiService: a, ctx: ctx, @@ -599,25 +599,25 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetB // Execute executes the request // @return Pet -func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { +func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (*Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue Pet + localVarReturnValue *Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -660,15 +660,15 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -677,7 +677,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -688,7 +688,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } type ApiUpdatePetRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi body *Pet } @@ -699,17 +699,17 @@ func (r ApiUpdatePetRequest) Body(body Pet) ApiUpdatePetRequest { return r } -func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetRequest) Execute() (*http.Response, error) { return r.ApiService.UpdatePetExecute(r) } /* UpdatePet Update an existing pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiUpdatePetRequest */ -func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { +func (a *PetApiService) UpdatePet(ctx context.Context) ApiUpdatePetRequest { return ApiUpdatePetRequest{ ApiService: a, ctx: ctx, @@ -717,23 +717,23 @@ func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { } // Execute executes the request -func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -767,15 +767,15 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -786,7 +786,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo } type ApiUpdatePetWithFormRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 name *string @@ -804,18 +804,18 @@ func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormR return r } -func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetWithFormRequest) Execute() (*http.Response, error) { return r.ApiService.UpdatePetWithFormExecute(r) } /* UpdatePetWithForm Updates a pet in the store with form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet that needs to be updated @return ApiUpdatePetWithFormRequest */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { +func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64) ApiUpdatePetWithFormRequest { return ApiUpdatePetWithFormRequest{ ApiService: a, ctx: ctx, @@ -824,24 +824,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) Api } // Execute executes the request -func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -876,15 +876,15 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -895,7 +895,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } type ApiUploadFileRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 additionalMetadata *string @@ -913,18 +913,18 @@ func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { return r } -func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileRequest) Execute() (*ApiResponse, *http.Response, error) { return r.ApiService.UploadFileExecute(r) } /* UploadFile uploads an image - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileRequest */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { +func (a *PetApiService) UploadFile(ctx context.Context, petId int64) ApiUploadFileRequest { return ApiUploadFileRequest{ ApiService: a, ctx: ctx, @@ -934,25 +934,25 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadF // Execute executes the request // @return ApiResponse -func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue ApiResponse + localVarReturnValue *ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -985,7 +985,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, fileLocalVarFile = *r.file } if fileLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(fileLocalVarFile) + fbs, _ := ioutil.ReadAll(fileLocalVarFile) fileLocalVarFileBytes = fbs fileLocalVarFileName = fileLocalVarFile.Name() fileLocalVarFile.Close() @@ -1001,15 +1001,15 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1018,7 +1018,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1029,7 +1029,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } type ApiUploadFileWithRequiredFileRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 requiredFile **os.File @@ -1047,18 +1047,18 @@ func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetad return r } -func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileWithRequiredFileRequest) Execute() (*ApiResponse, *http.Response, error) { return r.ApiService.UploadFileWithRequiredFileExecute(r) } /* UploadFileWithRequiredFile uploads an image (required) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileWithRequiredFileRequest */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { +func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { return ApiUploadFileWithRequiredFileRequest{ ApiService: a, ctx: ctx, @@ -1068,25 +1068,25 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i // Execute executes the request // @return ApiResponse -func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (*ApiResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue ApiResponse + localVarReturnValue *ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.requiredFile == nil { return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") } @@ -1119,7 +1119,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq requiredFileLocalVarFile := *r.requiredFile if requiredFileLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(requiredFileLocalVarFile) + fbs, _ := ioutil.ReadAll(requiredFileLocalVarFile) requiredFileLocalVarFileBytes = fbs requiredFileLocalVarFileName = requiredFileLocalVarFile.Name() requiredFileLocalVarFile.Close() @@ -1135,15 +1135,15 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1152,7 +1152,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index be6336216da..61dcc483761 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -12,16 +12,16 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) // Linger please var ( - _ _context.Context + _ context.Context ) type StoreApi interface { @@ -31,68 +31,68 @@ type StoreApi interface { For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of the order that needs to be deleted @return ApiDeleteOrderRequest */ - DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest + DeleteOrder(ctx context.Context, orderId string) ApiDeleteOrderRequest // DeleteOrderExecute executes the request - DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) + DeleteOrderExecute(r ApiDeleteOrderRequest) (*http.Response, error) /* GetInventory Returns pet inventories by status Returns a map of status codes to quantities - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetInventoryRequest */ - GetInventory(ctx _context.Context) ApiGetInventoryRequest + GetInventory(ctx context.Context) ApiGetInventoryRequest // GetInventoryExecute executes the request // @return map[string]int32 - GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) + GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *http.Response, error) /* GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of pet that needs to be fetched @return ApiGetOrderByIdRequest */ - GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest + GetOrderById(ctx context.Context, orderId int64) ApiGetOrderByIdRequest // GetOrderByIdExecute executes the request // @return Order - GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) + GetOrderByIdExecute(r ApiGetOrderByIdRequest) (*Order, *http.Response, error) /* PlaceOrder Place an order for a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPlaceOrderRequest */ - PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest + PlaceOrder(ctx context.Context) ApiPlaceOrderRequest // PlaceOrderExecute executes the request // @return Order - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) + PlaceOrderExecute(r ApiPlaceOrderRequest) (*Order, *http.Response, error) } // StoreApiService StoreApi service type StoreApiService service type ApiDeleteOrderRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi orderId string } -func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteOrderRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOrderExecute(r) } @@ -101,11 +101,11 @@ DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of the order that needs to be deleted @return ApiDeleteOrderRequest */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { +func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) ApiDeleteOrderRequest { return ApiDeleteOrderRequest{ ApiService: a, ctx: ctx, @@ -114,24 +114,24 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiD } // Execute executes the request -func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { +func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -160,15 +160,15 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -179,12 +179,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } type ApiGetInventoryRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi } -func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { +func (r ApiGetInventoryRequest) Execute() (map[string]int32, *http.Response, error) { return r.ApiService.GetInventoryExecute(r) } @@ -193,10 +193,10 @@ GetInventory Returns pet inventories by status Returns a map of status codes to quantities - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetInventoryRequest */ -func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { +func (a *StoreApiService) GetInventory(ctx context.Context) ApiGetInventoryRequest { return ApiGetInventoryRequest{ ApiService: a, ctx: ctx, @@ -205,9 +205,9 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequ // Execute executes the request // @return map[string]int32 -func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { +func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue map[string]int32 @@ -215,14 +215,14 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/inventory" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -265,15 +265,15 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -282,7 +282,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -293,13 +293,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } type ApiGetOrderByIdRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi orderId int64 } -func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiGetOrderByIdRequest) Execute() (*Order, *http.Response, error) { return r.ApiService.GetOrderByIdExecute(r) } @@ -308,11 +308,11 @@ GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of pet that needs to be fetched @return ApiGetOrderByIdRequest */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { +func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) ApiGetOrderByIdRequest { return ApiGetOrderByIdRequest{ ApiService: a, ctx: ctx, @@ -322,25 +322,25 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiG // Execute executes the request // @return Order -func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (*Order, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue Order + localVarReturnValue *Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -375,15 +375,15 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -392,7 +392,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -403,7 +403,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } type ApiPlaceOrderRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi body *Order } @@ -414,17 +414,17 @@ func (r ApiPlaceOrderRequest) Body(body Order) ApiPlaceOrderRequest { return r } -func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiPlaceOrderRequest) Execute() (*Order, *http.Response, error) { return r.ApiService.PlaceOrderExecute(r) } /* PlaceOrder Place an order for a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPlaceOrderRequest */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { +func (a *StoreApiService) PlaceOrder(ctx context.Context) ApiPlaceOrderRequest { return ApiPlaceOrderRequest{ ApiService: a, ctx: ctx, @@ -433,24 +433,24 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest // Execute executes the request // @return Order -func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (*Order, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue Order + localVarReturnValue *Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/order" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } @@ -484,15 +484,15 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -501,7 +501,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index d6f2c7f710b..a8107b6e461 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -12,16 +12,16 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) // Linger please var ( - _ _context.Context + _ context.Context ) type UserApi interface { @@ -31,106 +31,106 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUserRequest */ - CreateUser(ctx _context.Context) ApiCreateUserRequest + CreateUser(ctx context.Context) ApiCreateUserRequest // CreateUserExecute executes the request - CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) + CreateUserExecute(r ApiCreateUserRequest) (*http.Response, error) /* CreateUsersWithArrayInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithArrayInputRequest */ - CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest + CreateUsersWithArrayInput(ctx context.Context) ApiCreateUsersWithArrayInputRequest // CreateUsersWithArrayInputExecute executes the request - CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) + CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*http.Response, error) /* CreateUsersWithListInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithListInputRequest */ - CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest + CreateUsersWithListInput(ctx context.Context) ApiCreateUsersWithListInputRequest // CreateUsersWithListInputExecute executes the request - CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) + CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*http.Response, error) /* DeleteUser Delete user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be deleted @return ApiDeleteUserRequest */ - DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest // DeleteUserExecute executes the request - DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) + DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) /* GetUserByName Get user by user name - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be fetched. Use user1 for testing. @return ApiGetUserByNameRequest */ - GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest + GetUserByName(ctx context.Context, username string) ApiGetUserByNameRequest // GetUserByNameExecute executes the request // @return User - GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) + GetUserByNameExecute(r ApiGetUserByNameRequest) (*User, *http.Response, error) /* LoginUser Logs user into the system - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLoginUserRequest */ - LoginUser(ctx _context.Context) ApiLoginUserRequest + LoginUser(ctx context.Context) ApiLoginUserRequest // LoginUserExecute executes the request // @return string - LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) + LoginUserExecute(r ApiLoginUserRequest) (string, *http.Response, error) /* LogoutUser Logs out current logged in user session - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLogoutUserRequest */ - LogoutUser(ctx _context.Context) ApiLogoutUserRequest + LogoutUser(ctx context.Context) ApiLogoutUserRequest // LogoutUserExecute executes the request - LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) + LogoutUserExecute(r ApiLogoutUserRequest) (*http.Response, error) /* UpdateUser Updated user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username name that need to be deleted @return ApiUpdateUserRequest */ - UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest + UpdateUser(ctx context.Context, username string) ApiUpdateUserRequest // UpdateUserExecute executes the request - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) + UpdateUserExecute(r ApiUpdateUserRequest) (*http.Response, error) } // UserApiService UserApi service type UserApiService service type ApiCreateUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi body *User } @@ -141,7 +141,7 @@ func (r ApiCreateUserRequest) Body(body User) ApiCreateUserRequest { return r } -func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUserRequest) Execute() (*http.Response, error) { return r.ApiService.CreateUserExecute(r) } @@ -150,10 +150,10 @@ CreateUser Create user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUserRequest */ -func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { +func (a *UserApiService) CreateUser(ctx context.Context) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -161,23 +161,23 @@ func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { } // Execute executes the request -func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -211,15 +211,15 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -230,7 +230,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re } type ApiCreateUsersWithArrayInputRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi body *[]User } @@ -241,17 +241,17 @@ func (r ApiCreateUsersWithArrayInputRequest) Body(body []User) ApiCreateUsersWit return r } -func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithArrayInputRequest) Execute() (*http.Response, error) { return r.ApiService.CreateUsersWithArrayInputExecute(r) } /* CreateUsersWithArrayInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithArrayInputRequest */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { +func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context) ApiCreateUsersWithArrayInputRequest { return ApiCreateUsersWithArrayInputRequest{ ApiService: a, ctx: ctx, @@ -259,23 +259,23 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCrea } // Execute executes the request -func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/createWithArray" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -309,15 +309,15 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -328,7 +328,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr } type ApiCreateUsersWithListInputRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi body *[]User } @@ -339,17 +339,17 @@ func (r ApiCreateUsersWithListInputRequest) Body(body []User) ApiCreateUsersWith return r } -func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithListInputRequest) Execute() (*http.Response, error) { return r.ApiService.CreateUsersWithListInputExecute(r) } /* CreateUsersWithListInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithListInputRequest */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { +func (a *UserApiService) CreateUsersWithListInput(ctx context.Context) ApiCreateUsersWithListInputRequest { return ApiCreateUsersWithListInputRequest{ ApiService: a, ctx: ctx, @@ -357,23 +357,23 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreat } // Execute executes the request -func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/createWithList" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -407,15 +407,15 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -426,13 +426,13 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis } type ApiDeleteUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username string } -func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteUserExecute(r) } @@ -441,11 +441,11 @@ DeleteUser Delete user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be deleted @return ApiDeleteUserRequest */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { +func (a *UserApiService) DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -454,24 +454,24 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDe } // Execute executes the request -func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -500,15 +500,15 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -519,24 +519,24 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } type ApiGetUserByNameRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username string } -func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { +func (r ApiGetUserByNameRequest) Execute() (*User, *http.Response, error) { return r.ApiService.GetUserByNameExecute(r) } /* GetUserByName Get user by user name - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be fetched. Use user1 for testing. @return ApiGetUserByNameRequest */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { +func (a *UserApiService) GetUserByName(ctx context.Context, username string) ApiGetUserByNameRequest { return ApiGetUserByNameRequest{ ApiService: a, ctx: ctx, @@ -546,25 +546,25 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) Ap // Execute executes the request // @return User -func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { +func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue User + localVarReturnValue *User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -593,15 +593,15 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -610,7 +610,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -621,7 +621,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } type ApiLoginUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username *string password *string @@ -638,17 +638,17 @@ func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { return r } -func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiLoginUserRequest) Execute() (string, *http.Response, error) { return r.ApiService.LoginUserExecute(r) } /* LoginUser Logs user into the system - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLoginUserRequest */ -func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { +func (a *UserApiService) LoginUser(ctx context.Context) ApiLoginUserRequest { return ApiLoginUserRequest{ ApiService: a, ctx: ctx, @@ -657,9 +657,9 @@ func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { // Execute executes the request // @return string -func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { +func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue string @@ -667,14 +667,14 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/login" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.username == nil { return localVarReturnValue, nil, reportError("username is required and must be specified") } @@ -711,15 +711,15 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -728,7 +728,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -739,22 +739,22 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } type ApiLogoutUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi } -func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiLogoutUserRequest) Execute() (*http.Response, error) { return r.ApiService.LogoutUserExecute(r) } /* LogoutUser Logs out current logged in user session - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLogoutUserRequest */ -func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { +func (a *UserApiService) LogoutUser(ctx context.Context) ApiLogoutUserRequest { return ApiLogoutUserRequest{ ApiService: a, ctx: ctx, @@ -762,23 +762,23 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { } // Execute executes the request -func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/logout" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -807,15 +807,15 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -826,7 +826,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } type ApiUpdateUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username string body *User @@ -838,7 +838,7 @@ func (r ApiUpdateUserRequest) Body(body User) ApiUpdateUserRequest { return r } -func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdateUserRequest) Execute() (*http.Response, error) { return r.ApiService.UpdateUserExecute(r) } @@ -847,11 +847,11 @@ UpdateUser Updated user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username name that need to be deleted @return ApiUpdateUserRequest */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { +func (a *UserApiService) UpdateUser(ctx context.Context, username string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -860,24 +860,24 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUp } // Execute executes the request -func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -911,15 +911,15 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 8fbafd32935..d3c90d43129 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -437,6 +437,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { diff --git a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index 6243abe3c4d..2996979cd19 100644 --- a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -32,8 +32,8 @@ func main() { body := *openapiclient.NewClient() // Client | client model configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AnotherFakeApi.Call123TestSpecialTags(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index 9a4a2bbd5ff..e51cddca5bd 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -45,8 +45,8 @@ func main() { xmlItem := *openapiclient.NewXmlItem() // XmlItem | XmlItem Body configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.CreateXmlItem``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -109,8 +109,8 @@ func main() { body := true // bool | Input boolean as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -175,8 +175,8 @@ func main() { body := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -241,8 +241,8 @@ func main() { body := float32(8.14) // float32 | Input number as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -307,8 +307,8 @@ func main() { body := "body_example" // string | Input string as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterStringSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -373,8 +373,8 @@ func main() { body := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestBodyWithFileSchema(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -436,8 +436,8 @@ func main() { body := *openapiclient.NewUser() // User | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -501,8 +501,8 @@ func main() { body := *openapiclient.NewClient() // Client | client model configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestClientModel(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestClientModel(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -581,8 +581,8 @@ func main() { callback := "callback_example" // string | None (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -665,8 +665,8 @@ func main() { enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -741,8 +741,8 @@ func main() { int64Group := int64(789) // int64 | Integer in group parameters (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -808,8 +808,8 @@ func main() { param := map[string]string{"key": "Inner_example"} // map[string]string | request body configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background()).Param(param).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestInlineAdditionalProperties(context.Background()).Param(param).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -871,8 +871,8 @@ func main() { param2 := "param2_example" // string | field2 configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -940,8 +940,8 @@ func main() { context := []string{"Inner_example"} // []string | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md index b206d05d09c..71891e79275 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -32,8 +32,8 @@ func main() { body := *openapiclient.NewClient() // Client | client model configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeClassnameTags123Api.TestClassname(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/client/petstore/go/go-petstore/docs/PetApi.md b/samples/client/petstore/go/go-petstore/docs/PetApi.md index d93265c16ed..81c7e187ac7 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore/docs/PetApi.md @@ -38,8 +38,8 @@ func main() { body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.AddPet(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.AddPet(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -101,8 +101,8 @@ func main() { apiKey := "apiKey_example" // string | (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -170,8 +170,8 @@ func main() { status := []string{"Status_example"} // []string | Status values that need to be considered for filter configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background()).Status(status).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.FindPetsByStatus(context.Background()).Status(status).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -236,8 +236,8 @@ func main() { tags := []string{"Inner_example"} // []string | Tags to filter by configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByTags(context.Background()).Tags(tags).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.FindPetsByTags(context.Background()).Tags(tags).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -302,8 +302,8 @@ func main() { petId := int64(789) // int64 | ID of pet to return configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.GetPetById(context.Background(), petId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -370,8 +370,8 @@ func main() { body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePet(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UpdatePet(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -434,8 +434,8 @@ func main() { status := "status_example" // string | Updated status of the pet (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -504,8 +504,8 @@ func main() { file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -576,8 +576,8 @@ func main() { additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/client/petstore/go/go-petstore/docs/StoreApi.md index 1e5c0ae5ba8..243512eb723 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreApi.md @@ -35,8 +35,8 @@ func main() { orderId := "orderId_example" // string | ID of the order that needs to be deleted configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.DeleteOrder(context.Background(), orderId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -102,8 +102,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetInventory(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.GetInventory(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -164,8 +164,8 @@ func main() { orderId := int64(789) // int64 | ID of pet that needs to be fetched configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.GetOrderById(context.Background(), orderId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -232,8 +232,8 @@ func main() { body := *openapiclient.NewOrder() // Order | order placed for purchasing the pet configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.PlaceOrder(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.PlaceOrder(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/client/petstore/go/go-petstore/docs/UserApi.md b/samples/client/petstore/go/go-petstore/docs/UserApi.md index e1623fabec4..5a5c8f52d2e 100644 --- a/samples/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/client/petstore/go/go-petstore/docs/UserApi.md @@ -39,8 +39,8 @@ func main() { body := *openapiclient.NewUser() // User | Created user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUser(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.CreateUser(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -101,8 +101,8 @@ func main() { body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.CreateUsersWithArrayInput(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -163,8 +163,8 @@ func main() { body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.CreateUsersWithListInput(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -227,8 +227,8 @@ func main() { username := "username_example" // string | The name that needs to be deleted configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.DeleteUser(context.Background(), username).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -293,8 +293,8 @@ func main() { username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.GetUserByName(context.Background(), username).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -362,8 +362,8 @@ func main() { password := "password_example" // string | The password for login in clear text configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LoginUser(context.Background()).Username(username).Password(password).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.LoginUser(context.Background()).Username(username).Password(password).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -426,8 +426,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LogoutUser(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.LogoutUser(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -487,8 +487,8 @@ func main() { body := *openapiclient.NewUser() // User | Updated user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.UpdateUser(context.Background(), username).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/client/petstore/go/go-petstore/go.mod b/samples/client/petstore/go/go-petstore/go.mod index 0f43de9ebb2..ead32606c72 100644 --- a/samples/client/petstore/go/go-petstore/go.mod +++ b/samples/client/petstore/go/go-petstore/go.mod @@ -3,5 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.13 require ( - golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 ) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go index 5b44d7e51ff..e5ec45291f2 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -24,9 +24,9 @@ type AdditionalPropertiesClass struct { MapArrayAnytype *map[string][]map[string]interface{} `json:"map_array_anytype,omitempty"` MapMapString *map[string]map[string]string `json:"map_map_string,omitempty"` MapMapAnytype *map[string]map[string]map[string]interface{} `json:"map_map_anytype,omitempty"` - Anytype1 *map[string]interface{} `json:"anytype_1,omitempty"` - Anytype2 *map[string]interface{} `json:"anytype_2,omitempty"` - Anytype3 *map[string]interface{} `json:"anytype_3,omitempty"` + Anytype1 map[string]interface{} `json:"anytype_1,omitempty"` + Anytype2 map[string]interface{} `json:"anytype_2,omitempty"` + Anytype3 map[string]interface{} `json:"anytype_3,omitempty"` } // NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object @@ -308,12 +308,12 @@ func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Anytype1 + return o.Anytype1 } // GetAnytype1Ok returns a tuple with the Anytype1 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetAnytype1Ok() (*map[string]interface{}, bool) { +func (o *AdditionalPropertiesClass) GetAnytype1Ok() (map[string]interface{}, bool) { if o == nil || o.Anytype1 == nil { return nil, false } @@ -331,7 +331,7 @@ func (o *AdditionalPropertiesClass) HasAnytype1() bool { // SetAnytype1 gets a reference to the given map[string]interface{} and assigns it to the Anytype1 field. func (o *AdditionalPropertiesClass) SetAnytype1(v map[string]interface{}) { - o.Anytype1 = &v + o.Anytype1 = v } // GetAnytype2 returns the Anytype2 field value if set, zero value otherwise. @@ -340,12 +340,12 @@ func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Anytype2 + return o.Anytype2 } // GetAnytype2Ok returns a tuple with the Anytype2 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetAnytype2Ok() (*map[string]interface{}, bool) { +func (o *AdditionalPropertiesClass) GetAnytype2Ok() (map[string]interface{}, bool) { if o == nil || o.Anytype2 == nil { return nil, false } @@ -363,7 +363,7 @@ func (o *AdditionalPropertiesClass) HasAnytype2() bool { // SetAnytype2 gets a reference to the given map[string]interface{} and assigns it to the Anytype2 field. func (o *AdditionalPropertiesClass) SetAnytype2(v map[string]interface{}) { - o.Anytype2 = &v + o.Anytype2 = v } // GetAnytype3 returns the Anytype3 field value if set, zero value otherwise. @@ -372,12 +372,12 @@ func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.Anytype3 + return o.Anytype3 } // GetAnytype3Ok returns a tuple with the Anytype3 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetAnytype3Ok() (*map[string]interface{}, bool) { +func (o *AdditionalPropertiesClass) GetAnytype3Ok() (map[string]interface{}, bool) { if o == nil || o.Anytype3 == nil { return nil, false } @@ -395,7 +395,7 @@ func (o *AdditionalPropertiesClass) HasAnytype3() bool { // SetAnytype3 gets a reference to the given map[string]interface{} and assigns it to the Anytype3 field. func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{}) { - o.Anytype3 = &v + o.Anytype3 = v } func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index 29fbda5bfc8..fc8559be8b8 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -16,7 +16,7 @@ import ( // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` + ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` } // NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object @@ -42,12 +42,12 @@ func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { var ret [][]float32 return ret } - return *o.ArrayArrayNumber + return o.ArrayArrayNumber } // GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool) { +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool) { if o == nil || o.ArrayArrayNumber == nil { return nil, false } @@ -65,7 +65,7 @@ func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { // SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { - o.ArrayArrayNumber = &v + o.ArrayArrayNumber = v } func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go index 1c6b5b2374b..d5265a97b3d 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -16,7 +16,7 @@ import ( // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { - ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` + ArrayNumber []float32 `json:"ArrayNumber,omitempty"` } // NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object @@ -42,12 +42,12 @@ func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { var ret []float32 return ret } - return *o.ArrayNumber + return o.ArrayNumber } // GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool) { +func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool) { if o == nil || o.ArrayNumber == nil { return nil, false } @@ -65,7 +65,7 @@ func (o *ArrayOfNumberOnly) HasArrayNumber() bool { // SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { - o.ArrayNumber = &v + o.ArrayNumber = v } func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go-petstore/model_array_test_.go b/samples/client/petstore/go/go-petstore/model_array_test_.go index 54f72759d3f..b33b09a55db 100644 --- a/samples/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore/model_array_test_.go @@ -16,9 +16,9 @@ import ( // ArrayTest struct for ArrayTest type ArrayTest struct { - ArrayOfString *[]string `json:"array_of_string,omitempty"` - ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` - ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + ArrayOfString []string `json:"array_of_string,omitempty"` + ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` + ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` } // NewArrayTest instantiates a new ArrayTest object @@ -44,12 +44,12 @@ func (o *ArrayTest) GetArrayOfString() []string { var ret []string return ret } - return *o.ArrayOfString + return o.ArrayOfString } // GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool) { +func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool) { if o == nil || o.ArrayOfString == nil { return nil, false } @@ -67,7 +67,7 @@ func (o *ArrayTest) HasArrayOfString() bool { // SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. func (o *ArrayTest) SetArrayOfString(v []string) { - o.ArrayOfString = &v + o.ArrayOfString = v } // GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. @@ -76,12 +76,12 @@ func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { var ret [][]int64 return ret } - return *o.ArrayArrayOfInteger + return o.ArrayArrayOfInteger } // GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool) { +func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool) { if o == nil || o.ArrayArrayOfInteger == nil { return nil, false } @@ -99,7 +99,7 @@ func (o *ArrayTest) HasArrayArrayOfInteger() bool { // SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { - o.ArrayArrayOfInteger = &v + o.ArrayArrayOfInteger = v } // GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. @@ -108,12 +108,12 @@ func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { var ret [][]ReadOnlyFirst return ret } - return *o.ArrayArrayOfModel + return o.ArrayArrayOfModel } // GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool) { +func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool) { if o == nil || o.ArrayArrayOfModel == nil { return nil, false } @@ -131,7 +131,7 @@ func (o *ArrayTest) HasArrayArrayOfModel() bool { // SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { - o.ArrayArrayOfModel = &v + o.ArrayArrayOfModel = v } func (o ArrayTest) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/client/petstore/go/go-petstore/model_enum_arrays.go index ed2f6e8b145..19dc8bc8e98 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/model_enum_arrays.go @@ -17,7 +17,7 @@ import ( // EnumArrays struct for EnumArrays type EnumArrays struct { JustSymbol *string `json:"just_symbol,omitempty"` - ArrayEnum *[]string `json:"array_enum,omitempty"` + ArrayEnum []string `json:"array_enum,omitempty"` } // NewEnumArrays instantiates a new EnumArrays object @@ -75,12 +75,12 @@ func (o *EnumArrays) GetArrayEnum() []string { var ret []string return ret } - return *o.ArrayEnum + return o.ArrayEnum } // GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool) { +func (o *EnumArrays) GetArrayEnumOk() ([]string, bool) { if o == nil || o.ArrayEnum == nil { return nil, false } @@ -98,7 +98,7 @@ func (o *EnumArrays) HasArrayEnum() bool { // SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. func (o *EnumArrays) SetArrayEnum(v []string) { - o.ArrayEnum = &v + o.ArrayEnum = v } func (o EnumArrays) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go index 78fbc5aa2c2..52dcf0e1e9f 100644 --- a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -17,7 +17,7 @@ import ( // FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { File *File `json:"file,omitempty"` - Files *[]File `json:"files,omitempty"` + Files []File `json:"files,omitempty"` } // NewFileSchemaTestClass instantiates a new FileSchemaTestClass object @@ -75,12 +75,12 @@ func (o *FileSchemaTestClass) GetFiles() []File { var ret []File return ret } - return *o.Files + return o.Files } // GetFilesOk returns a tuple with the Files field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool) { +func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool) { if o == nil || o.Files == nil { return nil, false } @@ -98,7 +98,7 @@ func (o *FileSchemaTestClass) HasFiles() bool { // SetFiles gets a reference to the given []File and assigns it to the Files field. func (o *FileSchemaTestClass) SetFiles(v []File) { - o.Files = &v + o.Files = v } func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index 2d07615cb4f..538b9aa4d1f 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -20,7 +20,7 @@ type Pet struct { Category *Category `json:"category,omitempty"` Name string `json:"name"` PhotoUrls []string `json:"photoUrls"` - Tags *[]Tag `json:"tags,omitempty"` + Tags []Tag `json:"tags,omitempty"` // pet status in the store Status *string `json:"status,omitempty"` } @@ -144,11 +144,11 @@ func (o *Pet) GetPhotoUrls() []string { // GetPhotoUrlsOk returns a tuple with the PhotoUrls field value // and a boolean to check if the value has been set. -func (o *Pet) GetPhotoUrlsOk() (*[]string, bool) { +func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { if o == nil { return nil, false } - return &o.PhotoUrls, true + return o.PhotoUrls, true } // SetPhotoUrls sets field value @@ -162,12 +162,12 @@ func (o *Pet) GetTags() []Tag { var ret []Tag return ret } - return *o.Tags + return o.Tags } // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Pet) GetTagsOk() (*[]Tag, bool) { +func (o *Pet) GetTagsOk() ([]Tag, bool) { if o == nil || o.Tags == nil { return nil, false } @@ -185,7 +185,7 @@ func (o *Pet) HasTags() bool { // SetTags gets a reference to the given []Tag and assigns it to the Tags field. func (o *Pet) SetTags(v []Tag) { - o.Tags = &v + o.Tags = v } // GetStatus returns the Status field value if set, zero value otherwise. diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_default.go b/samples/client/petstore/go/go-petstore/model_type_holder_default.go index 91d7c3014b6..34bef67ff01 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_default.go @@ -157,11 +157,11 @@ func (o *TypeHolderDefault) GetArrayItem() []int32 { // GetArrayItemOk returns a tuple with the ArrayItem field value // and a boolean to check if the value has been set. -func (o *TypeHolderDefault) GetArrayItemOk() (*[]int32, bool) { +func (o *TypeHolderDefault) GetArrayItemOk() ([]int32, bool) { if o == nil { return nil, false } - return &o.ArrayItem, true + return o.ArrayItem, true } // SetArrayItem sets field value diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_example.go b/samples/client/petstore/go/go-petstore/model_type_holder_example.go index 084c4d4c380..fd363cdb293 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_example.go @@ -179,11 +179,11 @@ func (o *TypeHolderExample) GetArrayItem() []int32 { // GetArrayItemOk returns a tuple with the ArrayItem field value // and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetArrayItemOk() (*[]int32, bool) { +func (o *TypeHolderExample) GetArrayItemOk() ([]int32, bool) { if o == nil { return nil, false } - return &o.ArrayItem, true + return o.ArrayItem, true } // SetArrayItem sets field value diff --git a/samples/client/petstore/go/go-petstore/model_xml_item.go b/samples/client/petstore/go/go-petstore/model_xml_item.go index 4d01502ae73..31a23e27309 100644 --- a/samples/client/petstore/go/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore/model_xml_item.go @@ -20,31 +20,31 @@ type XmlItem struct { AttributeNumber *float32 `json:"attribute_number,omitempty"` AttributeInteger *int32 `json:"attribute_integer,omitempty"` AttributeBoolean *bool `json:"attribute_boolean,omitempty"` - WrappedArray *[]int32 `json:"wrapped_array,omitempty"` + WrappedArray []int32 `json:"wrapped_array,omitempty"` NameString *string `json:"name_string,omitempty"` NameNumber *float32 `json:"name_number,omitempty"` NameInteger *int32 `json:"name_integer,omitempty"` NameBoolean *bool `json:"name_boolean,omitempty"` - NameArray *[]int32 `json:"name_array,omitempty"` - NameWrappedArray *[]int32 `json:"name_wrapped_array,omitempty"` + NameArray []int32 `json:"name_array,omitempty"` + NameWrappedArray []int32 `json:"name_wrapped_array,omitempty"` PrefixString *string `json:"prefix_string,omitempty"` PrefixNumber *float32 `json:"prefix_number,omitempty"` PrefixInteger *int32 `json:"prefix_integer,omitempty"` PrefixBoolean *bool `json:"prefix_boolean,omitempty"` - PrefixArray *[]int32 `json:"prefix_array,omitempty"` - PrefixWrappedArray *[]int32 `json:"prefix_wrapped_array,omitempty"` + PrefixArray []int32 `json:"prefix_array,omitempty"` + PrefixWrappedArray []int32 `json:"prefix_wrapped_array,omitempty"` NamespaceString *string `json:"namespace_string,omitempty"` NamespaceNumber *float32 `json:"namespace_number,omitempty"` NamespaceInteger *int32 `json:"namespace_integer,omitempty"` NamespaceBoolean *bool `json:"namespace_boolean,omitempty"` - NamespaceArray *[]int32 `json:"namespace_array,omitempty"` - NamespaceWrappedArray *[]int32 `json:"namespace_wrapped_array,omitempty"` + NamespaceArray []int32 `json:"namespace_array,omitempty"` + NamespaceWrappedArray []int32 `json:"namespace_wrapped_array,omitempty"` PrefixNsString *string `json:"prefix_ns_string,omitempty"` PrefixNsNumber *float32 `json:"prefix_ns_number,omitempty"` PrefixNsInteger *int32 `json:"prefix_ns_integer,omitempty"` PrefixNsBoolean *bool `json:"prefix_ns_boolean,omitempty"` - PrefixNsArray *[]int32 `json:"prefix_ns_array,omitempty"` - PrefixNsWrappedArray *[]int32 `json:"prefix_ns_wrapped_array,omitempty"` + PrefixNsArray []int32 `json:"prefix_ns_array,omitempty"` + PrefixNsWrappedArray []int32 `json:"prefix_ns_wrapped_array,omitempty"` } // NewXmlItem instantiates a new XmlItem object @@ -198,12 +198,12 @@ func (o *XmlItem) GetWrappedArray() []int32 { var ret []int32 return ret } - return *o.WrappedArray + return o.WrappedArray } // GetWrappedArrayOk returns a tuple with the WrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetWrappedArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetWrappedArrayOk() ([]int32, bool) { if o == nil || o.WrappedArray == nil { return nil, false } @@ -221,7 +221,7 @@ func (o *XmlItem) HasWrappedArray() bool { // SetWrappedArray gets a reference to the given []int32 and assigns it to the WrappedArray field. func (o *XmlItem) SetWrappedArray(v []int32) { - o.WrappedArray = &v + o.WrappedArray = v } // GetNameString returns the NameString field value if set, zero value otherwise. @@ -358,12 +358,12 @@ func (o *XmlItem) GetNameArray() []int32 { var ret []int32 return ret } - return *o.NameArray + return o.NameArray } // GetNameArrayOk returns a tuple with the NameArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetNameArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetNameArrayOk() ([]int32, bool) { if o == nil || o.NameArray == nil { return nil, false } @@ -381,7 +381,7 @@ func (o *XmlItem) HasNameArray() bool { // SetNameArray gets a reference to the given []int32 and assigns it to the NameArray field. func (o *XmlItem) SetNameArray(v []int32) { - o.NameArray = &v + o.NameArray = v } // GetNameWrappedArray returns the NameWrappedArray field value if set, zero value otherwise. @@ -390,12 +390,12 @@ func (o *XmlItem) GetNameWrappedArray() []int32 { var ret []int32 return ret } - return *o.NameWrappedArray + return o.NameWrappedArray } // GetNameWrappedArrayOk returns a tuple with the NameWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetNameWrappedArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetNameWrappedArrayOk() ([]int32, bool) { if o == nil || o.NameWrappedArray == nil { return nil, false } @@ -413,7 +413,7 @@ func (o *XmlItem) HasNameWrappedArray() bool { // SetNameWrappedArray gets a reference to the given []int32 and assigns it to the NameWrappedArray field. func (o *XmlItem) SetNameWrappedArray(v []int32) { - o.NameWrappedArray = &v + o.NameWrappedArray = v } // GetPrefixString returns the PrefixString field value if set, zero value otherwise. @@ -550,12 +550,12 @@ func (o *XmlItem) GetPrefixArray() []int32 { var ret []int32 return ret } - return *o.PrefixArray + return o.PrefixArray } // GetPrefixArrayOk returns a tuple with the PrefixArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetPrefixArrayOk() ([]int32, bool) { if o == nil || o.PrefixArray == nil { return nil, false } @@ -573,7 +573,7 @@ func (o *XmlItem) HasPrefixArray() bool { // SetPrefixArray gets a reference to the given []int32 and assigns it to the PrefixArray field. func (o *XmlItem) SetPrefixArray(v []int32) { - o.PrefixArray = &v + o.PrefixArray = v } // GetPrefixWrappedArray returns the PrefixWrappedArray field value if set, zero value otherwise. @@ -582,12 +582,12 @@ func (o *XmlItem) GetPrefixWrappedArray() []int32 { var ret []int32 return ret } - return *o.PrefixWrappedArray + return o.PrefixWrappedArray } // GetPrefixWrappedArrayOk returns a tuple with the PrefixWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixWrappedArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetPrefixWrappedArrayOk() ([]int32, bool) { if o == nil || o.PrefixWrappedArray == nil { return nil, false } @@ -605,7 +605,7 @@ func (o *XmlItem) HasPrefixWrappedArray() bool { // SetPrefixWrappedArray gets a reference to the given []int32 and assigns it to the PrefixWrappedArray field. func (o *XmlItem) SetPrefixWrappedArray(v []int32) { - o.PrefixWrappedArray = &v + o.PrefixWrappedArray = v } // GetNamespaceString returns the NamespaceString field value if set, zero value otherwise. @@ -742,12 +742,12 @@ func (o *XmlItem) GetNamespaceArray() []int32 { var ret []int32 return ret } - return *o.NamespaceArray + return o.NamespaceArray } // GetNamespaceArrayOk returns a tuple with the NamespaceArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetNamespaceArrayOk() ([]int32, bool) { if o == nil || o.NamespaceArray == nil { return nil, false } @@ -765,7 +765,7 @@ func (o *XmlItem) HasNamespaceArray() bool { // SetNamespaceArray gets a reference to the given []int32 and assigns it to the NamespaceArray field. func (o *XmlItem) SetNamespaceArray(v []int32) { - o.NamespaceArray = &v + o.NamespaceArray = v } // GetNamespaceWrappedArray returns the NamespaceWrappedArray field value if set, zero value otherwise. @@ -774,12 +774,12 @@ func (o *XmlItem) GetNamespaceWrappedArray() []int32 { var ret []int32 return ret } - return *o.NamespaceWrappedArray + return o.NamespaceWrappedArray } // GetNamespaceWrappedArrayOk returns a tuple with the NamespaceWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceWrappedArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetNamespaceWrappedArrayOk() ([]int32, bool) { if o == nil || o.NamespaceWrappedArray == nil { return nil, false } @@ -797,7 +797,7 @@ func (o *XmlItem) HasNamespaceWrappedArray() bool { // SetNamespaceWrappedArray gets a reference to the given []int32 and assigns it to the NamespaceWrappedArray field. func (o *XmlItem) SetNamespaceWrappedArray(v []int32) { - o.NamespaceWrappedArray = &v + o.NamespaceWrappedArray = v } // GetPrefixNsString returns the PrefixNsString field value if set, zero value otherwise. @@ -934,12 +934,12 @@ func (o *XmlItem) GetPrefixNsArray() []int32 { var ret []int32 return ret } - return *o.PrefixNsArray + return o.PrefixNsArray } // GetPrefixNsArrayOk returns a tuple with the PrefixNsArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetPrefixNsArrayOk() ([]int32, bool) { if o == nil || o.PrefixNsArray == nil { return nil, false } @@ -957,7 +957,7 @@ func (o *XmlItem) HasPrefixNsArray() bool { // SetPrefixNsArray gets a reference to the given []int32 and assigns it to the PrefixNsArray field. func (o *XmlItem) SetPrefixNsArray(v []int32) { - o.PrefixNsArray = &v + o.PrefixNsArray = v } // GetPrefixNsWrappedArray returns the PrefixNsWrappedArray field value if set, zero value otherwise. @@ -966,12 +966,12 @@ func (o *XmlItem) GetPrefixNsWrappedArray() []int32 { var ret []int32 return ret } - return *o.PrefixNsWrappedArray + return o.PrefixNsWrappedArray } // GetPrefixNsWrappedArrayOk returns a tuple with the PrefixNsWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsWrappedArrayOk() (*[]int32, bool) { +func (o *XmlItem) GetPrefixNsWrappedArrayOk() ([]int32, bool) { if o == nil || o.PrefixNsWrappedArray == nil { return nil, false } @@ -989,7 +989,7 @@ func (o *XmlItem) HasPrefixNsWrappedArray() bool { // SetPrefixNsWrappedArray gets a reference to the given []int32 and assigns it to the PrefixNsWrappedArray field. func (o *XmlItem) SetPrefixNsWrappedArray(v []int32) { - o.PrefixNsWrappedArray = &v + o.PrefixNsWrappedArray = v } func (o XmlItem) MarshalJSON() ([]byte, error) { diff --git a/samples/client/petstore/go/go.mod b/samples/client/petstore/go/go.mod new file mode 100644 index 00000000000..b8b87c5fe95 --- /dev/null +++ b/samples/client/petstore/go/go.mod @@ -0,0 +1,11 @@ +module github.com/OpenAPITools/openapi-generator/samples/client/petstore/go + +replace github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore => ./go-petstore + +go 1.13 + +require ( + github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore v0.0.0-00010101000000-000000000000 + github.com/stretchr/testify v1.7.0 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 +) diff --git a/samples/client/petstore/go/go.sum b/samples/client/petstore/go/go.sum new file mode 100644 index 00000000000..0df1d1a38a0 --- /dev/null +++ b/samples/client/petstore/go/go.sum @@ -0,0 +1,371 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 h1:D7nTwh4J0i+5mW4Zjzn5omvlr6YBcWywE6KOcatyNxY= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/samples/client/petstore/go/mock/mock_api_pet.go b/samples/client/petstore/go/mock/mock_api_pet.go index 84686bb5f2e..66a4f27adc0 100644 --- a/samples/client/petstore/go/mock/mock_api_pet.go +++ b/samples/client/petstore/go/mock/mock_api_pet.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - sw "../go-petstore" + sw "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore" ) // MockPetApi is a mock of the PetApi interface @@ -21,7 +21,7 @@ func (m *MockPetApi) AddPet(ctx context.Context) sw.ApiAddPetRequest { } func (m *MockPetApi) AddPetExecute(r sw.ApiAddPetRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil + return &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) DeletePet(ctx context.Context, petId int64) sw.ApiDeletePetRequest { @@ -29,7 +29,7 @@ func (m *MockPetApi) DeletePet(ctx context.Context, petId int64) sw.ApiDeletePet } func (m *MockPetApi) DeletePetExecute(r sw.ApiDeletePetRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil + return &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) FindPetsByStatus(ctx context.Context) sw.ApiFindPetsByStatusRequest { @@ -37,7 +37,7 @@ func (m *MockPetApi) FindPetsByStatus(ctx context.Context) sw.ApiFindPetsByStatu } func (m *MockPetApi) FindPetsByStatusExecute(r sw.ApiFindPetsByStatusRequest) ([]sw.Pet, *http.Response, error) { - return []sw.Pet{}, &http.Response{StatusCode:200}, nil + return []sw.Pet{}, &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) FindPetsByTags(ctx context.Context) sw.ApiFindPetsByTagsRequest { @@ -45,15 +45,15 @@ func (m *MockPetApi) FindPetsByTags(ctx context.Context) sw.ApiFindPetsByTagsReq } func (m *MockPetApi) FindPetsByTagsExecute(r sw.ApiFindPetsByTagsRequest) ([]sw.Pet, *http.Response, error) { - return []sw.Pet{}, &http.Response{StatusCode:200}, nil + return []sw.Pet{}, &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) GetPetById(ctx context.Context, petId int64) sw.ApiGetPetByIdRequest { return sw.ApiGetPetByIdRequest{ApiService: m} } -func (m *MockPetApi) GetPetByIdExecute(r sw.ApiGetPetByIdRequest) (sw.Pet, *http.Response, error) { - return sw.Pet{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) GetPetByIdExecute(r sw.ApiGetPetByIdRequest) (*sw.Pet, *http.Response, error) { + return &sw.Pet{}, &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) UpdatePet(ctx context.Context) sw.ApiUpdatePetRequest { @@ -61,7 +61,7 @@ func (m *MockPetApi) UpdatePet(ctx context.Context) sw.ApiUpdatePetRequest { } func (m *MockPetApi) UpdatePetExecute(r sw.ApiUpdatePetRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil + return &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) UpdatePetWithForm(ctx context.Context, petId int64) sw.ApiUpdatePetWithFormRequest { @@ -69,21 +69,21 @@ func (m *MockPetApi) UpdatePetWithForm(ctx context.Context, petId int64) sw.ApiU } func (m *MockPetApi) UpdatePetWithFormExecute(r sw.ApiUpdatePetWithFormRequest) (*http.Response, error) { - return &http.Response{StatusCode:200}, nil + return &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) UploadFile(ctx context.Context, petId int64) sw.ApiUploadFileRequest { return sw.ApiUploadFileRequest{ApiService: m} } -func (m *MockPetApi) UploadFileExecute(r sw.ApiUploadFileRequest) (sw.ApiResponse, *http.Response, error) { - return sw.ApiResponse{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) UploadFileExecute(r sw.ApiUploadFileRequest) (*sw.ApiResponse, *http.Response, error) { + return &sw.ApiResponse{}, &http.Response{StatusCode: 200}, nil } func (m *MockPetApi) UploadFileWithRequiredFile(ctx context.Context, petId int64) sw.ApiUploadFileWithRequiredFileRequest { return sw.ApiUploadFileWithRequiredFileRequest{ApiService: m} } -func (m *MockPetApi) UploadFileWithRequiredFileExecute(r sw.ApiUploadFileWithRequiredFileRequest) (sw.ApiResponse, *http.Response, error) { - return sw.ApiResponse{}, &http.Response{StatusCode:200}, nil +func (m *MockPetApi) UploadFileWithRequiredFileExecute(r sw.ApiUploadFileWithRequiredFileRequest) (*sw.ApiResponse, *http.Response, error) { + return &sw.ApiResponse{}, &http.Response{StatusCode: 200}, nil } diff --git a/samples/client/petstore/go/pet_api_test.go b/samples/client/petstore/go/pet_api_test.go index 0868c4b96cc..0a17cbed8f0 100644 --- a/samples/client/petstore/go/pet_api_test.go +++ b/samples/client/petstore/go/pet_api_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" - sw "./go-petstore" - mock "./mock" + sw "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore" + mock "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/mock" ) var client *sw.APIClient @@ -30,7 +30,7 @@ func TestMain(m *testing.M) { func TestAddPet(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() @@ -69,7 +69,7 @@ func TestGetPetById(t *testing.T) { func TestGetPetByIdWithInvalidID(t *testing.T) { resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() if r != nil && r.StatusCode == 404 { - assertedError, ok := err.(sw.GenericOpenAPIError) + assertedError, ok := err.(*sw.GenericOpenAPIError) a := assert.New(t) a.True(ok) a.Contains(string(assertedError.Body()), "type") diff --git a/samples/client/petstore/go/store_api_test.go b/samples/client/petstore/go/store_api_test.go index f9f55273eb9..94ca695c17b 100644 --- a/samples/client/petstore/go/store_api_test.go +++ b/samples/client/petstore/go/store_api_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - sw "./go-petstore" + sw "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore" ) func TestPlaceOrder(t *testing.T) { diff --git a/samples/client/petstore/go/user_api_test.go b/samples/client/petstore/go/user_api_test.go index 361e77ac9aa..52195d6caac 100644 --- a/samples/client/petstore/go/user_api_test.go +++ b/samples/client/petstore/go/user_api_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - sw "./go-petstore" + sw "github.com/OpenAPITools/openapi-generator/samples/client/petstore/go/go-petstore" ) func TestCreateUser(t *testing.T) { @@ -33,7 +33,7 @@ func TestCreateUser(t *testing.T) { //adding x to skip the test, currently it is failing func TestCreateUsersWithArrayInput(t *testing.T) { newUsers := []sw.User{ - sw.User{ + { Id: sw.PtrInt64(1001), FirstName: sw.PtrString("gopher1"), LastName: sw.PtrString("lang1"), @@ -43,7 +43,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { Phone: sw.PtrString("5101112222"), UserStatus: sw.PtrInt32(1), }, - sw.User{ + { Id: sw.PtrInt64(1002), FirstName: sw.PtrString("gopher2"), LastName: sw.PtrString("lang2"), @@ -62,7 +62,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { if apiResponse.StatusCode != 200 { t.Log(apiResponse) } -/* issue deleting users due to issue in the server side (500). commented out below for the time being + /* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() if err1 != nil { @@ -75,7 +75,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Errorf("Error while deleting user") t.Log(err2) } -*/ + */ } func TestGetUserByName(t *testing.T) { diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md index f765717c5fe..5921adf7dcf 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md @@ -22,7 +22,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./x_auth_id_alias" +import x_auth_id_alias "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: @@ -40,7 +40,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerIndex, 1) ``` ### Templated Server URL @@ -48,7 +48,7 @@ ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -62,10 +62,10 @@ An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. ``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), x_auth_id_alias.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index 6e891fbe6fa..8ba9a49d9d3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -12,27 +12,27 @@ package x_auth_id_alias import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) // Linger please var ( - _ _context.Context + _ context.Context ) // UsageApiService UsageApi service type UsageApiService service type ApiAnyKeyRequest struct { - ctx _context.Context + ctx context.Context ApiService *UsageApiService } -func (r ApiAnyKeyRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiAnyKeyRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.AnyKeyExecute(r) } @@ -41,10 +41,10 @@ AnyKey Use any API key Use any API key - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAnyKeyRequest */ -func (a *UsageApiService) AnyKey(ctx _context.Context) ApiAnyKeyRequest { +func (a *UsageApiService) AnyKey(ctx context.Context) ApiAnyKeyRequest { return ApiAnyKeyRequest{ ApiService: a, ctx: ctx, @@ -53,9 +53,9 @@ func (a *UsageApiService) AnyKey(ctx _context.Context) ApiAnyKeyRequest { // Execute executes the request // @return map[string]interface{} -func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue map[string]interface{} @@ -63,14 +63,14 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.AnyKey") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/any" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -127,15 +127,15 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -144,7 +144,7 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -155,12 +155,12 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac } type ApiBothKeysRequest struct { - ctx _context.Context + ctx context.Context ApiService *UsageApiService } -func (r ApiBothKeysRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiBothKeysRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.BothKeysExecute(r) } @@ -169,10 +169,10 @@ BothKeys Use both API keys Use both API keys - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiBothKeysRequest */ -func (a *UsageApiService) BothKeys(ctx _context.Context) ApiBothKeysRequest { +func (a *UsageApiService) BothKeys(ctx context.Context) ApiBothKeysRequest { return ApiBothKeysRequest{ ApiService: a, ctx: ctx, @@ -181,9 +181,9 @@ func (a *UsageApiService) BothKeys(ctx _context.Context) ApiBothKeysRequest { // Execute executes the request // @return map[string]interface{} -func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue map[string]interface{} @@ -191,14 +191,14 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.BothKeys") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/both" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -255,15 +255,15 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -272,7 +272,7 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -283,12 +283,12 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte } type ApiKeyInHeaderRequest struct { - ctx _context.Context + ctx context.Context ApiService *UsageApiService } -func (r ApiKeyInHeaderRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiKeyInHeaderRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.KeyInHeaderExecute(r) } @@ -297,10 +297,10 @@ KeyInHeader Use API key in header Use API key in header - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiKeyInHeaderRequest */ -func (a *UsageApiService) KeyInHeader(ctx _context.Context) ApiKeyInHeaderRequest { +func (a *UsageApiService) KeyInHeader(ctx context.Context) ApiKeyInHeaderRequest { return ApiKeyInHeaderRequest{ ApiService: a, ctx: ctx, @@ -309,9 +309,9 @@ func (a *UsageApiService) KeyInHeader(ctx _context.Context) ApiKeyInHeaderReques // Execute executes the request // @return map[string]interface{} -func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[string]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue map[string]interface{} @@ -319,14 +319,14 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInHeader") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/header" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -369,15 +369,15 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -386,7 +386,7 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -397,12 +397,12 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin } type ApiKeyInQueryRequest struct { - ctx _context.Context + ctx context.Context ApiService *UsageApiService } -func (r ApiKeyInQueryRequest) Execute() (map[string]interface{}, *_nethttp.Response, error) { +func (r ApiKeyInQueryRequest) Execute() (map[string]interface{}, *http.Response, error) { return r.ApiService.KeyInQueryExecute(r) } @@ -411,10 +411,10 @@ KeyInQuery Use API key in query Use API key in query - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiKeyInQueryRequest */ -func (a *UsageApiService) KeyInQuery(ctx _context.Context) ApiKeyInQueryRequest { +func (a *UsageApiService) KeyInQuery(ctx context.Context) ApiKeyInQueryRequest { return ApiKeyInQueryRequest{ ApiService: a, ctx: ctx, @@ -423,9 +423,9 @@ func (a *UsageApiService) KeyInQuery(ctx _context.Context) ApiKeyInQueryRequest // Execute executes the request // @return map[string]interface{} -func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string]interface{}, *_nethttp.Response, error) { +func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string]interface{}, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue map[string]interface{} @@ -433,14 +433,14 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsageApiService.KeyInQuery") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/query" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -483,15 +483,15 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -500,7 +500,7 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go index f7a7c368cbf..d538f243533 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go @@ -422,6 +422,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md index 6322c976a68..f6d814dedf2 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageApi.md @@ -34,8 +34,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UsageApi.AnyKey(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageApi.AnyKey(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.AnyKey``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -95,8 +95,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UsageApi.BothKeys(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageApi.BothKeys(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.BothKeys``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -156,8 +156,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UsageApi.KeyInHeader(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageApi.KeyInHeader(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.KeyInHeader``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -217,8 +217,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UsageApi.KeyInQuery(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageApi.KeyInQuery(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageApi.KeyInQuery``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/go.mod b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/go.mod index 0f43de9ebb2..ead32606c72 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/go.mod +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/go.mod @@ -3,5 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.13 require ( - golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 ) diff --git a/samples/openapi3/client/petstore/go/auth_test.go b/samples/openapi3/client/petstore/go/auth_test.go index c56d64e5e51..52f5875f637 100644 --- a/samples/openapi3/client/petstore/go/auth_test.go +++ b/samples/openapi3/client/petstore/go/auth_test.go @@ -10,7 +10,7 @@ import ( "golang.org/x/oauth2" - sw "./go-petstore" + sw "go-petstore" ) func TestOAuth2(t *testing.T) { @@ -39,7 +39,7 @@ func TestOAuth2(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() @@ -74,7 +74,7 @@ func TestBasicAuth(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(auth).Pet(newPet).Execute() @@ -104,7 +104,7 @@ func TestAccessToken(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() @@ -130,11 +130,11 @@ func TestAccessToken(t *testing.T) { } func TestAPIKeyNoPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": {Key: "TEST123"}}) newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() @@ -165,11 +165,11 @@ func TestAPIKeyNoPrefix(t *testing.T) { } func TestAPIKeyWithPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": {Key: "TEST123", Prefix: "Bearer"}}) newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() @@ -202,7 +202,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { func TestDefaultHeader(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() diff --git a/samples/openapi3/client/petstore/go/fake_api_test.go b/samples/openapi3/client/petstore/go/fake_api_test.go index 97910bf3cf7..b25af45ee6c 100644 --- a/samples/openapi3/client/petstore/go/fake_api_test.go +++ b/samples/openapi3/client/petstore/go/fake_api_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - sw "./go-petstore" + sw "go-petstore" ) // TestPutBodyWithFileSchema ensures a model with the name 'File' @@ -15,7 +15,7 @@ func TestPutBodyWithFileSchema(t *testing.T) { schema := sw.FileSchemaTestClass{ File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, - Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} + Files: []sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(schema).Execute() diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 64d951b11c0..10f8ee9f436 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -22,7 +22,7 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: ```golang -import sw "./petstore" +import petstore "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: @@ -40,7 +40,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) ``` ### Templated Server URL @@ -48,7 +48,7 @@ ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. ```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -62,10 +62,10 @@ An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. ``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), petstore.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, @@ -206,7 +206,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example ```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` @@ -233,7 +233,7 @@ r, err := client.Service.Operation(auth, args) Example ```golang - authConfig := sw.HttpSignatureAuth{ + authConfig := client.HttpSignatureAuth{ KeyId: "my-key-id", PrivateKeyPath: "rsa.pem", Passphrase: "my-passphrase", diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 640c21d7250..d1ac2900c4c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -12,15 +12,15 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) // Linger please var ( - _ _context.Context + _ context.Context ) type AnotherFakeApi interface { @@ -30,21 +30,21 @@ type AnotherFakeApi interface { To test special tags and operation ID starting with number - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCall123TestSpecialTagsRequest */ - Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest + Call123TestSpecialTags(ctx context.Context) ApiCall123TestSpecialTagsRequest // Call123TestSpecialTagsExecute executes the request // @return Client - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) + Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (*Client, *http.Response, error) } // AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service type ApiCall123TestSpecialTagsRequest struct { - ctx _context.Context + ctx context.Context ApiService AnotherFakeApi client *Client } @@ -55,7 +55,7 @@ func (r ApiCall123TestSpecialTagsRequest) Client(client Client) ApiCall123TestSp return r } -func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiCall123TestSpecialTagsRequest) Execute() (*Client, *http.Response, error) { return r.ApiService.Call123TestSpecialTagsExecute(r) } @@ -64,10 +64,10 @@ Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCall123TestSpecialTagsRequest */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context) ApiCall123TestSpecialTagsRequest { return ApiCall123TestSpecialTagsRequest{ ApiService: a, ctx: ctx, @@ -76,24 +76,24 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) Api // Execute executes the request // @return Client -func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (*Client, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue Client + localVarReturnValue *Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/another-fake/dummy" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.client == nil { return localVarReturnValue, nil, reportError("client is required and must be specified") } @@ -127,15 +127,15 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -144,7 +144,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index be637eceddf..f5cd2374541 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -12,15 +12,15 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) // Linger please var ( - _ _context.Context + _ context.Context ) type DefaultApi interface { @@ -28,36 +28,36 @@ type DefaultApi interface { /* FooGet Method for FooGet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFooGetRequest */ - FooGet(ctx _context.Context) ApiFooGetRequest + FooGet(ctx context.Context) ApiFooGetRequest // FooGetExecute executes the request // @return InlineResponseDefault - FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) + FooGetExecute(r ApiFooGetRequest) (*InlineResponseDefault, *http.Response, error) } // DefaultApiService DefaultApi service type DefaultApiService service type ApiFooGetRequest struct { - ctx _context.Context + ctx context.Context ApiService DefaultApi } -func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) { +func (r ApiFooGetRequest) Execute() (*InlineResponseDefault, *http.Response, error) { return r.ApiService.FooGetExecute(r) } /* FooGet Method for FooGet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFooGetRequest */ -func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest { +func (a *DefaultApiService) FooGet(ctx context.Context) ApiFooGetRequest { return ApiFooGetRequest{ ApiService: a, ctx: ctx, @@ -66,24 +66,24 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest { // Execute executes the request // @return InlineResponseDefault -func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) { +func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (*InlineResponseDefault, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue InlineResponseDefault + localVarReturnValue *InlineResponseDefault ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/foo" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -112,15 +112,15 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -156,7 +156,7 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index a2cb81b7fea..1f4a8802ab0 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -12,10 +12,10 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "os" "time" "reflect" @@ -23,7 +23,7 @@ import ( // Linger please var ( - _ _context.Context + _ context.Context ) type FakeApi interface { @@ -31,108 +31,108 @@ type FakeApi interface { /* FakeHealthGet Health check endpoint - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeHealthGetRequest */ - FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest + FakeHealthGet(ctx context.Context) ApiFakeHealthGetRequest // FakeHealthGetExecute executes the request // @return HealthCheckResult - FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) + FakeHealthGetExecute(r ApiFakeHealthGetRequest) (*HealthCheckResult, *http.Response, error) /* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterBooleanSerializeRequest */ - FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest + FakeOuterBooleanSerialize(ctx context.Context) ApiFakeOuterBooleanSerializeRequest // FakeOuterBooleanSerializeExecute executes the request // @return bool - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) + FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *http.Response, error) /* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterCompositeSerializeRequest */ - FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest + FakeOuterCompositeSerialize(ctx context.Context) ApiFakeOuterCompositeSerializeRequest // FakeOuterCompositeSerializeExecute executes the request // @return OuterComposite - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) + FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (*OuterComposite, *http.Response, error) /* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterNumberSerializeRequest */ - FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest + FakeOuterNumberSerialize(ctx context.Context) ApiFakeOuterNumberSerializeRequest // FakeOuterNumberSerializeExecute executes the request // @return float32 - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) + FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *http.Response, error) /* FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterStringSerializeRequest */ - FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest + FakeOuterStringSerialize(ctx context.Context) ApiFakeOuterStringSerializeRequest // FakeOuterStringSerializeExecute executes the request // @return string - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) + FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *http.Response, error) /* TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithFileSchemaRequest */ - TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest + TestBodyWithFileSchema(ctx context.Context) ApiTestBodyWithFileSchemaRequest // TestBodyWithFileSchemaExecute executes the request - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) + TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*http.Response, error) /* TestBodyWithQueryParams Method for TestBodyWithQueryParams - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithQueryParamsRequest */ - TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest + TestBodyWithQueryParams(ctx context.Context) ApiTestBodyWithQueryParamsRequest // TestBodyWithQueryParamsExecute executes the request - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) + TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*http.Response, error) /* TestClientModel To test \"client\" model To test "client" model - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClientModelRequest */ - TestClientModel(ctx _context.Context) ApiTestClientModelRequest + TestClientModel(ctx context.Context) ApiTestClientModelRequest // TestClientModelExecute executes the request // @return Client - TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) + TestClientModelExecute(r ApiTestClientModelRequest) (*Client, *http.Response, error) /* TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -143,110 +143,110 @@ type FakeApi interface { 가짜 엔드 포인트 - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEndpointParametersRequest */ - TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest + TestEndpointParameters(ctx context.Context) ApiTestEndpointParametersRequest // TestEndpointParametersExecute executes the request - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) + TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*http.Response, error) /* TestEnumParameters To test enum parameters To test enum parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEnumParametersRequest */ - TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest + TestEnumParameters(ctx context.Context) ApiTestEnumParametersRequest // TestEnumParametersExecute executes the request - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) + TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*http.Response, error) /* TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestGroupParametersRequest */ - TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest + TestGroupParameters(ctx context.Context) ApiTestGroupParametersRequest // TestGroupParametersExecute executes the request - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) + TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*http.Response, error) /* TestInlineAdditionalProperties test inline additionalProperties - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestInlineAdditionalPropertiesRequest */ - TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest + TestInlineAdditionalProperties(ctx context.Context) ApiTestInlineAdditionalPropertiesRequest // TestInlineAdditionalPropertiesExecute executes the request - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) + TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*http.Response, error) /* TestJsonFormData test json serialization of form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestJsonFormDataRequest */ - TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest + TestJsonFormData(ctx context.Context) ApiTestJsonFormDataRequest // TestJsonFormDataExecute executes the request - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) + TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*http.Response, error) /* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat To test the collection format in query parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestQueryParameterCollectionFormatRequest */ - TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest + TestQueryParameterCollectionFormat(ctx context.Context) ApiTestQueryParameterCollectionFormatRequest // TestQueryParameterCollectionFormatExecute executes the request - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) + TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*http.Response, error) /* TestUniqueItemsHeaderAndQueryParameterCollectionFormat Method for TestUniqueItemsHeaderAndQueryParameterCollectionFormat To test unique items in header and query parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest */ - TestUniqueItemsHeaderAndQueryParameterCollectionFormat(ctx _context.Context) ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest + TestUniqueItemsHeaderAndQueryParameterCollectionFormat(ctx context.Context) ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest // TestUniqueItemsHeaderAndQueryParameterCollectionFormatExecute executes the request // @return []Pet - TestUniqueItemsHeaderAndQueryParameterCollectionFormatExecute(r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) ([]Pet, *_nethttp.Response, error) + TestUniqueItemsHeaderAndQueryParameterCollectionFormatExecute(r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) ([]Pet, *http.Response, error) } // FakeApiService FakeApi service type FakeApiService service type ApiFakeHealthGetRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi } -func (r ApiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, error) { +func (r ApiFakeHealthGetRequest) Execute() (*HealthCheckResult, *http.Response, error) { return r.ApiService.FakeHealthGetExecute(r) } /* FakeHealthGet Health check endpoint - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeHealthGetRequest */ -func (a *FakeApiService) FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest { +func (a *FakeApiService) FakeHealthGet(ctx context.Context) ApiFakeHealthGetRequest { return ApiFakeHealthGetRequest{ ApiService: a, ctx: ctx, @@ -255,24 +255,24 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) ApiFakeHealthGetReq // Execute executes the request // @return HealthCheckResult -func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) { +func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (*HealthCheckResult, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue HealthCheckResult + localVarReturnValue *HealthCheckResult ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/health" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -301,15 +301,15 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -318,7 +318,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -329,7 +329,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health } type ApiFakeOuterBooleanSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *bool } @@ -340,7 +340,7 @@ func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBoolean return r } -func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *http.Response, error) { return r.ApiService.FakeOuterBooleanSerializeExecute(r) } @@ -349,10 +349,10 @@ FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterBooleanSerializeRequest */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context) ApiFakeOuterBooleanSerializeRequest { return ApiFakeOuterBooleanSerializeRequest{ ApiService: a, ctx: ctx, @@ -361,9 +361,9 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFake // Execute executes the request // @return bool -func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue bool @@ -371,14 +371,14 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/boolean" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -409,15 +409,15 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -426,7 +426,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -437,7 +437,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS } type ApiFakeOuterCompositeSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi outerComposite *OuterComposite } @@ -448,7 +448,7 @@ func (r ApiFakeOuterCompositeSerializeRequest) OuterComposite(outerComposite Out return r } -func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (*OuterComposite, *http.Response, error) { return r.ApiService.FakeOuterCompositeSerializeExecute(r) } @@ -457,10 +457,10 @@ FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterCompositeSerializeRequest */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context) ApiFakeOuterCompositeSerializeRequest { return ApiFakeOuterCompositeSerializeRequest{ ApiService: a, ctx: ctx, @@ -469,24 +469,24 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFa // Execute executes the request // @return OuterComposite -func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (*OuterComposite, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue OuterComposite + localVarReturnValue *OuterComposite ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/composite" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -517,15 +517,15 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -534,7 +534,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -545,7 +545,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos } type ApiFakeOuterNumberSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *float32 } @@ -556,7 +556,7 @@ func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumbe return r } -func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *http.Response, error) { return r.ApiService.FakeOuterNumberSerializeExecute(r) } @@ -565,10 +565,10 @@ FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterNumberSerializeRequest */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context) ApiFakeOuterNumberSerializeRequest { return ApiFakeOuterNumberSerializeRequest{ ApiService: a, ctx: ctx, @@ -577,9 +577,9 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeO // Execute executes the request // @return float32 -func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue float32 @@ -587,14 +587,14 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/number" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -625,15 +625,15 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -642,7 +642,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -653,7 +653,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer } type ApiFakeOuterStringSerializeRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi body *string } @@ -664,7 +664,7 @@ func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterString return r } -func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *http.Response, error) { return r.ApiService.FakeOuterStringSerializeExecute(r) } @@ -673,10 +673,10 @@ FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFakeOuterStringSerializeRequest */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { +func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context) ApiFakeOuterStringSerializeRequest { return ApiFakeOuterStringSerializeRequest{ ApiService: a, ctx: ctx, @@ -685,9 +685,9 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeO // Execute executes the request // @return string -func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile localVarReturnValue string @@ -695,14 +695,14 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/outer/string" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -733,15 +733,15 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -750,7 +750,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -761,7 +761,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer } type ApiTestBodyWithFileSchemaRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi fileSchemaTestClass *FileSchemaTestClass } @@ -771,7 +771,7 @@ func (r ApiTestBodyWithFileSchemaRequest) FileSchemaTestClass(fileSchemaTestClas return r } -func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*http.Response, error) { return r.ApiService.TestBodyWithFileSchemaExecute(r) } @@ -780,10 +780,10 @@ TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithFileSchemaRequest */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { +func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context) ApiTestBodyWithFileSchemaRequest { return ApiTestBodyWithFileSchemaRequest{ ApiService: a, ctx: ctx, @@ -791,23 +791,23 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBod } // Execute executes the request -func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/body-with-file-schema" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.fileSchemaTestClass == nil { return nil, reportError("fileSchemaTestClass is required and must be specified") } @@ -841,15 +841,15 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -860,7 +860,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche } type ApiTestBodyWithQueryParamsRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi query *string user *User @@ -875,17 +875,17 @@ func (r ApiTestBodyWithQueryParamsRequest) User(user User) ApiTestBodyWithQueryP return r } -func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*http.Response, error) { return r.ApiService.TestBodyWithQueryParamsExecute(r) } /* TestBodyWithQueryParams Method for TestBodyWithQueryParams - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestBodyWithQueryParamsRequest */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { +func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context) ApiTestBodyWithQueryParamsRequest { return ApiTestBodyWithQueryParamsRequest{ ApiService: a, ctx: ctx, @@ -893,23 +893,23 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBo } // Execute executes the request -func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/body-with-query-params" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.query == nil { return nil, reportError("query is required and must be specified") } @@ -947,15 +947,15 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -966,7 +966,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa } type ApiTestClientModelRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi client *Client } @@ -977,7 +977,7 @@ func (r ApiTestClientModelRequest) Client(client Client) ApiTestClientModelReque return r } -func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClientModelRequest) Execute() (*Client, *http.Response, error) { return r.ApiService.TestClientModelExecute(r) } @@ -986,10 +986,10 @@ TestClientModel To test \"client\" model To test "client" model - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClientModelRequest */ -func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { +func (a *FakeApiService) TestClientModel(ctx context.Context) ApiTestClientModelRequest { return ApiTestClientModelRequest{ ApiService: a, ctx: ctx, @@ -998,24 +998,24 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientMode // Execute executes the request // @return Client -func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { +func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (*Client, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue Client + localVarReturnValue *Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.client == nil { return localVarReturnValue, nil, reportError("client is required and must be specified") } @@ -1049,15 +1049,15 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1066,7 +1066,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1077,7 +1077,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl } type ApiTestEndpointParametersRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi number *float32 double *float64 @@ -1166,7 +1166,7 @@ func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpo return r } -func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEndpointParametersRequest) Execute() (*http.Response, error) { return r.ApiService.TestEndpointParametersExecute(r) } @@ -1179,10 +1179,10 @@ Fake endpoint for testing various parameters 가짜 엔드 포인트 - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEndpointParametersRequest */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { +func (a *FakeApiService) TestEndpointParameters(ctx context.Context) ApiTestEndpointParametersRequest { return ApiTestEndpointParametersRequest{ ApiService: a, ctx: ctx, @@ -1190,23 +1190,23 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEnd } // Execute executes the request -func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.number == nil { return nil, reportError("number is required and must be specified") } @@ -1279,7 +1279,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete binaryLocalVarFile = *r.binary } if binaryLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(binaryLocalVarFile) + fbs, _ := ioutil.ReadAll(binaryLocalVarFile) binaryLocalVarFileBytes = fbs binaryLocalVarFileName = binaryLocalVarFile.Name() binaryLocalVarFile.Close() @@ -1307,15 +1307,15 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1326,7 +1326,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } type ApiTestEnumParametersRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi enumHeaderStringArray *[]string enumHeaderString *string @@ -1379,7 +1379,7 @@ func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiT return r } -func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestEnumParametersRequest) Execute() (*http.Response, error) { return r.ApiService.TestEnumParametersExecute(r) } @@ -1388,10 +1388,10 @@ TestEnumParameters To test enum parameters To test enum parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestEnumParametersRequest */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { +func (a *FakeApiService) TestEnumParameters(ctx context.Context) ApiTestEnumParametersRequest { return ApiTestEnumParametersRequest{ ApiService: a, ctx: ctx, @@ -1399,23 +1399,23 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumPar } // Execute executes the request -func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.enumQueryStringArray != nil { t := *r.enumQueryStringArray @@ -1476,15 +1476,15 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1495,7 +1495,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques } type ApiTestGroupParametersRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi requiredStringGroup *int32 requiredBooleanGroup *bool @@ -1536,7 +1536,7 @@ func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroup return r } -func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestGroupParametersRequest) Execute() (*http.Response, error) { return r.ApiService.TestGroupParametersExecute(r) } @@ -1545,10 +1545,10 @@ TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestGroupParametersRequest */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { +func (a *FakeApiService) TestGroupParameters(ctx context.Context) ApiTestGroupParametersRequest { return ApiTestGroupParametersRequest{ ApiService: a, ctx: ctx, @@ -1556,23 +1556,23 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupP } // Execute executes the request -func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.requiredStringGroup == nil { return nil, reportError("requiredStringGroup is required and must be specified") } @@ -1622,15 +1622,15 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1641,7 +1641,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ } type ApiTestInlineAdditionalPropertiesRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi requestBody *map[string]string } @@ -1652,17 +1652,17 @@ func (r ApiTestInlineAdditionalPropertiesRequest) RequestBody(requestBody map[st return r } -func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*http.Response, error) { return r.ApiService.TestInlineAdditionalPropertiesExecute(r) } /* TestInlineAdditionalProperties test inline additionalProperties - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestInlineAdditionalPropertiesRequest */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context) ApiTestInlineAdditionalPropertiesRequest { return ApiTestInlineAdditionalPropertiesRequest{ ApiService: a, ctx: ctx, @@ -1670,23 +1670,23 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) Ap } // Execute executes the request -func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/inline-additionalProperties" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.requestBody == nil { return nil, reportError("requestBody is required and must be specified") } @@ -1720,15 +1720,15 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1739,7 +1739,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd } type ApiTestJsonFormDataRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi param *string param2 *string @@ -1756,17 +1756,17 @@ func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataReq return r } -func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestJsonFormDataRequest) Execute() (*http.Response, error) { return r.ApiService.TestJsonFormDataExecute(r) } /* TestJsonFormData test json serialization of form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestJsonFormDataRequest */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { +func (a *FakeApiService) TestJsonFormData(ctx context.Context) ApiTestJsonFormDataRequest { return ApiTestJsonFormDataRequest{ ApiService: a, ctx: ctx, @@ -1774,23 +1774,23 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormD } // Execute executes the request -func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/jsonFormData" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.param == nil { return nil, reportError("param is required and must be specified") } @@ -1827,15 +1827,15 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1846,7 +1846,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( } type ApiTestQueryParameterCollectionFormatRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi pipe *[]string ioutil *[]string @@ -1876,7 +1876,7 @@ func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) return r } -func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*http.Response, error) { return r.ApiService.TestQueryParameterCollectionFormatExecute(r) } @@ -1885,10 +1885,10 @@ TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat To test the collection format in query parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx context.Context) ApiTestQueryParameterCollectionFormatRequest { return ApiTestQueryParameterCollectionFormatRequest{ ApiService: a, ctx: ctx, @@ -1896,23 +1896,23 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context } // Execute executes the request -func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { +func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/test-query-parameters" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.pipe == nil { return nil, reportError("pipe is required and must be specified") } @@ -1981,15 +1981,15 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2000,7 +2000,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer } type ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeApi queryUnique *[]string headerUnique *[]string @@ -2015,7 +2015,7 @@ func (r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) Header return r } -func (r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) Execute() ([]Pet, *http.Response, error) { return r.ApiService.TestUniqueItemsHeaderAndQueryParameterCollectionFormatExecute(r) } @@ -2024,10 +2024,10 @@ TestUniqueItemsHeaderAndQueryParameterCollectionFormat Method for TestUniqueItem To test unique items in header and query parameters - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormat(ctx _context.Context) ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest { +func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormat(ctx context.Context) ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest { return ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest{ ApiService: a, ctx: ctx, @@ -2036,9 +2036,9 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormat( // Execute executes the request // @return []Pet -func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatExecute(r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) ([]Pet, *_nethttp.Response, error) { +func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatExecute(r ApiTestUniqueItemsHeaderAndQueryParameterCollectionFormatRequest) ([]Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile localVarReturnValue []Pet @@ -2046,14 +2046,14 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestUniqueItemsHeaderAndQueryParameterCollectionFormat") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/test-unique-parameters" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.queryUnique == nil { return localVarReturnValue, nil, reportError("queryUnique is required and must be specified") } @@ -2100,15 +2100,15 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2117,7 +2117,7 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index a9e7b6279f3..fef8f4cb3d4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -12,15 +12,15 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" ) // Linger please var ( - _ _context.Context + _ context.Context ) type FakeClassnameTags123Api interface { @@ -30,21 +30,21 @@ type FakeClassnameTags123Api interface { To test class name in snake case - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClassnameRequest */ - TestClassname(ctx _context.Context) ApiTestClassnameRequest + TestClassname(ctx context.Context) ApiTestClassnameRequest // TestClassnameExecute executes the request // @return Client - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) + TestClassnameExecute(r ApiTestClassnameRequest) (*Client, *http.Response, error) } // FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service type ApiTestClassnameRequest struct { - ctx _context.Context + ctx context.Context ApiService FakeClassnameTags123Api client *Client } @@ -55,7 +55,7 @@ func (r ApiTestClassnameRequest) Client(client Client) ApiTestClassnameRequest { return r } -func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { +func (r ApiTestClassnameRequest) Execute() (*Client, *http.Response, error) { return r.ApiService.TestClassnameExecute(r) } @@ -64,10 +64,10 @@ TestClassname To test class name in snake case To test class name in snake case - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiTestClassnameRequest */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { +func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context) ApiTestClassnameRequest { return ApiTestClassnameRequest{ ApiService: a, ctx: ctx, @@ -76,24 +76,24 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) Api // Execute executes the request // @return Client -func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (*Client, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue Client + localVarReturnValue *Client ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake_classname_test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.client == nil { return localVarReturnValue, nil, reportError("client is required and must be specified") } @@ -141,15 +141,15 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -158,7 +158,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index 0b50bc15c5e..d0b5aff3871 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -12,17 +12,17 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" "os" ) // Linger please var ( - _ _context.Context + _ context.Context ) type PetApi interface { @@ -30,127 +30,127 @@ type PetApi interface { /* AddPet Add a new pet to the store - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAddPetRequest */ - AddPet(ctx _context.Context) ApiAddPetRequest + AddPet(ctx context.Context) ApiAddPetRequest // AddPetExecute executes the request - AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) + AddPetExecute(r ApiAddPetRequest) (*http.Response, error) /* DeletePet Deletes a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId Pet id to delete @return ApiDeletePetRequest */ - DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest + DeletePet(ctx context.Context, petId int64) ApiDeletePetRequest // DeletePetExecute executes the request - DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) + DeletePetExecute(r ApiDeletePetRequest) (*http.Response, error) /* FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByStatusRequest */ - FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest + FindPetsByStatus(ctx context.Context) ApiFindPetsByStatusRequest // FindPetsByStatusExecute executes the request // @return []Pet - FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *http.Response, error) /* FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByTagsRequest Deprecated */ - FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest + FindPetsByTags(ctx context.Context) ApiFindPetsByTagsRequest // FindPetsByTagsExecute executes the request // @return []Pet // Deprecated - FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) + FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *http.Response, error) /* GetPetById Find pet by ID Returns a single pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to return @return ApiGetPetByIdRequest */ - GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest + GetPetById(ctx context.Context, petId int64) ApiGetPetByIdRequest // GetPetByIdExecute executes the request // @return Pet - GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) + GetPetByIdExecute(r ApiGetPetByIdRequest) (*Pet, *http.Response, error) /* UpdatePet Update an existing pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiUpdatePetRequest */ - UpdatePet(ctx _context.Context) ApiUpdatePetRequest + UpdatePet(ctx context.Context) ApiUpdatePetRequest // UpdatePetExecute executes the request - UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) + UpdatePetExecute(r ApiUpdatePetRequest) (*http.Response, error) /* UpdatePetWithForm Updates a pet in the store with form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet that needs to be updated @return ApiUpdatePetWithFormRequest */ - UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest + UpdatePetWithForm(ctx context.Context, petId int64) ApiUpdatePetWithFormRequest // UpdatePetWithFormExecute executes the request - UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) + UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*http.Response, error) /* UploadFile uploads an image - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileRequest */ - UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest + UploadFile(ctx context.Context, petId int64) ApiUploadFileRequest // UploadFileExecute executes the request // @return ApiResponse - UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse, *http.Response, error) /* UploadFileWithRequiredFile uploads an image (required) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileWithRequiredFileRequest */ - UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest + UploadFileWithRequiredFile(ctx context.Context, petId int64) ApiUploadFileWithRequiredFileRequest // UploadFileWithRequiredFileExecute executes the request // @return ApiResponse - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) + UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (*ApiResponse, *http.Response, error) } // PetApiService PetApi service type PetApiService service type ApiAddPetRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi pet *Pet } @@ -161,17 +161,17 @@ func (r ApiAddPetRequest) Pet(pet Pet) ApiAddPetRequest { return r } -func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiAddPetRequest) Execute() (*http.Response, error) { return r.ApiService.AddPetExecute(r) } /* AddPet Add a new pet to the store - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiAddPetRequest */ -func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { +func (a *PetApiService) AddPet(ctx context.Context) ApiAddPetRequest { return ApiAddPetRequest{ ApiService: a, ctx: ctx, @@ -179,23 +179,23 @@ func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { } // Execute executes the request -func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.pet == nil { return nil, reportError("pet is required and must be specified") } @@ -229,15 +229,15 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -248,7 +248,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e } type ApiDeletePetRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 apiKey *string @@ -259,18 +259,18 @@ func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { return r } -func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeletePetRequest) Execute() (*http.Response, error) { return r.ApiService.DeletePetExecute(r) } /* DeletePet Deletes a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId Pet id to delete @return ApiDeletePetRequest */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { +func (a *PetApiService) DeletePet(ctx context.Context, petId int64) ApiDeletePetRequest { return ApiDeletePetRequest{ ApiService: a, ctx: ctx, @@ -279,24 +279,24 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePe } // Execute executes the request -func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -328,15 +328,15 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -347,7 +347,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo } type ApiFindPetsByStatusRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi status *[]string } @@ -359,7 +359,7 @@ func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusR return r } -func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *http.Response, error) { return r.ApiService.FindPetsByStatusExecute(r) } @@ -368,10 +368,10 @@ FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByStatusRequest */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { +func (a *PetApiService) FindPetsByStatus(ctx context.Context) ApiFindPetsByStatusRequest { return ApiFindPetsByStatusRequest{ ApiService: a, ctx: ctx, @@ -380,9 +380,9 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStat // Execute executes the request // @return []Pet -func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue []Pet @@ -390,14 +390,14 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/findByStatus" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.status == nil { return localVarReturnValue, nil, reportError("status is required and must be specified") } @@ -430,15 +430,15 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -447,7 +447,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -458,7 +458,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ } type ApiFindPetsByTagsRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi tags *[]string } @@ -469,7 +469,7 @@ func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { return r } -func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { +func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *http.Response, error) { return r.ApiService.FindPetsByTagsExecute(r) } @@ -478,12 +478,12 @@ FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiFindPetsByTagsRequest Deprecated */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { +func (a *PetApiService) FindPetsByTags(ctx context.Context) ApiFindPetsByTagsRequest { return ApiFindPetsByTagsRequest{ ApiService: a, ctx: ctx, @@ -493,9 +493,9 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRe // Execute executes the request // @return []Pet // Deprecated -func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue []Pet @@ -503,14 +503,14 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/findByTags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.tags == nil { return localVarReturnValue, nil, reportError("tags is required and must be specified") } @@ -543,15 +543,15 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -560,7 +560,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -571,13 +571,13 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet } type ApiGetPetByIdRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 } -func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { +func (r ApiGetPetByIdRequest) Execute() (*Pet, *http.Response, error) { return r.ApiService.GetPetByIdExecute(r) } @@ -586,11 +586,11 @@ GetPetById Find pet by ID Returns a single pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to return @return ApiGetPetByIdRequest */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { +func (a *PetApiService) GetPetById(ctx context.Context, petId int64) ApiGetPetByIdRequest { return ApiGetPetByIdRequest{ ApiService: a, ctx: ctx, @@ -600,25 +600,25 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetB // Execute executes the request // @return Pet -func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { +func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (*Pet, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue Pet + localVarReturnValue *Pet ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -661,15 +661,15 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -678,7 +678,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -689,7 +689,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } type ApiUpdatePetRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi pet *Pet } @@ -700,17 +700,17 @@ func (r ApiUpdatePetRequest) Pet(pet Pet) ApiUpdatePetRequest { return r } -func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetRequest) Execute() (*http.Response, error) { return r.ApiService.UpdatePetExecute(r) } /* UpdatePet Update an existing pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiUpdatePetRequest */ -func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { +func (a *PetApiService) UpdatePet(ctx context.Context) ApiUpdatePetRequest { return ApiUpdatePetRequest{ ApiService: a, ctx: ctx, @@ -718,23 +718,23 @@ func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { } // Execute executes the request -func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.pet == nil { return nil, reportError("pet is required and must be specified") } @@ -768,15 +768,15 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -787,7 +787,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo } type ApiUpdatePetWithFormRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 name *string @@ -805,18 +805,18 @@ func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormR return r } -func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdatePetWithFormRequest) Execute() (*http.Response, error) { return r.ApiService.UpdatePetWithFormExecute(r) } /* UpdatePetWithForm Updates a pet in the store with form data - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet that needs to be updated @return ApiUpdatePetWithFormRequest */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { +func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64) ApiUpdatePetWithFormRequest { return ApiUpdatePetWithFormRequest{ ApiService: a, ctx: ctx, @@ -825,24 +825,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) Api } // Execute executes the request -func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -877,15 +877,15 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -896,7 +896,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) } type ApiUploadFileRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 additionalMetadata *string @@ -914,18 +914,18 @@ func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { return r } -func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileRequest) Execute() (*ApiResponse, *http.Response, error) { return r.ApiService.UploadFileExecute(r) } /* UploadFile uploads an image - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileRequest */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { +func (a *PetApiService) UploadFile(ctx context.Context, petId int64) ApiUploadFileRequest { return ApiUploadFileRequest{ ApiService: a, ctx: ctx, @@ -935,25 +935,25 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadF // Execute executes the request // @return ApiResponse -func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue ApiResponse + localVarReturnValue *ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -986,7 +986,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, fileLocalVarFile = *r.file } if fileLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(fileLocalVarFile) + fbs, _ := ioutil.ReadAll(fileLocalVarFile) fileLocalVarFileBytes = fbs fileLocalVarFileName = fileLocalVarFile.Name() fileLocalVarFile.Close() @@ -1002,15 +1002,15 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1019,7 +1019,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1030,7 +1030,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, } type ApiUploadFileWithRequiredFileRequest struct { - ctx _context.Context + ctx context.Context ApiService PetApi petId int64 requiredFile **os.File @@ -1048,18 +1048,18 @@ func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetad return r } -func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { +func (r ApiUploadFileWithRequiredFileRequest) Execute() (*ApiResponse, *http.Response, error) { return r.ApiService.UploadFileWithRequiredFileExecute(r) } /* UploadFileWithRequiredFile uploads an image (required) - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param petId ID of pet to update @return ApiUploadFileWithRequiredFileRequest */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { +func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { return ApiUploadFileWithRequiredFileRequest{ ApiService: a, ctx: ctx, @@ -1069,25 +1069,25 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i // Execute executes the request // @return ApiResponse -func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (*ApiResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue ApiResponse + localVarReturnValue *ApiResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.requiredFile == nil { return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") } @@ -1120,7 +1120,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq requiredFileLocalVarFile := *r.requiredFile if requiredFileLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(requiredFileLocalVarFile) + fbs, _ := ioutil.ReadAll(requiredFileLocalVarFile) requiredFileLocalVarFileBytes = fbs requiredFileLocalVarFileName = requiredFileLocalVarFile.Name() requiredFileLocalVarFile.Close() @@ -1136,15 +1136,15 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1153,7 +1153,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 41c9e8fda94..3957c73f96a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -12,16 +12,16 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) // Linger please var ( - _ _context.Context + _ context.Context ) type StoreApi interface { @@ -31,68 +31,68 @@ type StoreApi interface { For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of the order that needs to be deleted @return ApiDeleteOrderRequest */ - DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest + DeleteOrder(ctx context.Context, orderId string) ApiDeleteOrderRequest // DeleteOrderExecute executes the request - DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) + DeleteOrderExecute(r ApiDeleteOrderRequest) (*http.Response, error) /* GetInventory Returns pet inventories by status Returns a map of status codes to quantities - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetInventoryRequest */ - GetInventory(ctx _context.Context) ApiGetInventoryRequest + GetInventory(ctx context.Context) ApiGetInventoryRequest // GetInventoryExecute executes the request // @return map[string]int32 - GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) + GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *http.Response, error) /* GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of pet that needs to be fetched @return ApiGetOrderByIdRequest */ - GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest + GetOrderById(ctx context.Context, orderId int64) ApiGetOrderByIdRequest // GetOrderByIdExecute executes the request // @return Order - GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) + GetOrderByIdExecute(r ApiGetOrderByIdRequest) (*Order, *http.Response, error) /* PlaceOrder Place an order for a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPlaceOrderRequest */ - PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest + PlaceOrder(ctx context.Context) ApiPlaceOrderRequest // PlaceOrderExecute executes the request // @return Order - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) + PlaceOrderExecute(r ApiPlaceOrderRequest) (*Order, *http.Response, error) } // StoreApiService StoreApi service type StoreApiService service type ApiDeleteOrderRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi orderId string } -func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteOrderRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteOrderExecute(r) } @@ -101,11 +101,11 @@ DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of the order that needs to be deleted @return ApiDeleteOrderRequest */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { +func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) ApiDeleteOrderRequest { return ApiDeleteOrderRequest{ ApiService: a, ctx: ctx, @@ -114,24 +114,24 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiD } // Execute executes the request -func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { +func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -160,15 +160,15 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -179,12 +179,12 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp } type ApiGetInventoryRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi } -func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { +func (r ApiGetInventoryRequest) Execute() (map[string]int32, *http.Response, error) { return r.ApiService.GetInventoryExecute(r) } @@ -193,10 +193,10 @@ GetInventory Returns pet inventories by status Returns a map of status codes to quantities - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiGetInventoryRequest */ -func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { +func (a *StoreApiService) GetInventory(ctx context.Context) ApiGetInventoryRequest { return ApiGetInventoryRequest{ ApiService: a, ctx: ctx, @@ -205,9 +205,9 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequ // Execute executes the request // @return map[string]int32 -func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { +func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue map[string]int32 @@ -215,14 +215,14 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/inventory" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -265,15 +265,15 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -282,7 +282,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -293,13 +293,13 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } type ApiGetOrderByIdRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi orderId int64 } -func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiGetOrderByIdRequest) Execute() (*Order, *http.Response, error) { return r.ApiService.GetOrderByIdExecute(r) } @@ -308,11 +308,11 @@ GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param orderId ID of pet that needs to be fetched @return ApiGetOrderByIdRequest */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { +func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) ApiGetOrderByIdRequest { return ApiGetOrderByIdRequest{ ApiService: a, ctx: ctx, @@ -322,25 +322,25 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiG // Execute executes the request // @return Order -func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (*Order, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue Order + localVarReturnValue *Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -375,15 +375,15 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -392,7 +392,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -403,7 +403,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, } type ApiPlaceOrderRequest struct { - ctx _context.Context + ctx context.Context ApiService StoreApi order *Order } @@ -414,17 +414,17 @@ func (r ApiPlaceOrderRequest) Order(order Order) ApiPlaceOrderRequest { return r } -func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { +func (r ApiPlaceOrderRequest) Execute() (*Order, *http.Response, error) { return r.ApiService.PlaceOrderExecute(r) } /* PlaceOrder Place an order for a pet - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiPlaceOrderRequest */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { +func (a *StoreApiService) PlaceOrder(ctx context.Context) ApiPlaceOrderRequest { return ApiPlaceOrderRequest{ ApiService: a, ctx: ctx, @@ -433,24 +433,24 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest // Execute executes the request // @return Order -func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (*Order, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue Order + localVarReturnValue *Order ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/store/order" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.order == nil { return localVarReturnValue, nil, reportError("order is required and must be specified") } @@ -484,15 +484,15 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -501,7 +501,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index d67bb32a7e0..b044e87a435 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -12,16 +12,16 @@ package petstore import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io/ioutil" + "net/http" + "net/url" "strings" ) // Linger please var ( - _ _context.Context + _ context.Context ) type UserApi interface { @@ -31,106 +31,106 @@ type UserApi interface { This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUserRequest */ - CreateUser(ctx _context.Context) ApiCreateUserRequest + CreateUser(ctx context.Context) ApiCreateUserRequest // CreateUserExecute executes the request - CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) + CreateUserExecute(r ApiCreateUserRequest) (*http.Response, error) /* CreateUsersWithArrayInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithArrayInputRequest */ - CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest + CreateUsersWithArrayInput(ctx context.Context) ApiCreateUsersWithArrayInputRequest // CreateUsersWithArrayInputExecute executes the request - CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) + CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*http.Response, error) /* CreateUsersWithListInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithListInputRequest */ - CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest + CreateUsersWithListInput(ctx context.Context) ApiCreateUsersWithListInputRequest // CreateUsersWithListInputExecute executes the request - CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) + CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*http.Response, error) /* DeleteUser Delete user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be deleted @return ApiDeleteUserRequest */ - DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest // DeleteUserExecute executes the request - DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) + DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) /* GetUserByName Get user by user name - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be fetched. Use user1 for testing. @return ApiGetUserByNameRequest */ - GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest + GetUserByName(ctx context.Context, username string) ApiGetUserByNameRequest // GetUserByNameExecute executes the request // @return User - GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) + GetUserByNameExecute(r ApiGetUserByNameRequest) (*User, *http.Response, error) /* LoginUser Logs user into the system - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLoginUserRequest */ - LoginUser(ctx _context.Context) ApiLoginUserRequest + LoginUser(ctx context.Context) ApiLoginUserRequest // LoginUserExecute executes the request // @return string - LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) + LoginUserExecute(r ApiLoginUserRequest) (string, *http.Response, error) /* LogoutUser Logs out current logged in user session - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLogoutUserRequest */ - LogoutUser(ctx _context.Context) ApiLogoutUserRequest + LogoutUser(ctx context.Context) ApiLogoutUserRequest // LogoutUserExecute executes the request - LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) + LogoutUserExecute(r ApiLogoutUserRequest) (*http.Response, error) /* UpdateUser Updated user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username name that need to be deleted @return ApiUpdateUserRequest */ - UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest + UpdateUser(ctx context.Context, username string) ApiUpdateUserRequest // UpdateUserExecute executes the request - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) + UpdateUserExecute(r ApiUpdateUserRequest) (*http.Response, error) } // UserApiService UserApi service type UserApiService service type ApiCreateUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi user *User } @@ -141,7 +141,7 @@ func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest { return r } -func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUserRequest) Execute() (*http.Response, error) { return r.ApiService.CreateUserExecute(r) } @@ -150,10 +150,10 @@ CreateUser Create user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUserRequest */ -func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { +func (a *UserApiService) CreateUser(ctx context.Context) ApiCreateUserRequest { return ApiCreateUserRequest{ ApiService: a, ctx: ctx, @@ -161,23 +161,23 @@ func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { } // Execute executes the request -func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -211,15 +211,15 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -230,7 +230,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re } type ApiCreateUsersWithArrayInputRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi user *[]User } @@ -241,17 +241,17 @@ func (r ApiCreateUsersWithArrayInputRequest) User(user []User) ApiCreateUsersWit return r } -func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithArrayInputRequest) Execute() (*http.Response, error) { return r.ApiService.CreateUsersWithArrayInputExecute(r) } /* CreateUsersWithArrayInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithArrayInputRequest */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { +func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context) ApiCreateUsersWithArrayInputRequest { return ApiCreateUsersWithArrayInputRequest{ ApiService: a, ctx: ctx, @@ -259,23 +259,23 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCrea } // Execute executes the request -func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/createWithArray" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -309,15 +309,15 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -328,7 +328,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr } type ApiCreateUsersWithListInputRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi user *[]User } @@ -339,17 +339,17 @@ func (r ApiCreateUsersWithListInputRequest) User(user []User) ApiCreateUsersWith return r } -func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { +func (r ApiCreateUsersWithListInputRequest) Execute() (*http.Response, error) { return r.ApiService.CreateUsersWithListInputExecute(r) } /* CreateUsersWithListInput Creates list of users with given input array - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateUsersWithListInputRequest */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { +func (a *UserApiService) CreateUsersWithListInput(ctx context.Context) ApiCreateUsersWithListInputRequest { return ApiCreateUsersWithListInputRequest{ ApiService: a, ctx: ctx, @@ -357,23 +357,23 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreat } // Execute executes the request -func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/createWithList" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -407,15 +407,15 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -426,13 +426,13 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis } type ApiDeleteUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username string } -func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteUserExecute(r) } @@ -441,11 +441,11 @@ DeleteUser Delete user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be deleted @return ApiDeleteUserRequest */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { +func (a *UserApiService) DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest { return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, @@ -454,24 +454,24 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDe } // Execute executes the request -func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -500,15 +500,15 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -519,24 +519,24 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re } type ApiGetUserByNameRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username string } -func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { +func (r ApiGetUserByNameRequest) Execute() (*User, *http.Response, error) { return r.ApiService.GetUserByNameExecute(r) } /* GetUserByName Get user by user name - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The name that needs to be fetched. Use user1 for testing. @return ApiGetUserByNameRequest */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { +func (a *UserApiService) GetUserByName(ctx context.Context, username string) ApiGetUserByNameRequest { return ApiGetUserByNameRequest{ ApiService: a, ctx: ctx, @@ -546,25 +546,25 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) Ap // Execute executes the request // @return User -func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { +func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue User + localVarReturnValue *User ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -593,15 +593,15 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -610,7 +610,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -621,7 +621,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, } type ApiLoginUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username *string password *string @@ -638,17 +638,17 @@ func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { return r } -func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { +func (r ApiLoginUserRequest) Execute() (string, *http.Response, error) { return r.ApiService.LoginUserExecute(r) } /* LoginUser Logs user into the system - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLoginUserRequest */ -func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { +func (a *UserApiService) LoginUser(ctx context.Context) ApiLoginUserRequest { return ApiLoginUserRequest{ ApiService: a, ctx: ctx, @@ -657,9 +657,9 @@ func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { // Execute executes the request // @return string -func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { +func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile localVarReturnValue string @@ -667,14 +667,14 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/login" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.username == nil { return localVarReturnValue, nil, reportError("username is required and must be specified") } @@ -711,15 +711,15 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -728,7 +728,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -739,22 +739,22 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth } type ApiLogoutUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi } -func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiLogoutUserRequest) Execute() (*http.Response, error) { return r.ApiService.LogoutUserExecute(r) } /* LogoutUser Logs out current logged in user session - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiLogoutUserRequest */ -func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { +func (a *UserApiService) LogoutUser(ctx context.Context) ApiLogoutUserRequest { return ApiLogoutUserRequest{ ApiService: a, ctx: ctx, @@ -762,23 +762,23 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { } // Execute executes the request -func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/logout" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -807,15 +807,15 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -826,7 +826,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re } type ApiUpdateUserRequest struct { - ctx _context.Context + ctx context.Context ApiService UserApi username string user *User @@ -838,7 +838,7 @@ func (r ApiUpdateUserRequest) User(user User) ApiUpdateUserRequest { return r } -func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiUpdateUserRequest) Execute() (*http.Response, error) { return r.ApiService.UpdateUserExecute(r) } @@ -847,11 +847,11 @@ UpdateUser Updated user This can only be done by the logged in user. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username name that need to be deleted @return ApiUpdateUserRequest */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { +func (a *UserApiService) UpdateUser(ctx context.Context, username string) ApiUpdateUserRequest { return ApiUpdateUserRequest{ ApiService: a, ctx: ctx, @@ -860,24 +860,24 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUp } // Execute executes the request -func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { +func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -911,15 +911,15 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 99eed71f66f..f0cb8337545 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -450,6 +450,13 @@ func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index cd383de7c66..5ebd96a4159 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -32,8 +32,8 @@ func main() { client := *openapiclient.NewClient() // Client | client model configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background()).Client(client).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AnotherFakeApi.Call123TestSpecialTags(context.Background()).Client(client).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md index 90eb907168d..62cef88c3f6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md @@ -29,8 +29,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DefaultApi.FooGet(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.FooGet(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FooGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md index 13dba6a766a..13ee6ee52ef 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -43,8 +43,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeHealthGet(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeHealthGet(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeHealthGet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -105,8 +105,8 @@ func main() { body := true // bool | Input boolean as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -171,8 +171,8 @@ func main() { outerComposite := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -237,8 +237,8 @@ func main() { body := float32(8.14) // float32 | Input number as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -303,8 +303,8 @@ func main() { body := "body_example" // string | Input string as post body (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background()).Body(body).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.FakeOuterStringSerialize(context.Background()).Body(body).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -369,8 +369,8 @@ func main() { fileSchemaTestClass := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -432,8 +432,8 @@ func main() { user := *openapiclient.NewUser() // User | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -497,8 +497,8 @@ func main() { client := *openapiclient.NewClient() // Client | client model configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestClientModel(context.Background()).Client(client).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestClientModel(context.Background()).Client(client).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -577,8 +577,8 @@ func main() { callback := "callback_example" // string | None (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -661,8 +661,8 @@ func main() { enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -737,8 +737,8 @@ func main() { int64Group := int64(789) // int64 | Integer in group parameters (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -804,8 +804,8 @@ func main() { requestBody := map[string]string{"key": "Inner_example"} // map[string]string | request body configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -867,8 +867,8 @@ func main() { param2 := "param2_example" // string | field2 configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -936,8 +936,8 @@ func main() { context := []string{"Inner_example"} // []string | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1005,8 +1005,8 @@ func main() { headerUnique := []string{"Inner_example"} // []string | configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestUniqueItemsHeaderAndQueryParameterCollectionFormat(context.Background()).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeApi.TestUniqueItemsHeaderAndQueryParameterCollectionFormat(context.Background()).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestUniqueItemsHeaderAndQueryParameterCollectionFormat``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md index 27a260ff813..688b50aa273 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -32,8 +32,8 @@ func main() { client := *openapiclient.NewClient() // Client | client model configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background()).Client(client).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeClassnameTags123Api.TestClassname(context.Background()).Client(client).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md index c99794e706d..c0522b43c9a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md @@ -38,8 +38,8 @@ func main() { pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.AddPet(context.Background()).Pet(pet).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.AddPet(context.Background()).Pet(pet).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -101,8 +101,8 @@ func main() { apiKey := "apiKey_example" // string | (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -170,8 +170,8 @@ func main() { status := []string{"Status_example"} // []string | Status values that need to be considered for filter configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background()).Status(status).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.FindPetsByStatus(context.Background()).Status(status).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -236,8 +236,8 @@ func main() { tags := []string{"Inner_example"} // []string | Tags to filter by configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByTags(context.Background()).Tags(tags).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.FindPetsByTags(context.Background()).Tags(tags).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -302,8 +302,8 @@ func main() { petId := int64(789) // int64 | ID of pet to return configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.GetPetById(context.Background(), petId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -370,8 +370,8 @@ func main() { pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePet(context.Background()).Pet(pet).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UpdatePet(context.Background()).Pet(pet).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -434,8 +434,8 @@ func main() { status := "status_example" // string | Updated status of the pet (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -504,8 +504,8 @@ func main() { file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -576,8 +576,8 @@ func main() { additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetApi.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md index 067ea382576..70c0692ef11 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md @@ -35,8 +35,8 @@ func main() { orderId := "orderId_example" // string | ID of the order that needs to be deleted configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.DeleteOrder(context.Background(), orderId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -102,8 +102,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetInventory(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.GetInventory(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -164,8 +164,8 @@ func main() { orderId := int64(789) // int64 | ID of pet that needs to be fetched configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.GetOrderById(context.Background(), orderId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -232,8 +232,8 @@ func main() { order := *openapiclient.NewOrder() // Order | order placed for purchasing the pet configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.PlaceOrder(context.Background()).Order(order).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreApi.PlaceOrder(context.Background()).Order(order).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md index dbbbe3fa792..3176eadbd76 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md @@ -39,8 +39,8 @@ func main() { user := *openapiclient.NewUser() // User | Created user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUser(context.Background()).User(user).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.CreateUser(context.Background()).User(user).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -101,8 +101,8 @@ func main() { user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background()).User(user).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.CreateUsersWithArrayInput(context.Background()).User(user).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -163,8 +163,8 @@ func main() { user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background()).User(user).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.CreateUsersWithListInput(context.Background()).User(user).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -227,8 +227,8 @@ func main() { username := "username_example" // string | The name that needs to be deleted configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.DeleteUser(context.Background(), username).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -293,8 +293,8 @@ func main() { username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.GetUserByName(context.Background(), username).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -362,8 +362,8 @@ func main() { password := "password_example" // string | The password for login in clear text configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LoginUser(context.Background()).Username(username).Password(password).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.LoginUser(context.Background()).Username(username).Password(password).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -426,8 +426,8 @@ import ( func main() { configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LogoutUser(context.Background()).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.LogoutUser(context.Background()).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -487,8 +487,8 @@ func main() { user := *openapiclient.NewUser() // User | Updated user object configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username).User(user).Execute() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserApi.UpdateUser(context.Background(), username).User(user).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) diff --git a/samples/openapi3/client/petstore/go/go-petstore/go.mod b/samples/openapi3/client/petstore/go/go-petstore/go.mod index 0f43de9ebb2..ead32606c72 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/go.mod +++ b/samples/openapi3/client/petstore/go/go-petstore/go.mod @@ -3,5 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.13 require ( - golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index f4f77661d45..56dcc6c3c94 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -16,7 +16,7 @@ import ( // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` + ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,12 +45,12 @@ func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { var ret [][]float32 return ret } - return *o.ArrayArrayNumber + return o.ArrayArrayNumber } // GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool) { +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool) { if o == nil || o.ArrayArrayNumber == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { // SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { - o.ArrayArrayNumber = &v + o.ArrayArrayNumber = v } func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go index 3f099edff2a..36e967f70a6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -16,7 +16,7 @@ import ( // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { - ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` + ArrayNumber []float32 `json:"ArrayNumber,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,12 +45,12 @@ func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { var ret []float32 return ret } - return *o.ArrayNumber + return o.ArrayNumber } // GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool) { +func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool) { if o == nil || o.ArrayNumber == nil { return nil, false } @@ -68,7 +68,7 @@ func (o *ArrayOfNumberOnly) HasArrayNumber() bool { // SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { - o.ArrayNumber = &v + o.ArrayNumber = v } func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go index 82ab2eaaf84..aa07cef3a3c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go @@ -16,9 +16,9 @@ import ( // ArrayTest struct for ArrayTest type ArrayTest struct { - ArrayOfString *[]string `json:"array_of_string,omitempty"` - ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` - ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + ArrayOfString []string `json:"array_of_string,omitempty"` + ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` + ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,12 +47,12 @@ func (o *ArrayTest) GetArrayOfString() []string { var ret []string return ret } - return *o.ArrayOfString + return o.ArrayOfString } // GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool) { +func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool) { if o == nil || o.ArrayOfString == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *ArrayTest) HasArrayOfString() bool { // SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. func (o *ArrayTest) SetArrayOfString(v []string) { - o.ArrayOfString = &v + o.ArrayOfString = v } // GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. @@ -79,12 +79,12 @@ func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { var ret [][]int64 return ret } - return *o.ArrayArrayOfInteger + return o.ArrayArrayOfInteger } // GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool) { +func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool) { if o == nil || o.ArrayArrayOfInteger == nil { return nil, false } @@ -102,7 +102,7 @@ func (o *ArrayTest) HasArrayArrayOfInteger() bool { // SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { - o.ArrayArrayOfInteger = &v + o.ArrayArrayOfInteger = v } // GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. @@ -111,12 +111,12 @@ func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { var ret [][]ReadOnlyFirst return ret } - return *o.ArrayArrayOfModel + return o.ArrayArrayOfModel } // GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool) { +func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool) { if o == nil || o.ArrayArrayOfModel == nil { return nil, false } @@ -134,7 +134,7 @@ func (o *ArrayTest) HasArrayArrayOfModel() bool { // SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { - o.ArrayArrayOfModel = &v + o.ArrayArrayOfModel = v } func (o ArrayTest) MarshalJSON() ([]byte, error) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go index b602cc1122f..9ed5be80d6c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go @@ -17,7 +17,7 @@ import ( // EnumArrays struct for EnumArrays type EnumArrays struct { JustSymbol *string `json:"just_symbol,omitempty"` - ArrayEnum *[]string `json:"array_enum,omitempty"` + ArrayEnum []string `json:"array_enum,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,12 +78,12 @@ func (o *EnumArrays) GetArrayEnum() []string { var ret []string return ret } - return *o.ArrayEnum + return o.ArrayEnum } // GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool) { +func (o *EnumArrays) GetArrayEnumOk() ([]string, bool) { if o == nil || o.ArrayEnum == nil { return nil, false } @@ -101,7 +101,7 @@ func (o *EnumArrays) HasArrayEnum() bool { // SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. func (o *EnumArrays) SetArrayEnum(v []string) { - o.ArrayEnum = &v + o.ArrayEnum = v } func (o EnumArrays) MarshalJSON() ([]byte, error) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go index 49c463209df..a61e7d43a7b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -17,7 +17,7 @@ import ( // FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { File *File `json:"file,omitempty"` - Files *[]File `json:"files,omitempty"` + Files []File `json:"files,omitempty"` AdditionalProperties map[string]interface{} } @@ -78,12 +78,12 @@ func (o *FileSchemaTestClass) GetFiles() []File { var ret []File return ret } - return *o.Files + return o.Files } // GetFilesOk returns a tuple with the Files field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool) { +func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool) { if o == nil || o.Files == nil { return nil, false } @@ -101,7 +101,7 @@ func (o *FileSchemaTestClass) HasFiles() bool { // SetFiles gets a reference to the given []File and assigns it to the Files field. func (o *FileSchemaTestClass) SetFiles(v []File) { - o.Files = &v + o.Files = v } func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go index 555b8ab7484..74b0aa52b3c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go @@ -23,12 +23,16 @@ type Fruit struct { // AppleAsFruit is a convenience function that returns Apple wrapped in Fruit func AppleAsFruit(v *Apple) Fruit { - return Fruit{ Apple: v} + return Fruit{ + Apple: v, + } } // BananaAsFruit is a convenience function that returns Banana wrapped in Fruit func BananaAsFruit(v *Banana) Fruit { - return Fruit{ Banana: v} + return Fruit{ + Banana: v, + } } @@ -37,7 +41,7 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { var err error match := 0 // try to unmarshal data into Apple - err = json.Unmarshal(data, &dst.Apple) + err = newStrictDecoder(data).Decode(&dst.Apple) if err == nil { jsonApple, _ := json.Marshal(dst.Apple) if string(jsonApple) == "{}" { // empty struct @@ -50,7 +54,7 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { } // try to unmarshal data into Banana - err = json.Unmarshal(data, &dst.Banana) + err = newStrictDecoder(data).Decode(&dst.Banana) if err == nil { jsonBanana, _ := json.Marshal(dst.Banana) if string(jsonBanana) == "{}" { // empty struct @@ -90,6 +94,9 @@ func (src Fruit) MarshalJSON() ([]byte, error) { // Get the actual instance func (obj *Fruit) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } if obj.Apple != nil { return obj.Apple } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go index c3d6ea1cea6..82ff8714324 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go @@ -23,12 +23,16 @@ type FruitReq struct { // AppleReqAsFruitReq is a convenience function that returns AppleReq wrapped in FruitReq func AppleReqAsFruitReq(v *AppleReq) FruitReq { - return FruitReq{ AppleReq: v} + return FruitReq{ + AppleReq: v, + } } // BananaReqAsFruitReq is a convenience function that returns BananaReq wrapped in FruitReq func BananaReqAsFruitReq(v *BananaReq) FruitReq { - return FruitReq{ BananaReq: v} + return FruitReq{ + BananaReq: v, + } } @@ -37,7 +41,7 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { var err error match := 0 // try to unmarshal data into AppleReq - err = json.Unmarshal(data, &dst.AppleReq) + err = newStrictDecoder(data).Decode(&dst.AppleReq) if err == nil { jsonAppleReq, _ := json.Marshal(dst.AppleReq) if string(jsonAppleReq) == "{}" { // empty struct @@ -50,7 +54,7 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { } // try to unmarshal data into BananaReq - err = json.Unmarshal(data, &dst.BananaReq) + err = newStrictDecoder(data).Decode(&dst.BananaReq) if err == nil { jsonBananaReq, _ := json.Marshal(dst.BananaReq) if string(jsonBananaReq) == "{}" { // empty struct @@ -90,6 +94,9 @@ func (src FruitReq) MarshalJSON() ([]byte, error) { // Get the actual instance func (obj *FruitReq) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } if obj.AppleReq != nil { return obj.AppleReq } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go index 6922f820e8a..9b407ec0186 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go @@ -19,7 +19,7 @@ type InlineObject struct { // Updated name of the pet Name *string `json:"name,omitempty"` // Updated status of the pet - Status *string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` AdditionalProperties map[string]interface{} } @@ -175,5 +175,3 @@ func (v *NullableInlineObject) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go index 877677710ec..ee4202e1e66 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go @@ -20,7 +20,7 @@ type InlineObject1 struct { // Additional data to pass to server AdditionalMetadata *string `json:"additionalMetadata,omitempty"` // file to upload - File **os.File `json:"file,omitempty"` + File **os.File `json:"file,omitempty"` AdditionalProperties map[string]interface{} } @@ -176,5 +176,3 @@ func (v *NullableInlineObject1) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go index 8b9d4b66db3..889cced58b5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go @@ -19,7 +19,7 @@ type InlineObject2 struct { // Form parameter enum test (string array) EnumFormStringArray *[]string `json:"enum_form_string_array,omitempty"` // Form parameter enum test (string) - EnumFormString *string `json:"enum_form_string,omitempty"` + EnumFormString *string `json:"enum_form_string,omitempty"` AdditionalProperties map[string]interface{} } @@ -179,5 +179,3 @@ func (v *NullableInlineObject2) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go index 4c31bcd015d..e85cadf01cd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go @@ -45,7 +45,7 @@ type InlineObject3 struct { // None Password *string `json:"password,omitempty"` // None - Callback *string `json:"callback,omitempty"` + Callback *string `json:"callback,omitempty"` AdditionalProperties map[string]interface{} } @@ -55,7 +55,7 @@ type _InlineObject3 InlineObject3 // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInlineObject3(number float32, double float64, patternWithoutDelimiter string, byte_ string, ) *InlineObject3 { +func NewInlineObject3(number float32, double float64, patternWithoutDelimiter string, byte_ string) *InlineObject3 { this := InlineObject3{} this.Number = number this.Double = double @@ -170,7 +170,7 @@ func (o *InlineObject3) SetInt64(v int64) { // GetNumber returns the Number field value func (o *InlineObject3) GetNumber() float32 { - if o == nil { + if o == nil { var ret float32 return ret } @@ -181,7 +181,7 @@ func (o *InlineObject3) GetNumber() float32 { // GetNumberOk returns a tuple with the Number field value // and a boolean to check if the value has been set. func (o *InlineObject3) GetNumberOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Number, true @@ -226,7 +226,7 @@ func (o *InlineObject3) SetFloat(v float32) { // GetDouble returns the Double field value func (o *InlineObject3) GetDouble() float64 { - if o == nil { + if o == nil { var ret float64 return ret } @@ -237,7 +237,7 @@ func (o *InlineObject3) GetDouble() float64 { // GetDoubleOk returns a tuple with the Double field value // and a boolean to check if the value has been set. func (o *InlineObject3) GetDoubleOk() (*float64, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Double, true @@ -282,7 +282,7 @@ func (o *InlineObject3) SetString(v string) { // GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field value func (o *InlineObject3) GetPatternWithoutDelimiter() string { - if o == nil { + if o == nil { var ret string return ret } @@ -293,7 +293,7 @@ func (o *InlineObject3) GetPatternWithoutDelimiter() string { // GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field value // and a boolean to check if the value has been set. func (o *InlineObject3) GetPatternWithoutDelimiterOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.PatternWithoutDelimiter, true @@ -306,7 +306,7 @@ func (o *InlineObject3) SetPatternWithoutDelimiter(v string) { // GetByte returns the Byte field value func (o *InlineObject3) GetByte() string { - if o == nil { + if o == nil { var ret string return ret } @@ -317,7 +317,7 @@ func (o *InlineObject3) GetByte() string { // GetByteOk returns a tuple with the Byte field value // and a boolean to check if the value has been set. func (o *InlineObject3) GetByteOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Byte, true @@ -605,5 +605,3 @@ func (v *NullableInlineObject3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go index 11ae1c06c47..bf0e5771b2a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go @@ -19,7 +19,7 @@ type InlineObject4 struct { // field1 Param string `json:"param"` // field2 - Param2 string `json:"param2"` + Param2 string `json:"param2"` AdditionalProperties map[string]interface{} } @@ -29,7 +29,7 @@ type _InlineObject4 InlineObject4 // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInlineObject4(param string, param2 string, ) *InlineObject4 { +func NewInlineObject4(param string, param2 string) *InlineObject4 { this := InlineObject4{} this.Param = param this.Param2 = param2 @@ -46,7 +46,7 @@ func NewInlineObject4WithDefaults() *InlineObject4 { // GetParam returns the Param field value func (o *InlineObject4) GetParam() string { - if o == nil { + if o == nil { var ret string return ret } @@ -57,7 +57,7 @@ func (o *InlineObject4) GetParam() string { // GetParamOk returns a tuple with the Param field value // and a boolean to check if the value has been set. func (o *InlineObject4) GetParamOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Param, true @@ -70,7 +70,7 @@ func (o *InlineObject4) SetParam(v string) { // GetParam2 returns the Param2 field value func (o *InlineObject4) GetParam2() string { - if o == nil { + if o == nil { var ret string return ret } @@ -81,7 +81,7 @@ func (o *InlineObject4) GetParam2() string { // GetParam2Ok returns a tuple with the Param2 field value // and a boolean to check if the value has been set. func (o *InlineObject4) GetParam2Ok() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Param2, true @@ -161,5 +161,3 @@ func (v *NullableInlineObject4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go index b60d46fc04d..aacdd7db6e9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go @@ -20,7 +20,7 @@ type InlineObject5 struct { // Additional data to pass to server AdditionalMetadata *string `json:"additionalMetadata,omitempty"` // file to upload - RequiredFile *os.File `json:"requiredFile"` + RequiredFile *os.File `json:"requiredFile"` AdditionalProperties map[string]interface{} } @@ -30,7 +30,7 @@ type _InlineObject5 InlineObject5 // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInlineObject5(requiredFile *os.File, ) *InlineObject5 { +func NewInlineObject5(requiredFile *os.File) *InlineObject5 { this := InlineObject5{} this.RequiredFile = requiredFile return &this @@ -78,7 +78,7 @@ func (o *InlineObject5) SetAdditionalMetadata(v string) { // GetRequiredFile returns the RequiredFile field value func (o *InlineObject5) GetRequiredFile() *os.File { - if o == nil { + if o == nil { var ret *os.File return ret } @@ -89,7 +89,7 @@ func (o *InlineObject5) GetRequiredFile() *os.File { // GetRequiredFileOk returns a tuple with the RequiredFile field value // and a boolean to check if the value has been set. func (o *InlineObject5) GetRequiredFileOk() (**os.File, bool) { - if o == nil { + if o == nil { return nil, false } return &o.RequiredFile, true @@ -169,5 +169,3 @@ func (v *NullableInlineObject5) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go index a67af74d582..7f899aa6db7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go @@ -23,12 +23,16 @@ type Mammal struct { // WhaleAsMammal is a convenience function that returns Whale wrapped in Mammal func WhaleAsMammal(v *Whale) Mammal { - return Mammal{ Whale: v} + return Mammal{ + Whale: v, + } } // ZebraAsMammal is a convenience function that returns Zebra wrapped in Mammal func ZebraAsMammal(v *Zebra) Mammal { - return Mammal{ Zebra: v} + return Mammal{ + Zebra: v, + } } @@ -37,7 +41,7 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { var err error match := 0 // try to unmarshal data into Whale - err = json.Unmarshal(data, &dst.Whale) + err = newStrictDecoder(data).Decode(&dst.Whale) if err == nil { jsonWhale, _ := json.Marshal(dst.Whale) if string(jsonWhale) == "{}" { // empty struct @@ -50,7 +54,7 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { } // try to unmarshal data into Zebra - err = json.Unmarshal(data, &dst.Zebra) + err = newStrictDecoder(data).Decode(&dst.Zebra) if err == nil { jsonZebra, _ := json.Marshal(dst.Zebra) if string(jsonZebra) == "{}" { // empty struct @@ -90,6 +94,9 @@ func (src Mammal) MarshalJSON() ([]byte, error) { // Get the actual instance func (obj *Mammal) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } if obj.Whale != nil { return obj.Whale } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go index b46f891329e..dbf4bfdbb89 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go @@ -25,10 +25,10 @@ type NullableClass struct { DatetimeProp NullableTime `json:"datetime_prop,omitempty"` ArrayNullableProp []map[string]interface{} `json:"array_nullable_prop,omitempty"` ArrayAndItemsNullableProp []*map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` - ArrayItemsNullable *[]*map[string]interface{} `json:"array_items_nullable,omitempty"` + ArrayItemsNullable []*map[string]interface{} `json:"array_items_nullable,omitempty"` ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` - ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` + ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` } // NewNullableClass instantiates a new NullableClass object @@ -316,11 +316,11 @@ func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { // GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetArrayNullablePropOk() (*[]map[string]interface{}, bool) { +func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool) { if o == nil || o.ArrayNullableProp == nil { return nil, false } - return &o.ArrayNullableProp, true + return o.ArrayNullableProp, true } // HasArrayNullableProp returns a boolean if a field has been set. @@ -349,11 +349,11 @@ func (o *NullableClass) GetArrayAndItemsNullableProp() []*map[string]interface{} // GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]*map[string]interface{}, bool) { +func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]*map[string]interface{}, bool) { if o == nil || o.ArrayAndItemsNullableProp == nil { return nil, false } - return &o.ArrayAndItemsNullableProp, true + return o.ArrayAndItemsNullableProp, true } // HasArrayAndItemsNullableProp returns a boolean if a field has been set. @@ -376,12 +376,12 @@ func (o *NullableClass) GetArrayItemsNullable() []*map[string]interface{} { var ret []*map[string]interface{} return ret } - return *o.ArrayItemsNullable + return o.ArrayItemsNullable } // GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetArrayItemsNullableOk() (*[]*map[string]interface{}, bool) { +func (o *NullableClass) GetArrayItemsNullableOk() ([]*map[string]interface{}, bool) { if o == nil || o.ArrayItemsNullable == nil { return nil, false } @@ -399,7 +399,7 @@ func (o *NullableClass) HasArrayItemsNullable() bool { // SetArrayItemsNullable gets a reference to the given []*map[string]interface{} and assigns it to the ArrayItemsNullable field. func (o *NullableClass) SetArrayItemsNullable(v []*map[string]interface{}) { - o.ArrayItemsNullable = &v + o.ArrayItemsNullable = v } // GetObjectNullableProp returns the ObjectNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). @@ -414,11 +414,11 @@ func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{ // GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetObjectNullablePropOk() (*map[string]map[string]interface{}, bool) { +func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool) { if o == nil || o.ObjectNullableProp == nil { return nil, false } - return &o.ObjectNullableProp, true + return o.ObjectNullableProp, true } // HasObjectNullableProp returns a boolean if a field has been set. @@ -447,11 +447,11 @@ func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]in // GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetObjectAndItemsNullablePropOk() (*map[string]map[string]interface{}, bool) { +func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool) { if o == nil || o.ObjectAndItemsNullableProp == nil { return nil, false } - return &o.ObjectAndItemsNullableProp, true + return o.ObjectAndItemsNullableProp, true } // HasObjectAndItemsNullableProp returns a boolean if a field has been set. @@ -474,12 +474,12 @@ func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface var ret map[string]map[string]interface{} return ret } - return *o.ObjectItemsNullable + return o.ObjectItemsNullable } // GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetObjectItemsNullableOk() (*map[string]map[string]interface{}, bool) { +func (o *NullableClass) GetObjectItemsNullableOk() (map[string]map[string]interface{}, bool) { if o == nil || o.ObjectItemsNullable == nil { return nil, false } @@ -497,7 +497,7 @@ func (o *NullableClass) HasObjectItemsNullable() bool { // SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{}) { - o.ObjectItemsNullable = &v + o.ObjectItemsNullable = v } func (o NullableClass) MarshalJSON() ([]byte, error) { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_object_with_enum_property.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_object_with_enum_property.go index ed972e498d2..bdde33f4417 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_object_with_enum_property.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_object_with_enum_property.go @@ -50,7 +50,7 @@ func (o *OuterObjectWithEnumProperty) GetValue() OuterEnumInteger { // GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. func (o *OuterObjectWithEnumProperty) GetValueOk() (*OuterEnumInteger, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Value, true @@ -104,5 +104,3 @@ func (v *NullableOuterObjectWithEnumProperty) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } - - diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go index 6a856bf7689..8dffc304e74 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go @@ -20,7 +20,7 @@ type Pet struct { Category *Category `json:"category,omitempty"` Name string `json:"name"` PhotoUrls []string `json:"photoUrls"` - Tags *[]Tag `json:"tags,omitempty"` + Tags []Tag `json:"tags,omitempty"` // pet status in the store // Deprecated Status *string `json:"status,omitempty"` @@ -148,11 +148,11 @@ func (o *Pet) GetPhotoUrls() []string { // GetPhotoUrlsOk returns a tuple with the PhotoUrls field value // and a boolean to check if the value has been set. -func (o *Pet) GetPhotoUrlsOk() (*[]string, bool) { +func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { if o == nil { return nil, false } - return &o.PhotoUrls, true + return o.PhotoUrls, true } // SetPhotoUrls sets field value @@ -166,12 +166,12 @@ func (o *Pet) GetTags() []Tag { var ret []Tag return ret } - return *o.Tags + return o.Tags } // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Pet) GetTagsOk() (*[]Tag, bool) { +func (o *Pet) GetTagsOk() ([]Tag, bool) { if o == nil || o.Tags == nil { return nil, false } @@ -189,7 +189,7 @@ func (o *Pet) HasTags() bool { // SetTags gets a reference to the given []Tag and assigns it to the Tags field. func (o *Pet) SetTags(v []Tag) { - o.Tags = &v + o.Tags = v } // GetStatus returns the Status field value if set, zero value otherwise. diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_user.go b/samples/openapi3/client/petstore/go/go-petstore/model_user.go index 85271ee249e..a4b6dc232ef 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_user.go @@ -26,7 +26,7 @@ type User struct { // User Status UserStatus *int32 `json:"userStatus,omitempty"` // test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - ArbitraryObject *map[string]interface{} `json:"arbitraryObject,omitempty"` + ArbitraryObject map[string]interface{} `json:"arbitraryObject,omitempty"` // test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. ArbitraryNullableObject map[string]interface{} `json:"arbitraryNullableObject,omitempty"` // test code generation for any type Value can be any type - string, number, boolean, array or object. @@ -317,12 +317,12 @@ func (o *User) GetArbitraryObject() map[string]interface{} { var ret map[string]interface{} return ret } - return *o.ArbitraryObject + return o.ArbitraryObject } // GetArbitraryObjectOk returns a tuple with the ArbitraryObject field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetArbitraryObjectOk() (*map[string]interface{}, bool) { +func (o *User) GetArbitraryObjectOk() (map[string]interface{}, bool) { if o == nil || o.ArbitraryObject == nil { return nil, false } @@ -340,7 +340,7 @@ func (o *User) HasArbitraryObject() bool { // SetArbitraryObject gets a reference to the given map[string]interface{} and assigns it to the ArbitraryObject field. func (o *User) SetArbitraryObject(v map[string]interface{}) { - o.ArbitraryObject = &v + o.ArbitraryObject = v } // GetArbitraryNullableObject returns the ArbitraryNullableObject field value if set, zero value otherwise (both if not set or set to explicit null). @@ -355,11 +355,11 @@ func (o *User) GetArbitraryNullableObject() map[string]interface{} { // GetArbitraryNullableObjectOk returns a tuple with the ArbitraryNullableObject field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetArbitraryNullableObjectOk() (*map[string]interface{}, bool) { +func (o *User) GetArbitraryNullableObjectOk() (map[string]interface{}, bool) { if o == nil || o.ArbitraryNullableObject == nil { return nil, false } - return &o.ArbitraryNullableObject, true + return o.ArbitraryNullableObject, true } // HasArbitraryNullableObject returns a boolean if a field has been set. diff --git a/samples/openapi3/client/petstore/go/go.mod b/samples/openapi3/client/petstore/go/go.mod new file mode 100644 index 00000000000..a35619c519f --- /dev/null +++ b/samples/openapi3/client/petstore/go/go.mod @@ -0,0 +1,11 @@ +module github.com/OpenAPITools/openapi-generator/samples/openapi3/client/petstore/go + +go 1.16 + +replace go-petstore => ./go-petstore + +require ( + github.com/stretchr/testify v1.7.0 + go-petstore v0.0.0-00010101000000-000000000000 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 +) diff --git a/samples/openapi3/client/petstore/go/go.sum b/samples/openapi3/client/petstore/go/go.sum new file mode 100644 index 00000000000..0df1d1a38a0 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go.sum @@ -0,0 +1,371 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 h1:D7nTwh4J0i+5mW4Zjzn5omvlr6YBcWywE6KOcatyNxY= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/samples/openapi3/client/petstore/go/http_signature_test.go b/samples/openapi3/client/petstore/go/http_signature_test.go index 6348599111a..104cd00f03e 100644 --- a/samples/openapi3/client/petstore/go/http_signature_test.go +++ b/samples/openapi3/client/petstore/go/http_signature_test.go @@ -30,7 +30,7 @@ import ( "testing" "time" - sw "./go-petstore" + sw "go-petstore" ) // Test RSA private key as published in Appendix C 'Test Values' of @@ -276,7 +276,7 @@ func executeHttpSignatureAuth(t *testing.T, authConfig *sw.HttpSignatureAuth, ex newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) fmt.Printf("Request with HTTP signature. Scheme: '%s'. Algorithm: '%s'. MaxValidity: %v. Headers: '%v'\n", authConfig.SigningScheme, authConfig.SigningAlgorithm, authConfig.SignatureMaxValidity, authConfig.SignedHeaders) diff --git a/samples/openapi3/client/petstore/go/model_test.go b/samples/openapi3/client/petstore/go/model_test.go index 39e73f00840..0d7035eec85 100644 --- a/samples/openapi3/client/petstore/go/model_test.go +++ b/samples/openapi3/client/petstore/go/model_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" - sw "./go-petstore" "github.com/stretchr/testify/assert" + sw "go-petstore" ) func TestBanana(t *testing.T) { diff --git a/samples/openapi3/client/petstore/go/nullable_marshalling_test.go b/samples/openapi3/client/petstore/go/nullable_marshalling_test.go index 6422846c29e..1ad208b13c9 100644 --- a/samples/openapi3/client/petstore/go/nullable_marshalling_test.go +++ b/samples/openapi3/client/petstore/go/nullable_marshalling_test.go @@ -1,71 +1,71 @@ package main import ( - "encoding/json" - "fmt" - "testing" + "encoding/json" + "fmt" + "testing" - sw "./go-petstore" + sw "go-petstore" ) func TestNullableMarshalling(t *testing.T) { - var fv float32 = 1.1 - nc := sw.NullableClass{ - IntegerProp: *sw.NewNullableInt32(nil), - NumberProp: *sw.NewNullableFloat32(&fv), - // BooleanProp is also nullable, but we leave it unset, so it shouldn't be in the JSON - } - res, err := json.Marshal(nc) - if err != nil { - t.Errorf("Error while marshalling structure with Nullables: %v", err) - } - expected := `{"integer_prop":null,"number_prop":1.1}` - assertStringsEqual(t, expected, string(res)) - // try unmarshalling now - var unc sw.NullableClass - err = json.Unmarshal(res, &unc) - if err != nil { - t.Errorf("Error while unmarshalling structure with Nullables: %v", err) - } - if unc.BooleanProp.IsSet() || unc.BooleanProp.Get() != nil { - t.Errorf("Unmarshalled BooleanProp not empty+unset: %+v", unc.BooleanProp) - } - if !unc.IntegerProp.IsSet() || unc.IntegerProp.Get() != nil { - t.Errorf("Unmarshalled IntegerProp not explicit null: %+v", unc.IntegerProp) - } - if !unc.NumberProp.IsSet() || *unc.NumberProp.Get() != fv { - t.Errorf("Unmarshalled NumberProp not set to value 1.1: %+v", unc.NumberProp) - } + var fv float32 = 1.1 + nc := sw.NullableClass{ + IntegerProp: *sw.NewNullableInt32(nil), + NumberProp: *sw.NewNullableFloat32(&fv), + // BooleanProp is also nullable, but we leave it unset, so it shouldn't be in the JSON + } + res, err := json.Marshal(nc) + if err != nil { + t.Errorf("Error while marshalling structure with Nullables: %v", err) + } + expected := `{"integer_prop":null,"number_prop":1.1}` + assertStringsEqual(t, expected, string(res)) + // try unmarshalling now + var unc sw.NullableClass + err = json.Unmarshal(res, &unc) + if err != nil { + t.Errorf("Error while unmarshalling structure with Nullables: %v", err) + } + if unc.BooleanProp.IsSet() || unc.BooleanProp.Get() != nil { + t.Errorf("Unmarshalled BooleanProp not empty+unset: %+v", unc.BooleanProp) + } + if !unc.IntegerProp.IsSet() || unc.IntegerProp.Get() != nil { + t.Errorf("Unmarshalled IntegerProp not explicit null: %+v", unc.IntegerProp) + } + if !unc.NumberProp.IsSet() || *unc.NumberProp.Get() != fv { + t.Errorf("Unmarshalled NumberProp not set to value 1.1: %+v", unc.NumberProp) + } - // change the values a bit to make sure the Set/Unset methods work correctly - nc.IntegerProp.Unset() - bv := false - nc.BooleanProp.Set(&bv) - res, err = json.Marshal(nc) - if err != nil { - t.Errorf("Error while marshalling structure with Nullables: %v", err) - } - expected = `{"boolean_prop":false,"number_prop":1.1}` - assertStringsEqual(t, expected, string(res)) - // try unmarshalling now - var unc2 sw.NullableClass - err = json.Unmarshal(res, &unc2) - if err != nil { - t.Errorf("Error while unmarshalling structure with Nullables: %v", err) - } - if !unc2.BooleanProp.IsSet() || *unc2.BooleanProp.Get() != false { - t.Errorf("Unmarshalled BooleanProp not empty+unset: %+v", unc2.BooleanProp) - } - if unc2.IntegerProp.IsSet() || unc2.IntegerProp.Get() != nil { - t.Errorf("Unmarshalled IntegerProp not explicit null: %+v", unc2.IntegerProp) - } - if !unc.NumberProp.IsSet() || *unc.NumberProp.Get() != fv { - t.Errorf("Unmarshalled NumberProp not set to value 1.1: %+v", unc.NumberProp) - } + // change the values a bit to make sure the Set/Unset methods work correctly + nc.IntegerProp.Unset() + bv := false + nc.BooleanProp.Set(&bv) + res, err = json.Marshal(nc) + if err != nil { + t.Errorf("Error while marshalling structure with Nullables: %v", err) + } + expected = `{"boolean_prop":false,"number_prop":1.1}` + assertStringsEqual(t, expected, string(res)) + // try unmarshalling now + var unc2 sw.NullableClass + err = json.Unmarshal(res, &unc2) + if err != nil { + t.Errorf("Error while unmarshalling structure with Nullables: %v", err) + } + if !unc2.BooleanProp.IsSet() || *unc2.BooleanProp.Get() != false { + t.Errorf("Unmarshalled BooleanProp not empty+unset: %+v", unc2.BooleanProp) + } + if unc2.IntegerProp.IsSet() || unc2.IntegerProp.Get() != nil { + t.Errorf("Unmarshalled IntegerProp not explicit null: %+v", unc2.IntegerProp) + } + if !unc.NumberProp.IsSet() || *unc.NumberProp.Get() != fv { + t.Errorf("Unmarshalled NumberProp not set to value 1.1: %+v", unc.NumberProp) + } } func assertStringsEqual(t *testing.T, expected, actual string) { - if expected != actual { - t.Errorf(fmt.Sprintf("`%s` (expected) != `%s` (actual)", expected, actual)) - } + if expected != actual { + t.Errorf(fmt.Sprintf("`%s` (expected) != `%s` (actual)", expected, actual)) + } } diff --git a/samples/openapi3/client/petstore/go/pet_api_test.go b/samples/openapi3/client/petstore/go/pet_api_test.go index 9f0a154f96a..f92873d5d12 100644 --- a/samples/openapi3/client/petstore/go/pet_api_test.go +++ b/samples/openapi3/client/petstore/go/pet_api_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" - sw "./go-petstore" + sw "go-petstore" ) var client *sw.APIClient @@ -29,7 +29,7 @@ func TestMain(m *testing.M) { func TestAddPet(t *testing.T) { newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + Tags: []sw.Tag{{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() @@ -59,7 +59,7 @@ func TestGetPetById(t *testing.T) { func TestGetPetByIdWithInvalidID(t *testing.T) { resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() if r != nil && r.StatusCode == 404 { - assertedError, ok := err.(sw.GenericOpenAPIError) + assertedError, ok := err.(*sw.GenericOpenAPIError) a := assert.New(t) a.True(ok) a.Contains(string(assertedError.Body()), "type") diff --git a/samples/openapi3/client/petstore/go/store_api_test.go b/samples/openapi3/client/petstore/go/store_api_test.go index fc0cdec9699..b3e21e86850 100644 --- a/samples/openapi3/client/petstore/go/store_api_test.go +++ b/samples/openapi3/client/petstore/go/store_api_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - sw "./go-petstore" + sw "go-petstore" ) func TestPlaceOrder(t *testing.T) { diff --git a/samples/openapi3/client/petstore/go/user_api_test.go b/samples/openapi3/client/petstore/go/user_api_test.go index ef66e2410c0..757ac0fa972 100644 --- a/samples/openapi3/client/petstore/go/user_api_test.go +++ b/samples/openapi3/client/petstore/go/user_api_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - sw "./go-petstore" + sw "go-petstore" ) func TestCreateUser(t *testing.T) { @@ -33,7 +33,7 @@ func TestCreateUser(t *testing.T) { //adding x to skip the test, currently it is failing func TestCreateUsersWithArrayInput(t *testing.T) { newUsers := []sw.User{ - sw.User{ + { Id: sw.PtrInt64(1001), FirstName: sw.PtrString("gopher1"), LastName: sw.PtrString("lang1"), @@ -43,7 +43,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { Phone: sw.PtrString("5101112222"), UserStatus: sw.PtrInt32(1), }, - sw.User{ + { Id: sw.PtrInt64(1002), FirstName: sw.PtrString("gopher2"), LastName: sw.PtrString("lang2"), @@ -63,7 +63,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Log(apiResponse) } -/* issue deleting users due to issue in the server side (500). commented out below for the time being + /* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() if err1 != nil { @@ -76,7 +76,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Errorf("Error while deleting user") t.Log(err2) } -*/ + */ } func TestGetUserByName(t *testing.T) { From 5e1164c554e4719aca9e04a507894efde8f50034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20C=C3=A1novas?= <52009512+fcanovas1986@users.noreply.github.com> Date: Fri, 21 Jan 2022 10:38:13 +0100 Subject: [PATCH 068/113] fix clone method (#11363) --- .../src/main/resources/Java/RFC3339DateFormat.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache index cacd793e738..46c7bb46dc3 100644 --- a/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache +++ b/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache @@ -39,6 +39,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file From b7c8de94250905c24b4b386a1054a3b5e8bb6537 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 21 Jan 2022 17:45:53 +0800 Subject: [PATCH 069/113] update samples --- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java index e8c4b6e227a..a713954ea4b 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 07d7e782b0d..80397abe968 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 9ed3230bd36..455b7a6101a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java index f7ec336d257..01137208e92 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file 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 index 07d7e782b0d..80397abe968 100644 --- 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 @@ -50,6 +50,6 @@ public class RFC3339DateFormat extends DateFormat { @Override public Object clone() { - return this; + return super.clone(); } } \ No newline at end of file From 20bf0c73f8adf1ddf35df558d1c7f46fafb03446 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 21 Jan 2022 19:00:59 +0800 Subject: [PATCH 070/113] remove duplicated else if condition (#11370) --- .../csharp-netcore/HttpSigningConfiguration.mustache | 9 --------- .../Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 9 --------- .../Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 9 --------- .../Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 9 --------- .../Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 9 --------- .../Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 9 --------- .../Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 9 --------- 7 files changed, 63 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache index f80e584c666..58a961b5da3 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache @@ -741,15 +741,6 @@ namespace {{packageName}}.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index f3eaf3c5ade..6a8f9c8dc01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -749,15 +749,6 @@ namespace Org.OpenAPITools.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index f3eaf3c5ade..6a8f9c8dc01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -749,15 +749,6 @@ namespace Org.OpenAPITools.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index f3eaf3c5ade..6a8f9c8dc01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -749,15 +749,6 @@ namespace Org.OpenAPITools.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index f3eaf3c5ade..6a8f9c8dc01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -749,15 +749,6 @@ namespace Org.OpenAPITools.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index f3eaf3c5ade..6a8f9c8dc01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -749,15 +749,6 @@ namespace Org.OpenAPITools.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index f3eaf3c5ade..6a8f9c8dc01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -749,15 +749,6 @@ namespace Org.OpenAPITools.Client { keyType = PrivateKeyType.ECDSA; } - else if (key[0].Contains(ecPrivateKeyHeader) && - key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) - { - - // this type of key can hold many type different types of private key, but here due lack of pem header - // Considering this as EC key - //TODO :- update the key based on oid - keyType = PrivateKeyType.ECDSA; - } else { throw new Exception("Either the key is invalid or key is not supported"); From e1c5b220cd0b0659be770a8f406544a691c40a5e Mon Sep 17 00:00:00 2001 From: cachescrubber <5127753+cachescrubber@users.noreply.github.com> Date: Sat, 22 Jan 2022 01:51:17 +0100 Subject: [PATCH 071/113] [JAVA] new Feature interface: Documentation Provider and Annotation Library (#11258) * Implement DocumentationProviderFeatures and integrate it in AbstractJavaCodegen * Integrate DocumentationProviderFeatures in SpringCodegen * Run new test config spring-boot-springdoc * Do not use Locale.ROOT * Do not use Locale.ROOT, use NONE instead of empty list * Revert "Do not use Locale.ROOT" This reverts commit a0d6aac92bea2370b4f164d18ada3fd9097f3a30. * Do not use forbidden APIs * Fix spring maven plugin example * Introduce DocumentationProviderFeaturesTest.java * replace AUTO with preferredAnnotationLibrary * remove sout.println from Test * Apply code style. * Update spring sample configuration to use the new property * Update samples after merge * fix atBean import * Generate all samples * Add ParameterObject to test * Allow Subclasses to opt out * Use OpenAPI 2 (fka Swagger RESTful API Documentation Specification) instead of just "Swagger" * export generator docs * Fix typo * Fix typo - update docs. --- ...-boot-beanvalidation-no-nullable-oas3.yaml | 2 +- ...pring-boot-beanvalidation-no-nullable.yaml | 1 + bin/configs/spring-boot-beanvalidation.yaml | 1 + bin/configs/spring-boot-delegate-j8.yaml | 1 + bin/configs/spring-boot-delegate-oas3.yaml | 2 +- bin/configs/spring-boot-delegate.yaml | 1 + .../spring-boot-implicitHeaders-oas3.yaml | 1 + bin/configs/spring-boot-implicitHeaders.yaml | 1 + bin/configs/spring-boot-oas3.yaml | 2 +- bin/configs/spring-boot-reactive-oas3.yaml | 2 +- bin/configs/spring-boot-reactive.yaml | 1 + bin/configs/spring-boot-springdoc.yaml | 10 + bin/configs/spring-boot-useoptional-oas3.yaml | 2 +- bin/configs/spring-boot-useoptional.yaml | 1 + bin/configs/spring-boot-virtualan.yaml | 1 + bin/configs/spring-boot.yaml | 1 + bin/configs/spring-cloud-async-oas3.yaml | 2 +- bin/configs/spring-cloud-async.yaml | 1 + bin/configs/spring-cloud-date-time-oas3.yaml | 4 +- bin/configs/spring-cloud-date-time.yaml | 1 + bin/configs/spring-cloud-oas3-fakeapi.yaml | 2 +- bin/configs/spring-cloud-oas3.yaml | 2 +- ...d-petstore-feign-spring-pageable-oas3.yaml | 2 +- ...-cloud-petstore-feign-spring-pageable.yaml | 1 + bin/configs/spring-cloud.yaml | 1 + bin/configs/spring-mvc-default-values.yaml | 1 + bin/configs/spring-mvc-j8-async.yaml | 1 + bin/configs/spring-mvc-j8-localdatetime.yaml | 1 + bin/configs/spring-mvc-no-nullable.yaml | 1 + ...g-mvc-petstore-server-spring-pageable.yaml | 1 + bin/configs/spring-mvc.yaml | 1 + bin/configs/spring-stubs-oas3.yaml | 2 +- bin/configs/spring-stubs.yaml | 1 + ...g-pageable-delegatePattern-without-j8.yaml | 1 + ...erver-spring-pageable-delegatePattern.yaml | 1 + ...ore-server-spring-pageable-without-j8.yaml | 1 + ...gboot-petstore-server-spring-pageable.yaml | 1 + docs/generators/java-camel.md | 3 +- docs/generators/spring.md | 3 +- .../examples/spring.xml | 1 + .../languages/AbstractJavaCodegen.java | 83 +- .../codegen/languages/SpringCodegen.java | 60 +- .../DocumentationProviderFeatures.java | 173 ++++ .../JavaSpring/allowableValues.mustache | 2 +- .../main/resources/JavaSpring/api.mustache | 38 +- .../JavaSpring/apiController.mustache | 10 +- .../JavaSpring/homeController.mustache | 31 +- .../libraries/spring-boot/README.mustache | 4 +- .../spring-boot/application.mustache | 4 +- .../spring-boot/openapi2SpringBoot.mustache | 12 +- .../libraries/spring-boot/pom.mustache | 60 +- .../libraries/spring-cloud/pom.mustache | 56 +- .../libraries/spring-mvc/README.mustache | 4 +- .../libraries/spring-mvc/application.mustache | 4 +- .../openapiUiConfiguration.mustache | 12 +- .../libraries/spring-mvc/pom.mustache | 8 +- .../main/resources/JavaSpring/model.mustache | 4 +- .../resources/JavaSpring/paramDoc.mustache | 2 +- .../main/resources/JavaSpring/pojo.mustache | 15 +- .../java/spring/SpringCodegenTest.java | 4 + .../DocumentationProviderFeaturesTest.java | 50 + .../petstore/spring-cloud-async/pom.xml | 1 - .../petstore/spring-cloud-date-time/pom.xml | 1 - .../spring-cloud-spring-pageable/pom.xml | 1 - samples/client/petstore/spring-cloud/pom.xml | 1 - .../petstore/spring-cloud-async/pom.xml | 9 +- .../petstore/spring-cloud-date-time/pom.xml | 9 +- .../spring-cloud-oas3-fakeapi/pom.xml | 9 +- .../spring-cloud-spring-pageable/pom.xml | 9 +- .../java/org/openapitools/api/PetApi.java | 5 +- .../client/petstore/spring-cloud/pom.xml | 9 +- .../client/petstore/spring-stubs/pom.xml | 11 +- .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 20 + .../.openapi-generator/VERSION | 1 + .../petstore/spring-boot-springdoc/README.md | 16 + .../petstore/spring-boot-springdoc/pom.xml | 72 ++ .../org/openapitools/OpenAPI2SpringBoot.java | 63 ++ .../org/openapitools/RFC3339DateFormat.java | 38 + .../java/org/openapitools/api/ApiUtil.java | 19 + .../java/org/openapitools/api/PetApi.java | 393 ++++++++ .../openapitools/api/PetApiController.java | 27 + .../java/org/openapitools/api/StoreApi.java | 190 ++++ .../openapitools/api/StoreApiController.java | 27 + .../java/org/openapitools/api/UserApi.java | 304 ++++++ .../openapitools/api/UserApiController.java | 27 + .../configuration/HomeController.java | 53 ++ .../java/org/openapitools/model/Category.java | 108 +++ .../openapitools/model/ModelApiResponse.java | 132 +++ .../java/org/openapitools/model/Order.java | 245 +++++ .../main/java/org/openapitools/model/Pet.java | 261 +++++ .../main/java/org/openapitools/model/Tag.java | 108 +++ .../java/org/openapitools/model/User.java | 252 +++++ .../src/main/resources/application.properties | 3 + .../src/main/resources/openapi.yaml | 893 ++++++++++++++++++ .../pom.xml | 11 +- .../api/AnotherFakeApiController.java | 1 + .../openapitools/api/FakeApiController.java | 1 + .../api/FakeClassnameTestApiController.java | 1 + .../openapitools/api/PetApiController.java | 1 + .../openapitools/api/StoreApiController.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../configuration/HomeController.java | 2 +- .../petstore/springboot-delegate/pom.xml | 11 +- .../configuration/HomeController.java | 2 +- .../springboot-implicitHeaders/pom.xml | 11 +- .../configuration/HomeController.java | 2 +- .../petstore/springboot-reactive/pom.xml | 11 +- .../configuration/HomeController.java | 3 +- .../petstore/springboot-useoptional/pom.xml | 11 +- .../configuration/HomeController.java | 2 +- .../server/petstore/springboot/pom.xml | 11 +- .../configuration/HomeController.java | 2 +- .../api/AnotherFakeApiController.java | 1 - .../openapitools/api/FakeApiController.java | 1 - .../api/FakeClassnameTestApiController.java | 1 - .../openapitools/api/PetApiController.java | 1 - .../openapitools/api/StoreApiController.java | 1 - .../openapitools/api/UserApiController.java | 1 - .../petstore/springboot-reactive/README.md | 2 + .../petstore/springboot-reactive/pom.xml | 9 +- .../org/openapitools/OpenAPI2SpringBoot.java | 6 - .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../api/AnotherFakeApiDelegate.java | 1 + .../java/org/openapitools/api/FakeApi.java | 31 +- .../org/openapitools/api/FakeApiDelegate.java | 1 + .../api/FakeClassnameTestApi.java | 3 +- .../api/FakeClassnameTestApiDelegate.java | 1 + .../java/org/openapitools/api/PetApi.java | 17 +- .../org/openapitools/api/PetApiDelegate.java | 1 + .../java/org/openapitools/api/StoreApi.java | 9 +- .../openapitools/api/StoreApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 17 +- .../org/openapitools/api/UserApiDelegate.java | 1 + .../configuration/HomeController.java | 37 +- .../src/main/resources/application.properties | 1 + .../api/AnotherFakeApiController.java | 1 - .../openapitools/api/FakeApiController.java | 1 - .../api/FakeClassnameTestApiController.java | 1 - .../openapitools/api/PetApiController.java | 1 - .../openapitools/api/StoreApiController.java | 1 - .../openapitools/api/UserApiController.java | 1 - .../api/AnotherFakeApiController.java | 1 - .../openapitools/api/FakeApiController.java | 1 - .../api/FakeClassnameTestApiController.java | 1 - .../openapitools/api/PetApiController.java | 1 - .../openapitools/api/StoreApiController.java | 1 - .../openapitools/api/UserApiController.java | 1 - 148 files changed, 3971 insertions(+), 315 deletions(-) create mode 100644 bin/configs/spring-boot-springdoc.yaml create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator-ignore create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/VERSION create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/README.md create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/RFC3339DateFormat.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/application.properties create mode 100644 samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml index 760305ec6cb..b1e5245ae85 100644 --- a/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml +++ b/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml @@ -5,7 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 - oas3: "true" + documentationProvider: springdoc java8: "false" useBeanValidation: true artifactId: spring-boot-beanvalidation-no-nullable diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml index 85c687f4978..1457469bc72 100644 --- a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml +++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml @@ -4,6 +4,7 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox java8: "false" useBeanValidation: true artifactId: spring-boot-beanvalidation-no-nullable diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml index 573d8e283b5..dd4ea561c84 100644 --- a/bin/configs/spring-boot-beanvalidation.yaml +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -4,6 +4,7 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox java8: true useBeanValidation: true artifactId: spring-boot-beanvalidation diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml index a90e8b3ce1d..e1fae5805cd 100644 --- a/bin/configs/spring-boot-delegate-j8.yaml +++ b/bin/configs/spring-boot-delegate-j8.yaml @@ -3,6 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate-j8 inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: springboot-delegate-j8 hideGenerationTimestamp: "true" delegatePattern: "true" diff --git a/bin/configs/spring-boot-delegate-oas3.yaml b/bin/configs/spring-boot-delegate-oas3.yaml index 7d8631523d8..8b604d558a9 100644 --- a/bin/configs/spring-boot-delegate-oas3.yaml +++ b/bin/configs/spring-boot-delegate-oas3.yaml @@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 - oas3: "true" + documentationProvider: springdoc artifactId: springboot-delegate hideGenerationTimestamp: "true" java8: true diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml index 162094128db..228b14d823e 100644 --- a/bin/configs/spring-boot-delegate.yaml +++ b/bin/configs/spring-boot-delegate.yaml @@ -3,6 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: springboot-delegate hideGenerationTimestamp: "true" java8: true diff --git a/bin/configs/spring-boot-implicitHeaders-oas3.yaml b/bin/configs/spring-boot-implicitHeaders-oas3.yaml index 973561fad57..3d9423cd326 100644 --- a/bin/configs/spring-boot-implicitHeaders-oas3.yaml +++ b/bin/configs/spring-boot-implicitHeaders-oas3.yaml @@ -4,6 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 + documentationProvider: springdoc oas3: "true" artifactId: springboot-implicitHeaders hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml index cb84abe664d..5457e89b831 100644 --- a/bin/configs/spring-boot-implicitHeaders.yaml +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -4,5 +4,6 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-implicitHeaders + documentationProvider: springfox hideGenerationTimestamp: "true" implicitHeaders: true diff --git a/bin/configs/spring-boot-oas3.yaml b/bin/configs/spring-boot-oas3.yaml index 9a0f864b271..21994a14ad4 100644 --- a/bin/configs/spring-boot-oas3.yaml +++ b/bin/configs/spring-boot-oas3.yaml @@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 + documentationProvider: springdoc artifactId: springboot snapshotVersion: "true" - oas3: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-reactive-oas3.yaml b/bin/configs/spring-boot-reactive-oas3.yaml index b3fc8278491..3e3fb91657b 100644 --- a/bin/configs/spring-boot-reactive-oas3.yaml +++ b/bin/configs/spring-boot-reactive-oas3.yaml @@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 - oas3: "true" + documentationProvider: springdoc artifactId: springboot-reactive reactive: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml index 3d0c92edbee..b3edff7de11 100644 --- a/bin/configs/spring-boot-reactive.yaml +++ b/bin/configs/spring-boot-reactive.yaml @@ -4,6 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-reactive + documentationProvider: springfox reactive: "true" hideGenerationTimestamp: "true" delegatePattern: "true" diff --git a/bin/configs/spring-boot-springdoc.yaml b/bin/configs/spring-boot-springdoc.yaml new file mode 100644 index 00000000000..47b1c195c36 --- /dev/null +++ b/bin/configs/spring-boot-springdoc.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/openapi3/server/petstore/spring-boot-springdoc +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + groupId: org.openapitools.openapi3 + documentationProvider: springdoc + artifactId: spring-boot-springdoc + snapshotVersion: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-useoptional-oas3.yaml b/bin/configs/spring-boot-useoptional-oas3.yaml index 6fd5755ca31..ac66d1df148 100644 --- a/bin/configs/spring-boot-useoptional-oas3.yaml +++ b/bin/configs/spring-boot-useoptional-oas3.yaml @@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 - oas3: "true" + documentationProvider: springdoc useOptional: true artifactId: spring-boot-useoptional hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml index 93a7924dcba..1e028977898 100644 --- a/bin/configs/spring-boot-useoptional.yaml +++ b/bin/configs/spring-boot-useoptional.yaml @@ -3,6 +3,7 @@ outputDir: samples/server/petstore/springboot-useoptional inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox useOptional: true artifactId: spring-boot-useoptional hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml index 3d580d05c8a..c67ecf980ed 100644 --- a/bin/configs/spring-boot-virtualan.yaml +++ b/bin/configs/spring-boot-virtualan.yaml @@ -4,6 +4,7 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox apiPackage: org.openapitools.virtualan.api modelPackage: org.openapitools.virtualan.model virtualService: true diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index f752bc817e4..fe2345e7126 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -3,6 +3,7 @@ outputDir: samples/server/petstore/springboot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: springboot snapshotVersion: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-cloud-async-oas3.yaml b/bin/configs/spring-cloud-async-oas3.yaml index 637e9b4d162..59c9d22e695 100644 --- a/bin/configs/spring-cloud-async-oas3.yaml +++ b/bin/configs/spring-cloud-async-oas3.yaml @@ -5,7 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 - oas3: "true" + documentationProvider: springdoc async: "true" java8: "true" artifactId: petstore-spring-cloud diff --git a/bin/configs/spring-cloud-async.yaml b/bin/configs/spring-cloud-async.yaml index 7f087b9e0bc..b14f654366f 100644 --- a/bin/configs/spring-cloud-async.yaml +++ b/bin/configs/spring-cloud-async.yaml @@ -4,6 +4,7 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox async: "true" java8: "true" artifactId: petstore-spring-cloud diff --git a/bin/configs/spring-cloud-date-time-oas3.yaml b/bin/configs/spring-cloud-date-time-oas3.yaml index 27cd8723133..9e5724d2ac9 100644 --- a/bin/configs/spring-cloud-date-time-oas3.yaml +++ b/bin/configs/spring-cloud-date-time-oas3.yaml @@ -5,8 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-par templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 + documentationProvider: springdoc artifactId: spring-cloud-date-time-oas3 interfaceOnly: "true" singleContentTypes: "true" - hideGenerationTimestamp: "true" - oas3: "true" \ No newline at end of file + hideGenerationTimestamp: "true" \ No newline at end of file diff --git a/bin/configs/spring-cloud-date-time.yaml b/bin/configs/spring-cloud-date-time.yaml index 16686c8b9ac..ff06030aab3 100644 --- a/bin/configs/spring-cloud-date-time.yaml +++ b/bin/configs/spring-cloud-date-time.yaml @@ -4,6 +4,7 @@ outputDir: samples/client/petstore/spring-cloud-date-time inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: spring-cloud-date-time interfaceOnly: "true" singleContentTypes: "true" diff --git a/bin/configs/spring-cloud-oas3-fakeapi.yaml b/bin/configs/spring-cloud-oas3-fakeapi.yaml index f12e8b60199..3f4e3c8ba3a 100644 --- a/bin/configs/spring-cloud-oas3-fakeapi.yaml +++ b/bin/configs/spring-cloud-oas3-fakeapi.yaml @@ -5,8 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 + documentationProvider: springdoc artifactId: spring-cloud-oas3 interfaceOnly: "true" singleContentTypes: "true" hideGenerationTimestamp: "true" - oas3: "true" diff --git a/bin/configs/spring-cloud-oas3.yaml b/bin/configs/spring-cloud-oas3.yaml index 3d627dcca25..c43b53303af 100644 --- a/bin/configs/spring-cloud-oas3.yaml +++ b/bin/configs/spring-cloud-oas3.yaml @@ -5,8 +5,8 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 + documentationProvider: springdoc artifactId: spring-cloud-oas3 interfaceOnly: "true" singleContentTypes: "true" hideGenerationTimestamp: "true" - oas3: "true" diff --git a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml index 64f048226e8..02c96627b64 100644 --- a/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml +++ b/bin/configs/spring-cloud-petstore-feign-spring-pageable-oas3.yaml @@ -5,6 +5,6 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 - oas3: "true" + documentationProvider: springdoc artifactId: spring-cloud-spring-pageable hideGenerationTimestamp: 'true' diff --git a/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml b/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml index 366a1978822..506a1c53be6 100644 --- a/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml +++ b/bin/configs/spring-cloud-petstore-feign-spring-pageable.yaml @@ -4,5 +4,6 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: spring-cloud-spring-pageable hideGenerationTimestamp: 'true' diff --git a/bin/configs/spring-cloud.yaml b/bin/configs/spring-cloud.yaml index df13fabbf03..cd207cd64cd 100644 --- a/bin/configs/spring-cloud.yaml +++ b/bin/configs/spring-cloud.yaml @@ -4,5 +4,6 @@ library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: petstore-spring-cloud hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-mvc-default-values.yaml b/bin/configs/spring-mvc-default-values.yaml index b1ae7fbd048..e25aa41b503 100644 --- a/bin/configs/spring-mvc-default-values.yaml +++ b/bin/configs/spring-mvc-default-values.yaml @@ -3,5 +3,6 @@ outputDir: samples/server/petstore/spring-mvc-default-value inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_8535.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox hideGenerationTimestamp: "true" artifactId: spring-mvc-default-value \ No newline at end of file diff --git a/bin/configs/spring-mvc-j8-async.yaml b/bin/configs/spring-mvc-j8-async.yaml index cd03b0e427d..287d05993ee 100644 --- a/bin/configs/spring-mvc-j8-async.yaml +++ b/bin/configs/spring-mvc-j8-async.yaml @@ -4,6 +4,7 @@ library: spring-mvc inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox async: "true" java8: true artifactId: spring-mvc-server-j8-async diff --git a/bin/configs/spring-mvc-j8-localdatetime.yaml b/bin/configs/spring-mvc-j8-localdatetime.yaml index f8d6126c9f3..c1e66bf80a6 100644 --- a/bin/configs/spring-mvc-j8-localdatetime.yaml +++ b/bin/configs/spring-mvc-j8-localdatetime.yaml @@ -4,6 +4,7 @@ library: spring-mvc inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox booleanGetterPrefix: get artifactId: spring-mvc-j8-localdatetime hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-mvc-no-nullable.yaml b/bin/configs/spring-mvc-no-nullable.yaml index f1d6585071c..76cefce348f 100644 --- a/bin/configs/spring-mvc-no-nullable.yaml +++ b/bin/configs/spring-mvc-no-nullable.yaml @@ -4,6 +4,7 @@ library: spring-mvc inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: spring-mvc-server-no-nullable openApiNullable: "false" serverPort: "8002" diff --git a/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml b/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml index bcb362e65db..027a98cbff4 100644 --- a/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml +++ b/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml @@ -4,5 +4,6 @@ library: spring-mvc inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: spring-mvc-spring-pageable hideGenerationTimestamp: 'true' diff --git a/bin/configs/spring-mvc.yaml b/bin/configs/spring-mvc.yaml index 8eca9e650a2..9093bb518c8 100644 --- a/bin/configs/spring-mvc.yaml +++ b/bin/configs/spring-mvc.yaml @@ -4,6 +4,7 @@ library: spring-mvc inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox java8: true booleanGetterPrefix: get artifactId: spring-mvc-server diff --git a/bin/configs/spring-stubs-oas3.yaml b/bin/configs/spring-stubs-oas3.yaml index 1c725e53b33..d5149f28adc 100644 --- a/bin/configs/spring-stubs-oas3.yaml +++ b/bin/configs/spring-stubs-oas3.yaml @@ -4,8 +4,8 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 + documentationProvider: springdoc artifactId: spring-stubs - oas3: "true" interfaceOnly: "true" singleContentTypes: "true" hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-stubs.yaml b/bin/configs/spring-stubs.yaml index 8c58e6838ea..bdbefb1e58f 100644 --- a/bin/configs/spring-stubs.yaml +++ b/bin/configs/spring-stubs.yaml @@ -3,6 +3,7 @@ outputDir: samples/client/petstore/spring-stubs inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: spring-stubs interfaceOnly: "true" singleContentTypes: "true" diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml index 7e0c9882db5..7d16b4a1e76 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml @@ -6,5 +6,6 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true java8: false additionalProperties: + documentationProvider: springfox artifactId: springboot-spring-pageable-delegatePattern-without-j8 hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml index 9c96151f04f..c4d1eb5b687 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml @@ -5,5 +5,6 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring delegatePattern: true additionalProperties: + documentationProvider: springfox artifactId: springboot-spring-pageable-delegatePattern hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml index c87a6776a5f..87c63968490 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml @@ -5,5 +5,6 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/JavaSpring java8: false additionalProperties: + documentationProvider: springfox artifactId: springboot-spring-pageable-withoutj8 hideGenerationTimestamp: 'true' diff --git a/bin/configs/springboot-petstore-server-spring-pageable.yaml b/bin/configs/springboot-petstore-server-spring-pageable.yaml index ddeaaa6cb72..db518c22604 100644 --- a/bin/configs/springboot-petstore-server-spring-pageable.yaml +++ b/bin/configs/springboot-petstore-server-spring-pageable.yaml @@ -4,5 +4,6 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + documentationProvider: springfox artifactId: springboot-spring-pageable hideGenerationTimestamp: 'true' diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index a55d98db57a..c0ebb548e2e 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -20,6 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| |additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|annotationLibrary|Select the complementary documentation annotation library.|
**none**
Do not annotate Model and Api with complementary annotations.
**swagger1**
Annotate Model and Api using the Swagger Annotations 1.x library.
**swagger2**
Annotate Model and Api using the Swagger Annotations 2.x library.
|swagger2| |apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| @@ -47,6 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springfox**
Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| @@ -63,7 +65,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|oas3|Use OAS 3 Swagger annotations instead of OAS 2 annotations| |false| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 94e1639fa0e..c06ac0fa707 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -20,6 +20,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| |additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|annotationLibrary|Select the complementary documentation annotation library.|
**none**
Do not annotate Model and Api with complementary annotations.
**swagger1**
Annotate Model and Api using the Swagger Annotations 1.x library.
**swagger2**
Annotate Model and Api using the Swagger Annotations 2.x library.
|swagger2| |apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| @@ -40,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|documentationProvider|Select the OpenAPI documentation provider.|
**none**
Do not publish an OpenAPI specification.
**source**
Publish the original input OpenAPI specification.
**springfox**
Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.
**springdoc**
Generate an OpenAPI 3 specification using SpringDoc.
|springdoc| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| @@ -56,7 +58,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| -|oas3|Use OAS 3 Swagger annotations instead of OAS 2 annotations| |false| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index e1802203383..e5ea3463f94 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -40,6 +40,7 @@ + springfox true true 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 603de4781b9..05cb3233ebf 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 @@ -32,6 +32,7 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.features.DocumentationProviderFeatures; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -48,7 +49,8 @@ import java.util.stream.Stream; import static org.openapitools.codegen.utils.StringUtils.*; -public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig { +public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig, + DocumentationProviderFeatures { private final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class); private static final String ARTIFACT_VERSION_DEFAULT_VALUE = "1.0.0"; @@ -111,6 +113,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected List additionalModelTypeAnnotations = new LinkedList<>(); protected List additionalEnumTypeAnnotations = new LinkedList<>(); protected boolean openApiNullable = true; + protected DocumentationProvider documentationProvider; + protected AnnotationLibrary annotationLibrary; public AbstractJavaCodegen() { super(); @@ -259,12 +263,68 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code snapShotVersion.setEnum(snapShotVersionOptions); cliOptions.add(snapShotVersion); + if (null != defaultDocumentationProvider()) { + CliOption documentationProviderCliOption = new CliOption(DOCUMENTATION_PROVIDER, + "Select the OpenAPI documentation provider.") + .defaultValue(defaultDocumentationProvider().toCliOptValue()); + supportedDocumentationProvider().forEach(dp -> + documentationProviderCliOption.addEnum(dp.toCliOptValue(), dp.getDescription())); + cliOptions.add(documentationProviderCliOption); + + CliOption annotationLibraryCliOption = new CliOption(ANNOTATION_LIBRARY, + "Select the complementary documentation annotation library.") + .defaultValue(defaultDocumentationProvider().getPreferredAnnotationLibrary().toCliOptValue()); + supportedAnnotationLibraries().forEach(al -> + annotationLibraryCliOption.addEnum(al.toCliOptValue(), al.getDescription())); + cliOptions.add(annotationLibraryCliOption); + } } @Override public void processOpts() { super.processOpts(); + if (null != defaultDocumentationProvider()) { + documentationProvider = DocumentationProvider.ofCliOption( + (String)additionalProperties.getOrDefault(DOCUMENTATION_PROVIDER, + defaultDocumentationProvider().toCliOptValue()) + ); + + if (! supportedDocumentationProvider().contains(documentationProvider)) { + String msg = String.format(Locale.ROOT, + "The [%s] Documentation Provider is not supported by this generator", + documentationProvider.toCliOptValue()); + throw new IllegalArgumentException(msg); + } + + annotationLibrary = AnnotationLibrary.ofCliOption( + (String) additionalProperties.getOrDefault(ANNOTATION_LIBRARY, + documentationProvider.getPreferredAnnotationLibrary().toCliOptValue()) + ); + + if (! supportedAnnotationLibraries().contains(annotationLibrary)) { + String msg = String.format(Locale.ROOT, "The Annotation Library [%s] is not supported by this generator", + annotationLibrary.toCliOptValue()); + throw new IllegalArgumentException(msg); + } + + if (! documentationProvider.supportedAnnotationLibraries().contains(annotationLibrary)) { + String msg = String.format(Locale.ROOT, + "The [%s] documentation provider does not support [%s] as complementary annotation library", + documentationProvider.toCliOptValue(), annotationLibrary.toCliOptValue()); + throw new IllegalArgumentException(msg); + } + + additionalProperties.put(DOCUMENTATION_PROVIDER, documentationProvider.toCliOptValue()); + additionalProperties.put(documentationProvider.getPropertyName(), true); + additionalProperties.put(ANNOTATION_LIBRARY, annotationLibrary.toCliOptValue()); + additionalProperties.put(annotationLibrary.getPropertyName(), true); + } else { + additionalProperties.put(DOCUMENTATION_PROVIDER, DocumentationProvider.NONE); + additionalProperties.put(ANNOTATION_LIBRARY, AnnotationLibrary.NONE); + } + + if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) { LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)"); LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); @@ -1753,6 +1813,26 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.openApiNullable = openApiNullable; } + @Override + public DocumentationProvider getDocumentationProvider() { + return documentationProvider; + } + + @Override + public void setDocumentationProvider(DocumentationProvider documentationProvider) { + this.documentationProvider = documentationProvider; + } + + @Override + public AnnotationLibrary getAnnotationLibrary() { + return annotationLibrary; + } + + @Override + public void setAnnotationLibrary(AnnotationLibrary annotationLibrary) { + this.annotationLibrary = annotationLibrary; + } + @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -1933,4 +2013,5 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code addImport(codegenModel, codegenModel.additionalPropertiesType); } } + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index c6eeb212bee..ec8853e4a96 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -89,7 +89,6 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String IMPLICIT_HEADERS = "implicitHeaders"; public static final String OPENAPI_DOCKET_CONFIG = "swaggerDocketConfig"; public static final String API_FIRST = "apiFirst"; - public static final String OAS3 = "oas3"; public static final String SPRING_CONTROLLER = "useSpringController"; public static final String HATEOAS = "hateoas"; public static final String RETURN_SUCCESS_CODE = "returnSuccessCode"; @@ -122,7 +121,6 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean returnSuccessCode = false; protected boolean unhandledException = false; protected boolean useSpringController = false; - protected boolean oas3 = false; public SpringCodegen() { super(); @@ -198,7 +196,6 @@ public class SpringCodegen extends AbstractJavaCodegen CliOption.newBoolean(HATEOAS, "Use Spring HATEOAS library to allow adding HATEOAS links", hateoas)); cliOptions .add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode)); - cliOptions.add(CliOption.newBoolean(OAS3, "Use OAS 3 Swagger annotations instead of OAS 2 annotations", oas3)); cliOptions.add(CliOption.newBoolean(SPRING_CONTROLLER, "Annotate the generated API as a Spring Controller", useSpringController)); cliOptions.add(CliOption.newBoolean(UNHANDLED_EXCEPTION_HANDLING, "Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).", @@ -239,6 +236,29 @@ public class SpringCodegen extends AbstractJavaCodegen return "Generates a Java SpringBoot Server application using the SpringFox integration."; } + @Override + public DocumentationProvider defaultDocumentationProvider() { + return DocumentationProvider.SPRINGDOC; + } + + public List supportedDocumentationProvider() { + List supportedProviders = new ArrayList<>(); + supportedProviders.add(DocumentationProvider.NONE); + supportedProviders.add(DocumentationProvider.SOURCE); + supportedProviders.add(DocumentationProvider.SPRINGFOX); + supportedProviders.add(DocumentationProvider.SPRINGDOC); + return supportedProviders; + } + + @Override + public List supportedAnnotationLibraries() { + List supportedLibraries = new ArrayList<>(); + supportedLibraries.add(AnnotationLibrary.NONE); + supportedLibraries.add(AnnotationLibrary.SWAGGER1); + supportedLibraries.add(AnnotationLibrary.SWAGGER2); + return supportedLibraries; + } + @Override public void processOpts() { final List> configOptions = additionalProperties.entrySet().stream() @@ -374,11 +394,6 @@ public class SpringCodegen extends AbstractJavaCodegen } writePropertyBack(SPRING_CONTROLLER, useSpringController); - if (additionalProperties.containsKey(OAS3)) { - this.setOas3(convertPropertyToBoolean(OAS3)); - } - writePropertyBack(OAS3, oas3); - if (additionalProperties.containsKey(RETURN_SUCCESS_CODE)) { this.setReturnSuccessCode(Boolean.parseBoolean(additionalProperties.get(RETURN_SUCCESS_CODE).toString())); } @@ -394,6 +409,7 @@ public class SpringCodegen extends AbstractJavaCodegen importMapping.put("Pageable", "org.springframework.data.domain.Pageable"); importMapping.put("DateTimeFormat", "org.springframework.format.annotation.DateTimeFormat"); importMapping.put("ApiIgnore", "springfox.documentation.annotations.ApiIgnore"); + importMapping.put("ParameterObject", "org.springdoc.api.annotations.ParameterObject"); if (useOptional) { writePropertyBack(USE_OPTIONAL, useOptional); @@ -518,15 +534,6 @@ public class SpringCodegen extends AbstractJavaCodegen additionalProperties.put(RESPONSE_WRAPPER, "Callable"); } - // Springfox cannot be used with oas3 or apiFirst or reactive. So, write the property back after determining - // whether it should be enabled or not. - boolean useSpringFox = false; - if (!apiFirst && !reactive && !oas3) { - useSpringFox = true; - additionalProperties.put("useSpringfox", true); - } - writePropertyBack("useSpringfox", useSpringFox); - // Some well-known Spring or Spring-Cloud response wrappers if (isNotEmpty(responseWrapper)) { additionalProperties.put("jdk8", false); @@ -885,10 +892,6 @@ public class SpringCodegen extends AbstractJavaCodegen this.useSpringController = useSpringController; } - public void setOas3(boolean oas3) { - this.oas3 = oas3; - } - public void setReturnSuccessCode(boolean returnSuccessCode) { this.returnSuccessCode = returnSuccessCode; } @@ -937,8 +940,8 @@ public class SpringCodegen extends AbstractJavaCodegen @Override public CodegenModel fromModel(String name, Schema model) { CodegenModel codegenModel = super.fromModel(name, model); - if (oas3) { - // remove swagger2 imports + if (getAnnotationLibrary() != AnnotationLibrary.SWAGGER1) { + // remove swagger imports codegenModel.imports.remove("ApiModelProperty"); codegenModel.imports.remove("ApiModel"); } @@ -961,7 +964,16 @@ public class SpringCodegen extends AbstractJavaCodegen // add org.springframework.data.domain.Pageable import when needed if (codegenOperation.vendorExtensions.containsKey("x-spring-paginated")) { codegenOperation.imports.add("Pageable"); - if (Boolean.TRUE.equals(additionalProperties.get("useSpringfox"))) { + if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) { + codegenOperation.imports.add("ApiIgnore"); + } + if (DocumentationProvider.SPRINGDOC.equals(getDocumentationProvider())) { + codegenOperation.imports.add("ParameterObject"); + } + } + + if (reactive) { + if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) { codegenOperation.imports.add("ApiIgnore"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java new file mode 100644 index 00000000000..b658ea0e4d9 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java @@ -0,0 +1,173 @@ +package org.openapitools.codegen.languages.features; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Objects; + +/** + * The DocumentationProvider Features support to additional properties to select the + * documentation provider and the annotation library to use during code generation. + * + * @author cachescrubber, 2022-01-08 + * @since 5.4.0 + */ +public interface DocumentationProviderFeatures { + + String DOCUMENTATION_PROVIDER = "documentationProvider"; + + String ANNOTATION_LIBRARY = "annotationLibrary"; + + /** + * Define the default documentation Provider for CliOpts processing. + * A NULL return value will disable the documentation provider support. + * Override in subclasses to customize. + * @return the default documentation provider + */ + default DocumentationProvider defaultDocumentationProvider() { + return null; + } + + /** + * Define the List of supported documentation Provider for CliOpts processing. + * Override in subclasses to customize. + * @return the list of supported documentation provider + */ + default List supportedDocumentationProvider() { + List supportedProviders = new ArrayList<>(); + supportedProviders.add(DocumentationProvider.NONE); + return supportedProviders; + } + + /** + * Define the list of supported annotation libraries for CliOpts processing. + * Override in subclasses to customize. + * @return the list of supported annotation libraries + */ + default List supportedAnnotationLibraries() { + List supportedLibraries = new ArrayList<>(); + supportedLibraries.add(AnnotationLibrary.NONE); + return supportedLibraries; + } + + DocumentationProvider getDocumentationProvider(); + + void setDocumentationProvider(DocumentationProvider documentationProvider); + + AnnotationLibrary getAnnotationLibrary(); + + void setAnnotationLibrary(AnnotationLibrary annotationLibrary); + + enum DocumentationProvider { + NONE("withoutDocumentationProvider", "Do not publish an OpenAPI specification.", + AnnotationLibrary.NONE, AnnotationLibrary.values()), + + SOURCE("sourceDocumentationProvider", "Publish the original input OpenAPI specification.", + AnnotationLibrary.NONE, AnnotationLibrary.values()), + + SWAGGER1("swagger1DocumentationProvider", "Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using Swagger-Core 1.x.", + AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER1), + + SWAGGER2("swagger2DocumentationProvider", "Generate an OpenAPI 3 specification using Swagger-Core 2.x.", + AnnotationLibrary.SWAGGER2, AnnotationLibrary.SWAGGER2), + + SPRINGFOX("springFoxDocumentationProvider", "Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.", + AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER1), + + SPRINGDOC("springDocDocumentationProvider", "Generate an OpenAPI 3 specification using SpringDoc.", + AnnotationLibrary.SWAGGER2, AnnotationLibrary.SWAGGER2); + + private final String propertyName; + + private final String description; + + private final AnnotationLibrary preferredAnnotationLibrary; + + private final AnnotationLibrary[] supportedAnnotationLibraries; + + DocumentationProvider(String propertyName, String description, + AnnotationLibrary preferredAnnotationLibrary, + AnnotationLibrary... supportedAnnotationLibraries) { + this.propertyName = propertyName; + this.description = description; + this.preferredAnnotationLibrary = preferredAnnotationLibrary; + this.supportedAnnotationLibraries = supportedAnnotationLibraries; + } + + public static DocumentationProvider ofCliOption(String optVal) { + optVal = Objects.requireNonNull(optVal).toUpperCase(Locale.ROOT); + return valueOf(optVal); + } + + /** + * The property name should be used in the codegen model as a boolean property. + * + * @return the property name for this documentation provider + */ + public String getPropertyName() { + return propertyName; + } + + public String getDescription() { + return description; + } + + public AnnotationLibrary getPreferredAnnotationLibrary() { + return preferredAnnotationLibrary; + } + + public AnnotationLibrary[] getSupportedAnnotationLibraries() { + return supportedAnnotationLibraries; + } + + public List supportedAnnotationLibraries() { + return Arrays.asList(getSupportedAnnotationLibraries()); + } + + public String toCliOptValue() { + return name().toLowerCase(Locale.ROOT); + } + } + + enum AnnotationLibrary { + NONE("withoutAnnotationLibrary", "Do not annotate Model and Api with complementary annotations."), + + SWAGGER1("swagger1AnnotationLibrary", "Annotate Model and Api using the Swagger Annotations 1.x library."), + + SWAGGER2("swagger2AnnotationLibrary", "Annotate Model and Api using the Swagger Annotations 2.x library."), + + MICROPROFILE("microprofileAnnotationLibrary", "Annotate Model and Api using the Microprofile annotations."); + + private final String propertyName; + + private final String description; + + public static AnnotationLibrary ofCliOption(String optVal) { + optVal = Objects.requireNonNull(optVal).toUpperCase(Locale.ROOT); + return valueOf(optVal); + } + + /** + * The property name is used in the codegen model as a boolean property. + * + * @return the property name for this annotation library + */ + public String getPropertyName() { + return propertyName; + } + + public String getDescription() { + return description; + } + + AnnotationLibrary(String propertyName, String description) { + this.propertyName = propertyName; + this.description = description; + } + + public String toCliOptValue() { + return name().toLowerCase(Locale.ROOT); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/allowableValues.mustache index 1cba2038d87..6aa973a6a65 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues ={{#oas3}} { {{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}} }{{/oas3}}{{^oas3}} "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/oas3}}{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues ={{#swagger2AnnotationLibrary}} { {{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}} }{{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/swagger1AnnotationLibrary}}{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index affa1fb385b..da913ae679a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -7,7 +7,7 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -{{#oas3}} +{{#swagger2AnnotationLibrary}} import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -16,10 +16,10 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -{{/oas3}} -{{^oas3}} +{{/swagger2AnnotationLibrary}} +{{#swagger1AnnotationLibrary}} import io.swagger.annotations.*; -{{/oas3}} +{{/swagger1AnnotationLibrary}} {{#jdk8-no-delegate}} {{#virtualService}} import io.virtualan.annotation.ApiVirtual; @@ -75,12 +75,12 @@ import javax.annotation.Generated; {{#useSpringController}} @Controller {{/useSpringController}} -{{#oas3}} +{{#swagger2AnnotationLibrary}} @Tag(name = "{{{baseName}}}", description = "the {{{baseName}}} API") -{{/oas3}} -{{^oas3}} +{{/swagger2AnnotationLibrary}} +{{#swagger1AnnotationLibrary}} @Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") -{{/oas3}} +{{/swagger1AnnotationLibrary}} {{#operations}} {{#virtualService}} @VirtualService @@ -126,7 +126,7 @@ public interface {{classname}} { {{#virtualService}} @ApiVirtual {{/virtualService}} - {{#oas3}} + {{#swagger2AnnotationLibrary}} @Operation( operationId = "{{{operationId}}}", {{#summary}} @@ -146,8 +146,8 @@ public interface {{classname}} { {{/authMethods}} }{{/hasAuthMethods}} ) - {{/oas3}} - {{^oas3}} + {{/swagger2AnnotationLibrary}} + {{#swagger1AnnotationLibrary}} @ApiOperation( tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }, value = "{{{summary}}}", @@ -174,20 +174,20 @@ public interface {{classname}} { @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}} {{/responses}} }) - {{/oas3}} + {{/swagger1AnnotationLibrary}} {{#implicitHeaders}} - {{#oas3}} + {{#swagger2AnnotationLibrary}} @Parameters({ {{#headerParams}} {{>paramDoc}}{{^-last}},{{/-last}} {{/headerParams}} - {{/oas3}} - {{^oas3}} + {{/swagger2AnnotationLibrary}} + {{#swagger1AnnotationLibrary}} @ApiImplicitParams({ {{#headerParams}} {{>implicitHeader}}{{^-last}},{{/-last}} {{/headerParams}} - {{/oas3}} + {{/swagger1AnnotationLibrary}} }) {{/implicitHeaders}} @RequestMapping( @@ -201,15 +201,15 @@ public interface {{classname}} { {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, - {{/hasParams}}{{#oas3}}@Parameter(hidden = true){{/oas3}}{{#useSpringfox}}@ApiIgnore{{/useSpringfox}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, - {{/hasParams}}{{#useSpringfox}}@ApiIgnore {{/useSpringfox}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}} + {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, + {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject {{/springDocDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}} ){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { {{#delegate-method}} return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}}); } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#useSpringfox}}@ApiIgnore{{/useSpringfox}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#useSpringfox}}@ApiIgnore{{/useSpringfox}} final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index ca8076c56a4..374fe9eaa8c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -3,7 +3,7 @@ package {{package}}; {{^jdk8}} {{#imports}}import {{import}}; {{/imports}} -{{#oas3}} +{{#swagger2AnnotationLibrary}} import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -11,10 +11,10 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; -{{/oas3}} -{{^oas3}} +{{/swagger2AnnotationLibrary}} +{{^swagger1AnnotationLibrary}} import io.swagger.annotations.*; -{{/oas3}} +{{/swagger1AnnotationLibrary}} import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -132,7 +132,7 @@ public class {{classname}}Controller implements {{classname}} { public {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}}, {{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, - {{/hasParams}}{{#useSpringfox}}@ApiIgnore {{/useSpringfox}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}} + {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}} ) { {{^isDelegate}} {{^async}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache index f909a15b37d..189eccefbc8 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache @@ -1,35 +1,36 @@ package {{configPackage}}; -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} import org.springframework.stereotype.Controller; -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} import org.springframework.util.StreamUtils; import org.springframework.web.bind.annotation.GetMapping; -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} import org.springframework.web.bind.annotation.RequestMapping; -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} import org.springframework.web.bind.annotation.ResponseBody; -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} {{#reactive}} +import org.springframework.context.annotation.Bean; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerResponse; {{/reactive}} -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} import java.io.IOException; import java.io.InputStream; -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} {{#reactive}} import java.net.URI; {{/reactive}} -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} import java.nio.charset.Charset; -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} {{#reactive}} import static org.springframework.web.reactive.function.server.RequestPredicates.GET; @@ -42,7 +43,7 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r @Controller public class HomeController { -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} private static YAMLMapper yamlMapper = new YAMLMapper(); @Value("classpath:/openapi.yaml") @@ -67,20 +68,20 @@ public class HomeController { return yamlMapper.readValue(openapiContent(), Object.class); } -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} {{#reactive}} @Bean RouterFunction index() { return route( GET("/"), - req -> ServerResponse.temporaryRedirect(URI.create("{{#useSpringfox}}swagger-ui.html{{/useSpringfox}}{{^useSpringfox}}swagger-ui/index.html?url=../openapi.json{{/useSpringfox}}")).build() + req -> ServerResponse.temporaryRedirect(URI.create("{{#springFoxDocumentationProvider}}swagger-ui.html{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}swagger-ui/index.html?url=../openapi.json{{/springFoxDocumentationProvider}}")).build() ); } {{/reactive}} {{^reactive}} @RequestMapping("/") public String index() { - return "redirect:{{#useSpringfox}}swagger-ui.html{{/useSpringfox}}{{^useSpringfox}}swagger-ui/index.html?url=../openapi.json{{/useSpringfox}}"; + return "redirect:{{#springFoxDocumentationProvider}}swagger-ui.html{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}swagger-ui/index.html?url=../openapi.json{{/springFoxDocumentationProvider}}"; } {{/reactive}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache index 196292339da..b304cb8866d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache @@ -8,10 +8,10 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -{{#useSpringfox}} +{{#springFoxDocumentationProvider}} The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} Start your server as a simple java application {{^reactive}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache index 6eb4ae24298..06f041051b9 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache @@ -1,6 +1,6 @@ -{{#useSpringfox}} +{{#springFoxDocumentationProvider}} springfox.documentation.swagger.v2.path=/api-docs -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} server.port={{serverPort}} spring.jackson.date-format={{basePackage}}.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache index 8180f6c50a0..a171e3cff16 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache @@ -12,9 +12,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; {{^reactive}} import org.springframework.web.servlet.config.annotation.CorsRegistry; - {{^useSpringfox}} + {{^springFoxDocumentationProvider}} import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; - {{/useSpringfox}} + {{/springFoxDocumentationProvider}} import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; {{^java8}} import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @@ -22,9 +22,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter {{/reactive}} {{#reactive}} import org.springframework.web.reactive.config.CorsRegistry; - {{^useSpringfox}} + {{^springFoxDocumentationProvider}} import org.springframework.web.reactive.config.ResourceHandlerRegistry; - {{/useSpringfox}} + {{/springFoxDocumentationProvider}} import org.springframework.web.reactive.config.WebFluxConfigurer; {{/reactive}} @@ -63,13 +63,13 @@ public class OpenAPI2SpringBoot implements CommandLineRunner { .allowedMethods("*") .allowedHeaders("Content-Type"); }*/ -{{^useSpringfox}} +{{^springFoxDocumentationProvider}} @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); } -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} }; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index 05447fe9563..c929876ffc4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -9,12 +9,22 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - {{#useSpringfox}} + {{#springFoxDocumentationProvider}} 2.9.2 - {{/useSpringfox}} - {{^useSpringfox}} - {{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}} - {{/useSpringfox}} + {{/springFoxDocumentationProvider}} + {{#springDocDocumentationProvider}} + 1.6.4 + {{/springDocDocumentationProvider}} + {{^springFoxDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger1AnnotationLibrary}} + 1.6.4 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + }2.1.12 + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + {{/springFoxDocumentationProvider}} {{#parentOverridden}} @@ -27,7 +37,7 @@ org.springframework.boot spring-boot-starter-parent - 2.5.8 + {{#springFoxDocumentationProvider}}2.5.8{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.6.2{{/springFoxDocumentationProvider}} {{/parentOverridden}} @@ -82,30 +92,40 @@ org.springframework.data spring-data-commons - {{#useSpringfox}} + {{#springDocDocumentationProvider}} + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + {{/springDocDocumentationProvider}} + {{#springFoxDocumentationProvider}} io.springfox springfox-swagger2 ${springfox.version} - {{/useSpringfox}} - {{^useSpringfox}} - {{#oas3}} - - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} - - {{/oas3}} - {{^oas3}} + {{/springFoxDocumentationProvider}} + {{^springFoxDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations - ${swagger-core-version} + ${swagger-annotations.version} - {{/oas3}} - {{/useSpringfox}} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations.version} + + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + {{/springFoxDocumentationProvider}} com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index f9228dd345e..64a0b7189ba 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -9,10 +9,22 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - {{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}} - {{#useSpringfox}} + {{#springFoxDocumentationProvider}} 2.9.2 - {{/useSpringfox}} + {{/springFoxDocumentationProvider}} + {{#springDocDocumentationProvider}} + 1.6.4 + {{/springDocDocumentationProvider}} + {{^springFoxDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger1AnnotationLibrary}} + 1.6.4 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + }2.1.12 + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + {{/springFoxDocumentationProvider}} {{#parentOverridden}} @@ -47,30 +59,40 @@ {{/parentOverridden}} - {{#useSpringfox}} + {{#springDocDocumentationProvider}} + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + {{/springDocDocumentationProvider}} + {{#springFoxDocumentationProvider}} io.springfox springfox-swagger2 ${springfox.version} - {{/useSpringfox}} - {{^useSpringfox}} - {{#oas3}} - - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} - - {{/oas3}} - {{^oas3}} + {{/springFoxDocumentationProvider}} + {{^springFoxDocumentationProvider}} + {{^springDocDocumentationProvider}} + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations - ${swagger-core-version} + ${swagger-annotations.version} - {{/oas3}} - {{/useSpringfox}} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations.version} + + {{/swagger2AnnotationLibrary}} + {{/springDocDocumentationProvider}} + {{/springFoxDocumentationProvider}} com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache index efc3e8921a6..bdd21d95a70 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache @@ -6,9 +6,9 @@ Spring MVC Server ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework. -{{#useSpringfox}} +{{#springFoxDocumentationProvider}} The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox) -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} You can view the server in swagger-ui by pointing to http://localhost:{{serverPort}}{{contextPath}}{{^contextPath}}/{{/contextPath}}/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache index 67214287ed3..655c870be61 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache @@ -1,3 +1,3 @@ -{{#useSpringfox}} +{{#springFoxDocumentationProvider}} springfox.documentation.swagger.v2.path=/api-docs -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache index 8709512d54a..a9b5410403d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache @@ -11,9 +11,9 @@ import org.openapitools.jackson.nullable.JsonNullableModule; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; -{{#useSpringfox}} +{{#springFoxDocumentationProvider}} import org.springframework.context.annotation.Import; -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} import org.springframework.context.annotation.Bean; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter; @@ -39,9 +39,9 @@ import javax.annotation.Generated; @ComponentScan(basePackages = {"{{apiPackage}}", "{{configPackage}}"}) @EnableWebMvc @PropertySource("classpath:application.properties") -{{#useSpringfox}} +{{#springFoxDocumentationProvider}} @Import(OpenAPIDocumentationConfig.class) -{{/useSpringfox}} +{{/springFoxDocumentationProvider}} public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; @@ -81,11 +81,11 @@ public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter { if (!registry.hasMappingForPattern("/**")) { registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS); } - {{^useSpringfox}} + {{^springFoxDocumentationProvider}} if (!registry.hasMappingForPattern("/swagger-ui/**")) { registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); } - {{/useSpringfox}} + {{/springFoxDocumentationProvider}} } /*@Override diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index f0f17f6b208..3610261ac22 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -147,7 +147,7 @@ jakarta.xml.bind-api ${jakarta.xml.bind-version} - {{#useSpringfox}} + {{#springFoxDocumentationProvider}} io.springfox @@ -165,8 +165,8 @@ springfox-swagger-ui ${springfox-version} - {{/useSpringfox}} - {{^useSpringfox}} + {{/springFoxDocumentationProvider}} + {{^springFoxDocumentationProvider}} io.springfox springfox-swagger2 @@ -208,7 +208,7 @@ jackson-dataformat-yaml ${jackson-version} - {{/useSpringfox}} + {{/springFoxDocumentationProvider}} {{#withXml}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index 18f1ca62071..9261660fe36 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -26,9 +26,9 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; {{/withXml}} {{/jackson}} -{{#oas3}} +{{#swagger2AnnotationLibrary}} import io.swagger.v3.oas.annotations.media.Schema; -{{/oas3}} +{{/swagger2AnnotationLibrary}} {{#withXml}} import javax.xml.bind.annotation.*; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache index 7f3eb71e0b0..304e097c219 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache @@ -1 +1 @@ -{{#oas3}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}, schema = @Schema(description = ""{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}})){{/oas3}}{{^oas3}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/oas3}} \ No newline at end of file +{{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}, schema = @Schema(description = ""{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}})){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/swagger1AnnotationLibrary}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index dd1ac7f2b98..c33f9ac03b4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -3,7 +3,12 @@ */ {{>additionalModelTypeAnnotations}} {{#description}} -{{#oas3}}@Schema({{#name}}name = "{{name}}", {{/name}}{{/oas3}}{{^oas3}}@ApiModel({{/oas3}}description = "{{{.}}}") +{{#swagger1AnnotationLibrary}} +@ApiModel(description = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +@Schema({{#name}}name = "{{name}}", {{/name}}description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{/description}} {{#discriminator}} {{>typeInfoAnnotation}} @@ -130,12 +135,12 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#ha {{#useBeanValidation}} {{>beanValidation}} {{/useBeanValidation}} - {{#oas3}} + {{#swagger2AnnotationLibrary}} @Schema(name = "{{{baseName}}}", {{#isReadOnly}}accessMode = Schema.AccessMode.READ_ONLY, {{/isReadOnly}}{{#example}}example = "{{{.}}}", {{/example}}{{#description}}description = "{{{.}}}", {{/description}}required = {{{required}}}) - {{/oas3}} - {{^oas3}} + {{/swagger2AnnotationLibrary}} + {{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") - {{/oas3}} + {{/swagger1AnnotationLibrary}} public {{>nullableDataType}} {{getter}}() { return {{name}}; } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index a5b43b0e3b7..456dea2f400 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -43,6 +43,7 @@ import static java.util.stream.Collectors.groupingBy; import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.assertFileNotContains; import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; @@ -486,6 +487,7 @@ public class SpringCodegenTest { final SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary("spring-boot"); codegen.setDelegatePattern(true); + codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox"); final Map files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml"); @@ -687,6 +689,7 @@ public class SpringCodegenTest { SpringCodegen codegen = new SpringCodegen(); codegen.setOutputDir(output.getAbsolutePath()); codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox"); ClientOptInput input = new ClientOptInput(); input.openAPI(openAPI); @@ -800,6 +803,7 @@ public class SpringCodegenTest { Assert.assertEquals(codegen.importMapping().get("Pageable"), "org.springframework.data.domain.Pageable"); Assert.assertEquals(codegen.importMapping().get("DateTimeFormat"), "org.springframework.format.annotation.DateTimeFormat"); Assert.assertEquals(codegen.importMapping().get("ApiIgnore"), "springfox.documentation.annotations.ApiIgnore"); + Assert.assertEquals(codegen.importMapping().get("ParameterObject"), "org.springdoc.api.annotations.ParameterObject"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java new file mode 100644 index 00000000000..0954e79fb3a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/features/DocumentationProviderFeaturesTest.java @@ -0,0 +1,50 @@ +package org.openapitools.codegen.languages.features; + +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.stream.Collectors; +import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.AnnotationLibrary; +import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DocumentationProvider; +import org.testng.Assert; +import org.testng.annotations.Test; + +// Tests are not final, methods currently just generate documentation as MD tables. +public class DocumentationProviderFeaturesTest { + + @Test(priority = 0) + void generateDocumentationProviderTable() { + List providers = Arrays.asList(DocumentationProvider.values()); + StringBuilder sb = new StringBuilder(); + sb.append("### DocumentationProvider\n"); + sb.append("|Cli Option|Description|Property Name|Preferred Annotation Library|Supported Annotation Libraries|\n"); + sb.append("|----------|-----------|-------------|----------------------------|------------------------------|\n"); + providers.forEach(dp -> sb.append(String.format(Locale.ROOT, "|**%s**|%s|`%s`|%s|%s|\n", + dp.toCliOptValue(), + dp.getDescription(), + dp.getPropertyName(), + dp.getPreferredAnnotationLibrary().toCliOptValue(), + dp.supportedAnnotationLibraries().stream() + .map(AnnotationLibrary::toCliOptValue) + .collect(Collectors.joining(", ")) + ))); + sb.append("\n"); + Assert.assertTrue(sb.toString().contains("none")); + } + + @Test(priority = 1) + void generateAnnotationLibraryTable() { + List libraries = Arrays.asList(AnnotationLibrary.values()); + StringBuilder sb = new StringBuilder(); + sb.append("### AnnotationLibrary\n"); + sb.append("|Cli Option|Description|Property Name|\n"); + sb.append("|----------|-----------|-----------|\n"); + libraries.forEach(dp -> sb.append(String.format(Locale.ROOT, "|**%s**|%s|`%s`|\n", + dp.toCliOptValue(), + dp.getDescription(), + dp.getPropertyName() + ))); + Assert.assertTrue(sb.toString().contains("none")); + sb.append("\n"); + } +} \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/pom.xml b/samples/client/petstore/spring-cloud-async/pom.xml index 6b400a3539f..d542d02ebc7 100644 --- a/samples/client/petstore/spring-cloud-async/pom.xml +++ b/samples/client/petstore/spring-cloud-async/pom.xml @@ -9,7 +9,6 @@ 1.8 ${java.version} ${java.version} - 1.6.3 2.9.2 diff --git a/samples/client/petstore/spring-cloud-date-time/pom.xml b/samples/client/petstore/spring-cloud-date-time/pom.xml index c01b2969fb3..36fac629b8d 100644 --- a/samples/client/petstore/spring-cloud-date-time/pom.xml +++ b/samples/client/petstore/spring-cloud-date-time/pom.xml @@ -9,7 +9,6 @@ 1.8 ${java.version} ${java.version} - 1.6.3 2.9.2 diff --git a/samples/client/petstore/spring-cloud-spring-pageable/pom.xml b/samples/client/petstore/spring-cloud-spring-pageable/pom.xml index 622e4334036..d6f807b454e 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/pom.xml +++ b/samples/client/petstore/spring-cloud-spring-pageable/pom.xml @@ -9,7 +9,6 @@ 1.8 ${java.version} ${java.version} - 1.6.3 2.9.2 diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index 6b400a3539f..d542d02ebc7 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -9,7 +9,6 @@ 1.8 ${java.version} ${java.version} - 1.6.3 2.9.2 diff --git a/samples/openapi3/client/petstore/spring-cloud-async/pom.xml b/samples/openapi3/client/petstore/spring-cloud-async/pom.xml index 950b9bbe353..d236e452710 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-async/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot @@ -33,10 +33,11 @@ + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml b/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml index 9f8de9c14cd..cd2a2017c6c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot @@ -33,10 +33,11 @@ + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml index 6cf023f501f..899cb60d2d7 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot @@ -33,10 +33,11 @@ + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml index 648e8d7f995..933cfb2a5ff 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot @@ -33,10 +33,11 @@ + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 4ae25d24dfb..1a58d97ea6c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -7,6 +7,7 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; import org.springframework.data.domain.Pageable; +import org.springdoc.api.annotations.ParameterObject; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; import io.swagger.v3.oas.annotations.Operation; @@ -119,7 +120,7 @@ public interface PetApi { ) ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status, - final Pageable pageable + @ParameterObject final Pageable pageable ); @@ -151,7 +152,7 @@ public interface PetApi { ) ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags, - final Pageable pageable + @ParameterObject final Pageable pageable ); diff --git a/samples/openapi3/client/petstore/spring-cloud/pom.xml b/samples/openapi3/client/petstore/spring-cloud/pom.xml index 6cf023f501f..899cb60d2d7 100644 --- a/samples/openapi3/client/petstore/spring-cloud/pom.xml +++ b/samples/openapi3/client/petstore/spring-cloud/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot @@ -33,10 +33,11 @@ + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml index 5e1f049caf4..b2890ab9d51 100644 --- a/samples/openapi3/client/petstore/spring-stubs/pom.xml +++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml @@ -9,12 +9,12 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -28,10 +28,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator-ignore b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/.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/server/petstore/spring-boot-springdoc/.openapi-generator/FILES b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES new file mode 100644 index 00000000000..7de4a0d86c0 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES @@ -0,0 +1,20 @@ +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java +src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/VERSION b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/README.md b/samples/openapi3/server/petstore/spring-boot-springdoc/README.md new file mode 100644 index 00000000000..5bbe4a495d9 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/README.md @@ -0,0 +1,16 @@ +# OpenAPI generated server + +Spring Boot Server + + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/ + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml new file mode 100644 index 00000000000..8cc169faddd --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + org.openapitools.openapi3 + spring-boot-springdoc + jar + spring-boot-springdoc + 1.0.0-SNAPSHOT + + 1.8 + ${java.version} + ${java.version} + 1.6.4 + + + org.springframework.boot + spring-boot-starter-parent + 2.6.2 + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java new file mode 100644 index 00000000000..cb088f45193 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -0,0 +1,63 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@SpringBootApplication +@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}) +public class OpenAPI2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(OpenAPI2SpringBoot.class).run(args); + } + + static class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } + + @Bean + public WebMvcConfigurer webConfigurer() { + return new WebMvcConfigurer() { + /*@Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("*") + .allowedHeaders("Content-Type"); + }*/ + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); + } + }; + } + + @Bean + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/RFC3339DateFormat.java new file mode 100644 index 00000000000..bcd3936d8b3 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 00000000000..1245b1dd0cc --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,19 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 00000000000..f27571c387b --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,393 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "pet", description = "the pet API") +public interface PetApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /pet : Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid input (status code 405) + */ + @Operation( + operationId = "addPet", + summary = "Add a new pet to the store", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet", + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" } + ) + default ResponseEntity addPet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + */ + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid pet value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/pet/{petId}" + ) + default ResponseEntity deletePet( + @Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /pet/findByStatus : 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 successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @Operation( + operationId = "findPetsByStatus", + summary = "Finds Pets by status", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid status value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByStatus", + produces = { "application/xml", "application/json" } + ) + default ResponseEntity> findPetsByStatus( + @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /pet/findByTags : 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 successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Operation( + operationId = "findPetsByTags", + summary = "Finds Pets by tags", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid tag value") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/findByTags", + produces = { "application/xml", "application/json" } + ) + default ResponseEntity> findPetsByTags( + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + @Operation( + operationId = "getPetById", + summary = "Find pet by ID", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/pet/{petId}", + produces = { "application/xml", "application/json" } + ) + default ResponseEntity getPetById( + @Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /pet : Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Pet not found"), + @ApiResponse(responseCode = "405", description = "Validation exception") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/pet", + produces = { "application/xml", "application/json" }, + consumes = { "application/json", "application/xml" } + ) + default ResponseEntity updatePet( + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet pet + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 doggie aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /pet/{petId} : 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 Invalid input (status code 405) + */ + @Operation( + operationId = "updatePetWithForm", + summary = "Updates a pet in the store with form data", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input") + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}", + consumes = { "application/x-www-form-urlencoded" } + ) + default ResponseEntity updatePetWithForm( + @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @Valid @RequestPart(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /pet/{petId}/uploadImage : 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 successful operation (status code 200) + */ + @Operation( + operationId = "uploadFile", + summary = "uploads an image", + tags = { "pet" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))) + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/pet/{petId}/uploadImage", + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + default ResponseEntity uploadFile( + @Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java new file mode 100644 index 00000000000..4ad9ef06158 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java @@ -0,0 +1,27 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class PetApiController implements PetApi { + + private final NativeWebRequest request; + + @Autowired + public PetApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 00000000000..04b786a8ba4 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,190 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "store", description = "the store API") +public interface StoreApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * DELETE /store/order/{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 Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "deleteOrder", + summary = "Delete purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/store/order/{orderId}" + ) + default ResponseEntity deleteOrder( + @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "getInventory", + summary = "Returns pet inventories by status", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))) + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/inventory", + produces = { "application/json" } + ) + default ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /store/order/{orderId} : 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 successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @Operation( + operationId = "getOrderById", + summary = "Find purchase order by ID", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/store/order/{orderId}", + produces = { "application/xml", "application/json" } + ) + default ResponseEntity getOrderById( + @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /store/order : Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @Operation( + operationId = "placeOrder", + summary = "Place an order for a pet", + tags = { "store" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/store/order", + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity placeOrder( + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order order + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java new file mode 100644 index 00000000000..293d3035f80 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java @@ -0,0 +1,27 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class StoreApiController implements StoreApi { + + private final NativeWebRequest request; + + @Autowired + public StoreApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..3268f2475c0 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,304 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "user", description = "the user API") +public interface UserApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUser", + summary = "Create user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user", + consumes = { "application/json" } + ) + default ResponseEntity createUser( + @Parameter(name = "User", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithArrayInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithArray", + consumes = { "application/json" } + ) + default ResponseEntity createUsersWithArrayInput( + @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param user List of user object (required) + * @return successful operation (status code 200) + */ + @Operation( + operationId = "createUsersWithListInput", + summary = "Creates list of users with given input array", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/user/createWithList", + consumes = { "application/json" } + ) + default ResponseEntity createUsersWithListInput( + @Parameter(name = "User", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "deleteUser", + summary = "Delete user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/user/{username}" + ) + default ResponseEntity deleteUser( + @Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "getUserByName", + summary = "Get user by user name", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/{username}", + produces = { "application/xml", "application/json" } + ) + default ResponseEntity getUserByName( + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @Operation( + operationId = "loginUser", + summary = "Logs user into the system", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/login", + produces = { "application/xml", "application/json" } + ) + default ResponseEntity loginUser( + @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + */ + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/user/logout" + ) + default ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + /** + * PUT /user/{username} : 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 Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @Operation( + operationId = "updateUser", + summary = "Updated user", + tags = { "user" }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "api_key") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/user/{username}", + consumes = { "application/json" } + ) + default ResponseEntity updateUser( + @Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username, + @Parameter(name = "User", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User user + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java new file mode 100644 index 00000000000..aab4767a50d --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java @@ -0,0 +1,27 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class UserApiController implements UserApi { + + private final NativeWebRequest request; + + @Autowired + public UserApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 00000000000..61d4ebb3183 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,53 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Controller; +import org.springframework.util.StreamUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + private static YAMLMapper yamlMapper = new YAMLMapper(); + + @Value("classpath:/openapi.yaml") + private Resource openapi; + + @Bean + public String openapiContent() throws IOException { + try(InputStream is = openapi.getInputStream()) { + return StreamUtils.copyToString(is, Charset.defaultCharset()); + } + } + + @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") + @ResponseBody + public String openapiYaml() throws IOException { + return openapiContent(); + } + + @GetMapping(value = "/openapi.json", produces = "application/json") + @ResponseBody + public Object openapiJson() throws IOException { + return yamlMapper.readValue(openapiContent(), Object.class); + } + + @RequestMapping("/") + public String index() { + return "redirect:swagger-ui/index.html?url=../openapi.json"; + } + + +} diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..823adb2ae4d --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A category for a pet + */ + +@Schema(name = "Category", description = "A category for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Category { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..ea4f1e40264 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,132 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Describes the result of uploading an image resource + */ + +@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ModelApiResponse { + + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @Schema(name = "code", required = false) + 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 + */ + + @Schema(name = "type", required = false) + 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 + */ + + @Schema(name = "message", required = false) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..e624a0d7c1f --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,245 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * An order for a pets from the pet store + */ + +@Schema(name = "Order", description = "An order for a pets from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Order { + + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + 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 + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "petId", required = false) + 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 + */ + + @Schema(name = "quantity", required = false) + 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 + */ + @Valid + @Schema(name = "shipDate", required = false) + 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 + */ + + @Schema(name = "status", description = "Order Status", required = false) + 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 + */ + + @Schema(name = "complete", required = false) + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..ddff66759ba --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,261 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A pet for sale in the pet store + */ + +@Schema(name = "Pet", description = "A pet for sale in the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Pet { + + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private Category category; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private List photoUrls = new ArrayList<>(); + + @JsonProperty("tags") + @Valid + 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 + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + @Valid + @Schema(name = "category", required = false) + 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 + */ + @NotNull + @Schema(name = "name", example = "doggie", required = true) + 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 + */ + @NotNull + @Schema(name = "photoUrls", required = true) + 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 + */ + @Valid + @Schema(name = "tags", required = false) + 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 + */ + + @Schema(name = "status", description = "pet status in the store", required = false) + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..5c3ac82ba6e --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,108 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A tag for a pet + */ + +@Schema(name = "Tag", description = "A tag for a pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class Tag { + + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "name", required = false) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..328569672eb --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,252 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * A User who is purchasing from the pet store + */ + +@Schema(name = "User", description = "A User who is purchasing from the pet store") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class User { + + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @Schema(name = "id", required = false) + 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 + */ + + @Schema(name = "username", required = false) + 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 + */ + + @Schema(name = "firstName", required = false) + 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 + */ + + @Schema(name = "lastName", required = false) + 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 + */ + + @Schema(name = "email", required = false) + 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 + */ + + @Schema(name = "password", required = false) + 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 + */ + + @Schema(name = "phone", required = false) + 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 + */ + + @Schema(name = "userStatus", description = "User Status", required = false) + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/application.properties b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/application.properties new file mode 100644 index 00000000000..7e90813e59b --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.port=8080 +spring.jackson.date-format=org.openapitools.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml new file mode 100644 index 00000000000..56703dfefb5 --- /dev/null +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/resources/openapi.yaml @@ -0,0 +1,893 @@ +openapi: 3.0.0 +info: + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io +servers: +- url: http://petstore.swagger.io/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + put: + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + 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 + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + 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: + - petstore_auth: + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /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: + - petstore_auth: + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + 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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: pet + /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 + x-tags: + - tag: store + /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 + x-tags: + - tag: store + /store/order/{orderId}: + 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: orderId + 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 + x-tags: + - tag: store + 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: orderId + 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 + x-tags: + - tag: store + /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 + security: + - api_key: [] + summary: Create user + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + 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: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple + 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 + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /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 + security: + - api_key: [] + summary: Delete user + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + 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 + x-tags: + - tag: user + 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 + security: + - api_key: [] + summary: Updated user + tags: + - user + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: user +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + 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' + schemas: + Order: + description: An order for a pets from the pet store + 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 + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: + format: int64 + type: integer + name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ + type: string + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + 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 + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + 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: + deprecated: true + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + 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 + 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 diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index 737d7740cd5..d6ebd909ee8 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -9,12 +9,12 @@ 1.7 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c04dd3bba6..cac2bbc73b8 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index 29b8c0d8176..7081ba1a430 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index aaed20e877f..c28517ba229 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 5b4cc8611ca..97a3ec705b7 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index 5d9974b5691..9b0ba8bd720 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 27741595f57..781b593f564 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java index 34bae16b898..61d4ebb3183 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,8 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; diff --git a/samples/openapi3/server/petstore/springboot-delegate/pom.xml b/samples/openapi3/server/petstore/springboot-delegate/pom.xml index 35758ea6496..8edd9579ef5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/pom.xml +++ b/samples/openapi3/server/petstore/springboot-delegate/pom.xml @@ -9,12 +9,12 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java index 34bae16b898..61d4ebb3183 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,8 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml index 1034cd0499d..7759fcc3928 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml @@ -9,12 +9,12 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java index 34bae16b898..61d4ebb3183 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,8 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; diff --git a/samples/openapi3/server/petstore/springboot-reactive/pom.xml b/samples/openapi3/server/petstore/springboot-reactive/pom.xml index a6268c2794f..098af25f183 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/pom.xml +++ b/samples/openapi3/server/petstore/springboot-reactive/pom.xml @@ -9,12 +9,12 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java index b1e5bfc21ee..fadcaeb03c6 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,14 +1,15 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.context.annotation.Bean; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerResponse; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml index 800e0576cb5..975547fc709 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml +++ b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml @@ -9,12 +9,12 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java index 34bae16b898..61d4ebb3183 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,8 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; diff --git a/samples/openapi3/server/petstore/springboot/pom.xml b/samples/openapi3/server/petstore/springboot/pom.xml index d0efb3028ce..4320644df2c 100644 --- a/samples/openapi3/server/petstore/springboot/pom.xml +++ b/samples/openapi3/server/petstore/springboot/pom.xml @@ -9,12 +9,12 @@ 1.8 ${java.version} ${java.version} - 2.1.11 + 1.6.4 org.springframework.boot spring-boot-starter-parent - 2.5.8 + 2.6.2 src/main/java @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger.core.v3 - swagger-annotations - ${swagger-core-version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java index 34bae16b898..61d4ebb3183 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,8 +1,8 @@ package org.openapitools.configuration; +import org.springframework.context.annotation.Bean; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c9ae29ba1fe..ec8ea57868a 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java index aa5e668384e..4bac5c6a4d4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e1119b1010d..64dd84c74f4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index ba115c2cd0a..8c66ba7d8b5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -4,7 +4,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; import java.util.Set; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index d25fe52ea15..021d8d71835 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,7 +2,6 @@ package org.openapitools.api; import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index af6939bbb16..e7253850462 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -3,7 +3,6 @@ package org.openapitools.api; import java.util.List; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-reactive/README.md b/samples/server/petstore/springboot-reactive/README.md index 55dc732c1b0..b890fea0936 100644 --- a/samples/server/petstore/springboot-reactive/README.md +++ b/samples/server/petstore/springboot-reactive/README.md @@ -8,6 +8,8 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. +The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) + Start your server as a simple java application Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index 6f5e06c6e29..d543d710035 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 1.6.3 + 2.9.2 org.springframework.boot @@ -34,10 +34,11 @@ org.springframework.data spring-data-commons + - io.swagger - swagger-annotations - ${swagger-core-version} + io.springfox + springfox-swagger2 + ${springfox.version} diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java index 254af022514..a7a2c4e7dc4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java @@ -9,7 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.web.reactive.config.CorsRegistry; -import org.springframework.web.reactive.config.ResourceHandlerRegistry; import org.springframework.web.reactive.config.WebFluxConfigurer; @SpringBootApplication @@ -47,11 +46,6 @@ public class OpenAPI2SpringBoot implements CommandLineRunner { .allowedMethods("*") .allowedHeaders("Content-Type"); }*/ - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/"); - } }; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 0f78f294433..de9aadfd570 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; @@ -56,7 +57,7 @@ public interface AnotherFakeApi { ) default Mono> call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().call123testSpecialTags(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 575a4e23910..c05f795e57b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 5471ba1820d..61bd43b6a67 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import java.math.BigDecimal; import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; @@ -65,7 +66,7 @@ public interface FakeApi { ) default Mono> createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().createXmlItem(xmlItem, exchange); } @@ -95,7 +96,7 @@ public interface FakeApi { ) default Mono> fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().fakeOuterBooleanSerialize(body, exchange); } @@ -125,7 +126,7 @@ public interface FakeApi { ) default Mono> fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().fakeOuterCompositeSerialize(body, exchange); } @@ -155,7 +156,7 @@ public interface FakeApi { ) default Mono> fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().fakeOuterNumberSerialize(body, exchange); } @@ -185,7 +186,7 @@ public interface FakeApi { ) default Mono> fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().fakeOuterStringSerialize(body, exchange); } @@ -214,7 +215,7 @@ public interface FakeApi { ) default Mono> testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testBodyWithFileSchema(body, exchange); } @@ -244,7 +245,7 @@ public interface FakeApi { default Mono> testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testBodyWithQueryParams(query, body, exchange); } @@ -275,7 +276,7 @@ public interface FakeApi { ) default Mono> testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testClientModel(body, exchange); } @@ -335,7 +336,7 @@ public interface FakeApi { @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password, @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); } @@ -380,7 +381,7 @@ public interface FakeApi { @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); } @@ -418,7 +419,7 @@ public interface FakeApi { @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); } @@ -446,7 +447,7 @@ public interface FakeApi { ) default Mono> testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> param, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testInlineAdditionalProperties(param, exchange); } @@ -476,7 +477,7 @@ public interface FakeApi { default Mono> testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testJsonFormData(param, param2, exchange); } @@ -512,7 +513,7 @@ public interface FakeApi { @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); } @@ -552,7 +553,7 @@ public interface FakeApi { @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 0193067433b..f6d86d18abc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import java.math.BigDecimal; import org.openapitools.model.Client; import org.springframework.format.annotation.DateTimeFormat; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6a78bd00fe9..a693af64814 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; @@ -59,7 +60,7 @@ public interface FakeClassnameTestApi { ) default Mono> testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testClassname(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index bd1f7f3542f..527bedeecf9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 4277d5fc01b..21c34a69aea 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; @@ -64,7 +65,7 @@ public interface PetApi { ) default Mono> addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().addPet(body, exchange); } @@ -101,7 +102,7 @@ public interface PetApi { default Mono> deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().deletePet(petId, apiKey, exchange); } @@ -140,7 +141,7 @@ public interface PetApi { ) default Mono>> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().findPetsByStatus(status, exchange); } @@ -180,7 +181,7 @@ public interface PetApi { ) default Mono>> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().findPetsByTags(tags, exchange); } @@ -217,7 +218,7 @@ public interface PetApi { ) default Mono> getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().getPetById(petId, exchange); } @@ -257,7 +258,7 @@ public interface PetApi { ) default Mono> updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().updatePet(body, exchange); } @@ -295,7 +296,7 @@ public interface PetApi { @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().updatePetWithForm(petId, name, status, exchange); } @@ -335,7 +336,7 @@ public interface PetApi { @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Flux file, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index b4c51ede918..abdf3efc621 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 6d31ec91832..c3aef13167e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; import org.openapitools.model.Order; import io.swagger.annotations.*; @@ -56,7 +57,7 @@ public interface StoreApi { ) default Mono> deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().deleteOrder(orderId, exchange); } @@ -88,7 +89,7 @@ public interface StoreApi { produces = { "application/json" } ) default Mono>> getInventory( - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().getInventory(exchange); } @@ -122,7 +123,7 @@ public interface StoreApi { ) default Mono> getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().getOrderById(orderId, exchange); } @@ -153,7 +154,7 @@ public interface StoreApi { ) default Mono> placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().placeOrder(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index d4f1e2efbf9..ecc745c202f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import java.util.Map; import org.openapitools.model.Order; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 923cedcc646..d2efdab9023 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -5,6 +5,7 @@ */ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; @@ -55,7 +56,7 @@ public interface UserApi { ) default Mono> createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().createUser(body, exchange); } @@ -82,7 +83,7 @@ public interface UserApi { ) default Mono> createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().createUsersWithArrayInput(body, exchange); } @@ -109,7 +110,7 @@ public interface UserApi { ) default Mono> createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().createUsersWithListInput(body, exchange); } @@ -139,7 +140,7 @@ public interface UserApi { ) default Mono> deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().deleteUser(username, exchange); } @@ -172,7 +173,7 @@ public interface UserApi { ) default Mono> getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().getUserByName(username, exchange); } @@ -205,7 +206,7 @@ public interface UserApi { default Mono> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().loginUser(username, password, exchange); } @@ -230,7 +231,7 @@ public interface UserApi { value = "/user/logout" ) default Mono> logoutUser( - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().logoutUser(exchange); } @@ -262,7 +263,7 @@ public interface UserApi { default Mono> updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono body, - final ServerWebExchange exchange + @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().updateUser(username, body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 063cd6d0ee8..3e561778a3e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java index b1e5bfc21ee..60a69461eb5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java @@ -1,21 +1,12 @@ package org.openapitools.configuration; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; -import org.springframework.util.StreamUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.context.annotation.Bean; import org.springframework.web.reactive.function.server.RouterFunction; import org.springframework.web.reactive.function.server.ServerResponse; -import java.io.IOException; -import java.io.InputStream; import java.net.URI; -import java.nio.charset.Charset; import static org.springframework.web.reactive.function.server.RequestPredicates.GET; import static org.springframework.web.reactive.function.server.RouterFunctions.route; @@ -26,35 +17,11 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r @Controller public class HomeController { - private static YAMLMapper yamlMapper = new YAMLMapper(); - - @Value("classpath:/openapi.yaml") - private Resource openapi; - - @Bean - public String openapiContent() throws IOException { - try(InputStream is = openapi.getInputStream()) { - return StreamUtils.copyToString(is, Charset.defaultCharset()); - } - } - - @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi") - @ResponseBody - public String openapiYaml() throws IOException { - return openapiContent(); - } - - @GetMapping(value = "/openapi.json", produces = "application/json") - @ResponseBody - public Object openapiJson() throws IOException { - return yamlMapper.readValue(openapiContent(), Object.class); - } - @Bean RouterFunction index() { return route( GET("/"), - req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui/index.html?url=../openapi.json")).build() + req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build() ); } diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/application.properties b/samples/server/petstore/springboot-reactive/src/main/resources/application.properties index 9d06609db66..ceca4a9e0d0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/application.properties +++ b/samples/server/petstore/springboot-reactive/src/main/resources/application.properties @@ -1,3 +1,4 @@ +springfox.documentation.swagger.v2.path=/api-docs server.port=80 spring.jackson.date-format=org.openapitools.RFC3339DateFormat spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 26b35dd8398..7ae394a6c74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 78cddbd6dd5..a9830bcc648 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 498a7ee2e45..477a1180d78 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 18e06dce43d..78913cd2534 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.openapitools.model.ModelApiResponse; import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 9cc8ee421f6..8fd7fe5fa87 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,7 +2,6 @@ package org.openapitools.api; import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 777032bef5d..3bc638dbeb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -3,7 +3,6 @@ package org.openapitools.api; import java.util.List; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c9ae29ba1fe..ec8ea57868a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index e0f6cf75c83..848fe0e982f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -12,7 +12,6 @@ import org.openapitools.model.OuterComposite; import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index e1119b1010d..64dd84c74f4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 139d599af04..8e3fd4cebff 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -5,7 +5,6 @@ import org.openapitools.model.ModelApiResponse; import org.springframework.data.domain.Pageable; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index d25fe52ea15..021d8d71835 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,7 +2,6 @@ package org.openapitools.api; import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index af6939bbb16..e7253850462 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -3,7 +3,6 @@ package org.openapitools.api; import java.util.List; import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; -import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; From d737aa5fb895b9a05934cdcbf86e6e8603997ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20F=C3=A4hnlein?= Date: Sat, 22 Jan 2022 01:59:43 +0100 Subject: [PATCH 072/113] Update GlobalConfiguration.mustache (#11359) [csharp-netcore] corrected visibility of GlobalConfiguration mustache --- .../resources/csharp-netcore/GlobalConfiguration.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/GlobalConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/GlobalConfiguration.mustache index bdfa4b99cc1..93a9ab8aa2c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/GlobalConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/GlobalConfiguration.mustache @@ -12,7 +12,7 @@ namespace {{packageName}}.Client /// A customized implementation via partial class may reside in another file and may /// be excluded from automatic generation via a .openapi-generator-ignore file. /// - public partial class GlobalConfiguration : Configuration + {{>visibility}} partial class GlobalConfiguration : Configuration { #region Private Members @@ -56,4 +56,4 @@ namespace {{packageName}}.Client } } } -} \ No newline at end of file +} From e0bde821315732fde96020b95d1d3a09780c6c8d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 22 Jan 2022 09:03:50 +0800 Subject: [PATCH 073/113] update samples --- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/GlobalConfiguration.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index c3b9ba0c212..e16e13b6070 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 4bc467ffa40..cbee70bca37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 4bc467ffa40..cbee70bca37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 4bc467ffa40..cbee70bca37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 4bc467ffa40..cbee70bca37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 4bc467ffa40..cbee70bca37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 4bc467ffa40..cbee70bca37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index e1c00c89a03..add21c02cd1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -64,4 +64,4 @@ namespace Org.OpenAPITools.Client } } } -} \ No newline at end of file +} From 0358d6eb71e7ff4bb9c4db0d2fe52f56ad7397ba Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 22 Jan 2022 09:47:15 +0800 Subject: [PATCH 074/113] update api tests to work with nonPublicApi option (#11376) --- .../src/main/resources/csharp-netcore/api_test.mustache | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache index 3f2f1de5bb3..78319978ac0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache @@ -28,11 +28,15 @@ namespace {{packageName}}.Test.Api /// public class {{classname}}Tests : IDisposable { + {{^nonPublicApi}} private {{classname}} instance; + {{/nonPublicApi}} public {{classname}}Tests() { + {{^nonPublicApi}} instance = new {{classname}}(); + {{/nonPublicApi}} } public void Dispose() From 938cc36d1b2ddcc100977cbf367f7fd9ebe2b7e4 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 22 Jan 2022 10:18:20 +0800 Subject: [PATCH 075/113] update node-fetch to newer version (#11378) --- .../Javascript-Flowtyped/package.mustache | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/javascript-flowtyped/lib/api.js | 2 +- .../javascript-flowtyped/package-lock.json | 5597 ++++------------- .../javascript-flowtyped/package.json | 2 +- 5 files changed, 1397 insertions(+), 4208 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache index a4552cdc5fb..6a1cfec3179 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache @@ -24,7 +24,7 @@ }, {{/npmRepository}} "dependencies": { - "node-fetch": ">=2.6.1", + "node-fetch": ">=3.1.1", "portable-fetch": "^3.0.0" }, "devDependencies": { diff --git a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION index 4b448de535c..0984c4c1ad2 100644 --- a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-flowtyped/lib/api.js b/samples/client/petstore/javascript-flowtyped/lib/api.js index d1896d86781..eca41f9154b 100644 --- a/samples/client/petstore/javascript-flowtyped/lib/api.js +++ b/samples/client/petstore/javascript-flowtyped/lib/api.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserApi = exports.UserApiFetchParamCreator = exports.StoreApi = exports.StoreApiFetchParamCreator = exports.PetApi = exports.PetApiFetchParamCreator = exports.RequiredError = exports.COLLECTION_FORMATS = void 0; +exports.UserApiFetchParamCreator = exports.UserApi = exports.StoreApiFetchParamCreator = exports.StoreApi = exports.RequiredError = exports.PetApiFetchParamCreator = exports.PetApi = exports.COLLECTION_FORMATS = void 0; var url = _interopRequireWildcard(require("url")); diff --git a/samples/client/petstore/javascript-flowtyped/package-lock.json b/samples/client/petstore/javascript-flowtyped/package-lock.json index 335a4fecf8b..0384e828482 100644 --- a/samples/client/petstore/javascript-flowtyped/package-lock.json +++ b/samples/client/petstore/javascript-flowtyped/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "Unlicense", "dependencies": { - "node-fetch": ">=2.6.1", + "node-fetch": ">=3.1.1", "portable-fetch": "^3.0.0" }, "devDependencies": { @@ -24,13 +24,11 @@ } }, "node_modules/@babel/cli": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.14.8.tgz", - "integrity": "sha512-lcy6Lymft9Rpfqmrqdd4oTDdUx9ZwaAhAfywVrHG4771Pa6PPT0danJ1kDHBXYqh4HHSmIdA+nlmfxfxSDPtBg==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.8.tgz", + "integrity": "sha512-FTKBbxyk5TclXOGmwYyqelqP5IF6hMxaeJskd85jbR5jBfYlwqgwAbJwnixi1ZBbTqKfFuAA95mdmUFeSRwyJA==", "dev": true, "dependencies": { - "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.2", - "chokidar": "^3.4.0", "commander": "^4.0.1", "convert-source-map": "^1.1.0", "fs-readdir-recursive": "^1.1.0", @@ -47,7 +45,7 @@ "node": ">=6.9.0" }, "optionalDependencies": { - "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.2", + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", "chokidar": "^3.4.0" }, "peerDependencies": { @@ -55,41 +53,41 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "dependencies": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", - "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", + "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.0.tgz", - "integrity": "sha512-tXtmTminrze5HEUPn/a0JtOzzfp0nk+UEXQ/tqIJo3WDGypl/2OFQEMll/zSFU8f/lfmfLXvTaORHF3cfXIQMw==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.10.tgz", + "integrity": "sha512-pbiIdZbCiMx/MM6toR+OfXarYix3uz0oVsnNtfdAGTcCTu3w/JGF8JhirevXLBJUu0WguSZI12qpKnx7EeMyLA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.0", - "@babel/helper-compilation-targets": "^7.15.0", - "@babel/helper-module-transforms": "^7.15.0", - "@babel/helpers": "^7.14.8", - "@babel/parser": "^7.15.0", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.10", + "@babel/types": "^7.16.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -106,12 +104,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.0.tgz", - "integrity": "sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", "dev": true, "dependencies": { - "@babel/types": "^7.15.0", + "@babel/types": "^7.16.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -120,39 +118,39 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz", - "integrity": "sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz", - "integrity": "sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", + "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", "dev": true, "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-explode-assignable-expression": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.0.tgz", - "integrity": "sha512-h+/9t0ncd4jfZ8wsdAsoIxSa61qhBYlycXiHWqJaQBCXAhDCMbPRSMTGnZIkkmt1u4ag+UQmuqcILwqKzZ4N2A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.15.0", - "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", "semver": "^6.3.0" }, "engines": { @@ -163,17 +161,18 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.0.tgz", - "integrity": "sha512-MdmDXgvTIi4heDVX/e9EFfeGpugqm9fobBVg/iioE8kueXrOHdRDe36FAY7SnE9xXLVeYCoJR/gdrBEIHRC83Q==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.10.tgz", + "integrity": "sha512-wDeej0pu3WN/ffTxMNCPW5UCiOav8IcLRxSIyp/9+IF2xJUM9h/OYjg0IJLHaL6F8oU8kqMz9nc1vryXhMsgXg==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-member-expression-to-functions": "^7.15.0", - "@babel/helper-optimise-call-expression": "^7.14.5", - "@babel/helper-replace-supers": "^7.15.0", - "@babel/helper-split-export-declaration": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -183,12 +182,12 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz", - "integrity": "sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.7.tgz", + "integrity": "sha512-fk5A6ymfp+O5+p2yCkXAu5Kyj6v0xh0RBeNcAkYUMDvvAAoxvSKXn+Jb37t/yWFiQVDFK1ELpUTD8/aLhCPu+g==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-annotate-as-pure": "^7.16.7", "regexpu-core": "^4.7.1" }, "engines": { @@ -199,251 +198,264 @@ } }, "node_modules/@babel/helper-define-map": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.14.5.tgz", - "integrity": "sha512-spfQRnoChdYWwyFetQDBSDBgH42VskaquRI52kbLei5MjV7s3NPq30/sh2S3YdT20Ku/ZpaNnTVgmDo20NWylg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.16.7.tgz", + "integrity": "sha512-SoIOh18NdeBBQjiLF1H32jpDLkApTbUWwEXmqaxn1KEm7aqry4reaghMdCdkbdloVmMwUxM/uCcTmHWj9zJbxQ==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-function-name": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz", - "integrity": "sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", + "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", - "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.14.5", - "@babel/template": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-get-function-arity": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", - "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz", - "integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.0.tgz", - "integrity": "sha512-Jq8H8U2kYiafuj2xMTPQwkTBnEEdGKpT35lJEQsRRjnG0LW3neucsaMWLgKcwu3OHKNeYugfw+Z20BXBSEs2Lg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", + "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", "dev": true, "dependencies": { - "@babel/types": "^7.15.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz", - "integrity": "sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.0.tgz", - "integrity": "sha512-RkGiW5Rer7fpXv9m1B3iHIFDZdItnO2/BLfWVW/9q7+KqQSDY5kUfQEbzdXM1MVhJGcugKV7kRrNVzNxmk7NBg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-replace-supers": "^7.15.0", - "@babel/helper-simple-access": "^7.14.8", - "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.9", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz", - "integrity": "sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", - "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz", - "integrity": "sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", + "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-wrap-function": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-wrap-function": "^7.16.8", + "@babel/types": "^7.16.8" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.0.tgz", - "integrity": "sha512-6O+eWrhx+HEra/uJnifCwhwMd6Bp5+ZfZeJwbqUTuqkhIT6YcRhiZCOOFChRypOIe0cV46kFrRBlm+t5vHCEaA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", "dev": true, "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.15.0", - "@babel/helper-optimise-call-expression": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", - "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dev": true, "dependencies": { - "@babel/types": "^7.14.8" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz", - "integrity": "sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", - "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz", - "integrity": "sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", + "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.14.5", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-function-name": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.8", + "@babel/types": "^7.16.8" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.3.tgz", - "integrity": "sha512-HwJiz52XaS96lX+28Tnbu31VeFSQJGOeKHJeaEPQlTl7PnlhFElWPj8tUXtqFIzeN86XxXoBr+WFAyK2PPVz6g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "dev": true, "dependencies": { - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -452,9 +464,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.3.tgz", - "integrity": "sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.10.tgz", + "integrity": "sha512-Sm/S9Or6nN8uiFsQU1yodyDW3MWXQhFeqzMPM+t8MJjM+pLsnFVxFZzkpXKvUXh+Gz9cbMoYYs484+Jw/NTEFQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -464,13 +476,13 @@ } }, "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.9.tgz", - "integrity": "sha512-d1lnh+ZnKrFKwtTYdw320+sQWCTwgkB9fmUhNXRADA4akR6wLjaruSGnIEUjpt9HCOwTr4ynFTKu19b7rFRpmw==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", + "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8", "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { @@ -508,12 +520,12 @@ } }, "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz", - "integrity": "sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", + "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-json-strings": "^7.8.3" }, "engines": { @@ -537,12 +549,12 @@ } }, "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz", - "integrity": "sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", + "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" }, "engines": { @@ -553,13 +565,13 @@ } }, "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz", - "integrity": "sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", + "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=4" @@ -581,12 +593,12 @@ } }, "node_modules/@babel/plugin-syntax-decorators": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.14.5.tgz", - "integrity": "sha512-c4sZMRWL4GSvP1EXy0woIP7m4jkVcEuG8R1TOZxPBPtp4FSM/kiPZub9UIs/Jrb5ZAOzvTUSGYrWsrSu1JvoPw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.16.7.tgz", + "integrity": "sha512-vQ+PxL+srA7g6Rx6I1e15m55gftknl2X8GCUW1JTlkTaXZLJOS0UcaY0eK9jYT7IYf4awn6qwyghVHLDz1WyMw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -608,12 +620,12 @@ } }, "node_modules/@babel/plugin-syntax-flow": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz", - "integrity": "sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.7.tgz", + "integrity": "sha512-UDo3YGQO0jH6ytzVwgSLv9i/CzMcUjbKenL67dTrAZPPv6GFAtDhe6jqnvmoKzC/7htNTohhos+onPtDMqJwaQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -635,12 +647,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz", - "integrity": "sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz", + "integrity": "sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -674,12 +686,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz", - "integrity": "sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", + "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -689,12 +701,12 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz", - "integrity": "sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", + "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -704,14 +716,14 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz", - "integrity": "sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", + "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.14.5" + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8" }, "engines": { "node": ">=6.9.0" @@ -721,12 +733,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz", - "integrity": "sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", + "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -736,12 +748,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz", - "integrity": "sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", + "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -770,12 +782,12 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz", - "integrity": "sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", + "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -797,13 +809,13 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz", - "integrity": "sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", + "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -813,12 +825,12 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz", - "integrity": "sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", + "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -828,13 +840,13 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz", - "integrity": "sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", + "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -844,13 +856,13 @@ } }, "node_modules/@babel/plugin-transform-flow-strip-types": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz", - "integrity": "sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.16.7.tgz", + "integrity": "sha512-mzmCq3cNsDpZZu9FADYYyfZJIOrSONmHcop2XEKPdBNMa4PDC4eEvcOvzZaCNcjKu72v0XQlA5y1g58aLRXdYg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-flow": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-flow": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -860,12 +872,12 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz", - "integrity": "sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", + "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -875,13 +887,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz", - "integrity": "sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", + "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -891,12 +904,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz", - "integrity": "sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", + "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -906,13 +919,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz", - "integrity": "sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", + "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "engines": { @@ -932,14 +945,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.0.tgz", - "integrity": "sha512-3H/R9s8cXcOGE8kgMlmjYYC9nqr5ELiPkJn4q0mypBrjhYQoc+5/Maq69vV4xRPWnkzZuwJPf5rArxpB/35Cig==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz", + "integrity": "sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.15.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-simple-access": "^7.14.8", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "engines": { @@ -959,15 +972,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz", - "integrity": "sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", + "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "engines": { @@ -987,13 +1000,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz", - "integrity": "sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", + "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1003,12 +1016,12 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz", - "integrity": "sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", + "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1018,12 +1031,12 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz", - "integrity": "sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", + "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1033,13 +1046,13 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz", - "integrity": "sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", + "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1049,12 +1062,12 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz", - "integrity": "sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", + "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1089,16 +1102,16 @@ } }, "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.9.tgz", - "integrity": "sha512-30PeETvS+AeD1f58i1OVyoDlVYQhap/K20ZrMjLmmzmC2AYR/G43D4sdJAaDAqCD3MYpSWbmrz3kES158QSLjw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.7.tgz", + "integrity": "sha512-8D16ye66fxiE8m890w0BpPpngG9o9OVBBy0gH2E+2AR7qMR2ZpTYJEqLxAsoroenMId0p/wMW+Blc0meDgu0Ag==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-jsx": "^7.14.5", - "@babel/types": "^7.14.9" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1108,12 +1121,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.14.9.tgz", - "integrity": "sha512-Fqqu0f8zv9W+RyOnx29BX/RlEsBRANbOf5xs5oxb2aHP4FKbLXxIaVPUiCti56LAR1IixMH4EyaixhUsKqoBHw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.16.7.tgz", + "integrity": "sha512-oe5VuWs7J9ilH3BCCApGoYjHoSO48vkjX2CbA5bFVhIuO2HKxA3vyF7rleA4o6/4rTDbk6r8hBW7Ul8E+UZrpA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1123,12 +1136,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.14.5.tgz", - "integrity": "sha512-1TpSDnD9XR/rQ2tzunBVPThF5poaYT9GqP+of8fAtguYuI/dm2RkrMBDemsxtY0XBzvW7nXjYM0hRyKX9QYj7Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.16.7.tgz", + "integrity": "sha512-rONFiQz9vgbsnaMtQlZCjIRwhJvlrPET8TabIUK2hzlXw9B9s2Ieaxte1SCOOXMbWRHodbKixNf3BLcWVOQ8Bw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1138,9 +1151,9 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz", - "integrity": "sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", + "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", "dev": true, "dependencies": { "regenerator-transform": "^0.14.2" @@ -1177,12 +1190,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz", - "integrity": "sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", + "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1192,13 +1205,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz", - "integrity": "sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", + "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" }, "engines": { "node": ">=6.9.0" @@ -1208,12 +1221,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz", - "integrity": "sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", + "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1223,12 +1236,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz", - "integrity": "sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", + "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1238,12 +1251,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz", - "integrity": "sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", + "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1253,14 +1266,14 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.15.0.tgz", - "integrity": "sha512-WIIEazmngMEEHDaPTx0IZY48SaAmjVWe3TRSX7cmJXn0bEv9midFzAjxiruOWYIVf5iQ10vFx7ASDpgEO08L5w==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz", + "integrity": "sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.15.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-typescript": "^7.14.5" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-typescript": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1270,13 +1283,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz", - "integrity": "sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", + "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1349,14 +1362,14 @@ } }, "node_modules/@babel/preset-flow": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.14.5.tgz", - "integrity": "sha512-pP5QEb4qRUSVGzzKx9xqRuHUrM/jEzMqdrZpdMA+oUCRgd5zM1qGr5y5+ZgAL/1tVv1H0dyk5t4SKJntqyiVtg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.16.7.tgz", + "integrity": "sha512-6ceP7IyZdUYQ3wUVqyRSQXztd1YmFHWI4Xv11MIqAlE4WqxBSd/FZ61V9k+TS5Gd4mkHOtQtPp9ymRpxH4y1Ug==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-transform-flow-strip-types": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-option": "^7.16.7", + "@babel/plugin-transform-flow-strip-types": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1404,32 +1417,33 @@ } }, "node_modules/@babel/template": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", - "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.0.tgz", - "integrity": "sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.0", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-hoist-variables": "^7.14.5", - "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/parser": "^7.15.0", - "@babel/types": "^7.15.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/types": "^7.16.8", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1438,12 +1452,12 @@ } }, "node_modules/@babel/types": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz", - "integrity": "sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1451,29 +1465,16 @@ } }, "node_modules/@nicolo-ribaudo/chokidar-2": { - "version": "2.1.8-no-fsevents.2", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.2.tgz", - "integrity": "sha512-Fb8WxUFOBQVl+CX4MWet5o7eCc6Pj04rXIwVKZ6h1NnqTo45eOQW6aWyhG25NIODvWFwTDMwBsYxrQ3imxpetg==", + "version": "2.1.8-no-fsevents.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", "dev": true, - "optional": true, - "dependencies": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^5.1.2", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } + "optional": true }, "node_modules/@types/eslint": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", - "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.0.tgz", + "integrity": "sha512-JUYa/5JwoqikCy7O7jKtuNe9Z4ZZt615G+1EKfaDGSNEpzaA2OwbV/G1v08Oa7fd1XzlFoSCvt9ePl9/6FyAug==", "dev": true, "peer": true, "dependencies": { @@ -1482,9 +1483,9 @@ } }, "node_modules/@types/eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", "dev": true, "peer": true, "dependencies": { @@ -1507,9 +1508,9 @@ "peer": true }, "node_modules/@types/node": { - "version": "16.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz", - "integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==", + "version": "17.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", + "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==", "dev": true, "peer": true }, @@ -1689,9 +1690,9 @@ "peer": true }, "node_modules/acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, "peer": true, "bin": { @@ -1702,9 +1703,9 @@ } }, "node_modules/acorn-import-assertions": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.7.6.tgz", - "integrity": "sha512-FlVvVFA1TX6l3lp8VjDnYYq7R1nyW6x3svAt4nDgrWQ9SBaSh9CnbwgSUTasgfNfOG5HlM1ehugCvM+hjo56LA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, "peer": true, "peerDependencies": { @@ -1739,9 +1740,9 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -1760,27 +1761,16 @@ } }, "node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, - "optional": true, "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "node_modules/anymatch/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" }, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, "node_modules/argparse": { @@ -1792,76 +1782,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "optional": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, "node_modules/babel-loader": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz", @@ -1986,38 +1906,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "optional": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -2028,13 +1916,12 @@ } }, "node_modules/binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, - "optional": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/brace-expansion": { @@ -2048,38 +1935,28 @@ } }, "node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "optional": true, "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "fill-range": "^7.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "dev": true, "dependencies": { - "caniuse-lite": "^1.0.30001251", - "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", "escalade": "^3.1.1", - "node-releases": "^1.1.75" + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" }, "bin": { "browserslist": "cli.js" @@ -2099,27 +1976,6 @@ "dev": true, "peer": true }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "optional": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -2176,9 +2032,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001251", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz", - "integrity": "sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==", + "version": "1.0.30001301", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz", + "integrity": "sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA==", "dev": true, "funding": { "type": "opencollective", @@ -2200,14 +2056,19 @@ } }, "node_modules/chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -2221,97 +2082,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/chokidar/node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/chokidar/node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/chokidar/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/chokidar/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -2322,86 +2092,6 @@ "node": ">=6.0" } }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "optional": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2413,20 +2103,6 @@ "wrap-ansi": "^6.2.0" } }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "optional": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -2442,12 +2118,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "node_modules/colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", - "dev": true - }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -2463,13 +2133,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true, - "optional": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2485,23 +2148,6 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true - }, "node_modules/cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -2517,10 +2163,18 @@ "node": ">=4" } }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "engines": { + "node": ">= 12" + } + }, "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -2543,16 +2197,6 @@ "node": ">=0.10.0" } }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10" - } - }, "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -2565,24 +2209,10 @@ "node": ">= 0.4" } }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/electron-to-chromium": { - "version": "1.3.814", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.814.tgz", - "integrity": "sha512-0mH03cyjh6OzMlmjauGg0TLd87ErIJqWiYxMcOLKf5w6p0YEOl7DJAj7BDlXEFmCguY5CQaKVOiMjAMODO2XDw==", + "version": "1.4.50", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.50.tgz", + "integrity": "sha512-g5X/6oVoqLyzKfsZ1HsJvxKoUAToFMCuq1USbmp/GPIwJDRYV1IEcv+plYTdh6h11hg140hycCBId0vf7rL0+Q==", "dev": true }, "node_modules/emoji-regex": { @@ -2609,9 +2239,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", - "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", "dev": true, "peer": true, "dependencies": { @@ -2632,22 +2262,25 @@ } }, "node_modules/es-abstract": { - "version": "1.18.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", - "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", "internal-slot": "^1.0.3", - "is-callable": "^1.2.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", @@ -2663,9 +2296,9 @@ } }, "node_modules/es-module-lexer": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz", - "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true, "peer": true }, @@ -2745,9 +2378,9 @@ } }, "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "peer": true, "engines": { @@ -2774,152 +2407,6 @@ "node": ">=0.8.x" } }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "optional": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "optional": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2934,20 +2421,38 @@ "dev": true, "peer": true }, - "node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, + "node_modules/fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" }, "engines": { - "node": ">=0.10.0" + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/find-cache-dir": { @@ -3004,27 +2509,15 @@ "is-callable": "^1.1.3" } }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "optional": true, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "dependencies": { - "map-cache": "^0.2.2" + "fetch-blob": "^3.1.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=12.20.0" } }, "node_modules/fs-extra": { @@ -3105,20 +2598,26 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, - "optional": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -3164,9 +2663,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, "node_modules/has": { @@ -3226,48 +2725,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "optional": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "optional": true, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "optional": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -3331,29 +2788,6 @@ "loose-envify": "^1.0.0" } }, - "node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3373,16 +2807,15 @@ } }, "node_modules/is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "optional": true, "dependencies": { - "binary-extensions": "^1.0.0" + "binary-extensions": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-boolean-object": { @@ -3401,13 +2834,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true, - "optional": true - }, "node_modules/is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -3421,9 +2847,9 @@ } }, "node_modules/is-core-module": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", - "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -3432,29 +2858,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -3470,31 +2873,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "optional": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-directory": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", @@ -3504,16 +2882,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3533,9 +2901,9 @@ } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -3545,9 +2913,9 @@ } }, "node_modules/is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true, "engines": { "node": ">= 0.4" @@ -3557,16 +2925,12 @@ } }, "node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">=0.12.0" } }, "node_modules/is-number-object": { @@ -3584,19 +2948,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "optional": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -3613,6 +2964,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -3651,37 +3011,22 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-windows": { + "node_modules/is-weakref": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/jest-worker": { - "version": "27.0.6", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz", - "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==", + "version": "27.4.6", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.6.tgz", + "integrity": "sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw==", "dev": true, "peer": true, "dependencies": { @@ -3792,9 +3137,6 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.6" - }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -3805,19 +3147,6 @@ "integrity": "sha512-xWga7QCZsR2Wjy2vNL3Kq/irT+IwxwItEWycRRlT5yhqHZK2fmEhziP+LzcJBWSTAMranGKtGTQ6lFpyJS3+jA==", "dev": true }, - "node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/loader-runner": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", @@ -3907,29 +3236,6 @@ "semver": "bin/semver" } }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "optional": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -3937,72 +3243,10 @@ "dev": true, "peer": true }, - "node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/micromatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/mime-db": { - "version": "1.49.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", - "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", "dev": true, "peer": true, "engines": { @@ -4010,13 +3254,13 @@ } }, "node_modules/mime-types": { - "version": "2.1.32", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", - "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", "dev": true, "peer": true, "dependencies": { - "mime-db": "1.49.0" + "mime-db": "1.51.0" }, "engines": { "node": ">= 0.6" @@ -4040,33 +3284,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "optional": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mixin-deep/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -4085,66 +3302,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "optional": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nanomatch/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nanomatch/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nanomatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -4152,18 +3309,45 @@ "dev": true, "peer": true }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], "engines": { - "node": "4.x || >=6.0.0" + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.0.tgz", + "integrity": "sha512-8xeimMwMItMw8hRrOl3C9/xzU49HV/yE6ORew/l+dxWimO5A4Ra8ld2rerlJvc/O7et5Z1zrWsPX43v1QBjCxw==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/node-releases": { - "version": "1.1.75", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz", - "integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "dev": true }, "node_modules/normalize-path": { @@ -4175,89 +3359,10 @@ "node": ">=0.10.0" } }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "optional": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4272,19 +3377,6 @@ "node": ">= 0.4" } }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "optional": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object.assign": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", @@ -4304,14 +3396,14 @@ } }, "node_modules/object.getownpropertydescriptors": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz", - "integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz", + "integrity": "sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2" + "es-abstract": "^1.19.1" }, "engines": { "node": ">= 0.8" @@ -4320,19 +3412,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "optional": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -4391,16 +3470,6 @@ "node": ">=4" } }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -4425,10 +3494,16 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" @@ -4476,23 +3551,6 @@ "is-stream": "^1.0.1" } }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "optional": true - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -4513,35 +3571,16 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "optional": true, "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" + "picomatch": "^2.2.1" }, "engines": { - "node": ">=0.10" + "node": ">=8.10.0" } }, "node_modules/regenerate": { @@ -4551,12 +3590,12 @@ "dev": true }, "node_modules/regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", "dev": true, "dependencies": { - "regenerate": "^1.4.0" + "regenerate": "^1.4.2" }, "engines": { "node": ">=4" @@ -4578,9 +3617,9 @@ } }, "node_modules/regenerator-transform/node_modules/@babel/runtime": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz", - "integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.4" @@ -4595,59 +3634,18 @@ "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "dev": true }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "optional": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/regex-not/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/regex-not/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/regexpu-core": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", - "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", "dev": true, "dependencies": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^9.0.0", + "regjsgen": "^0.5.2", + "regjsparser": "^0.7.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" }, "engines": { "node": ">=4" @@ -4660,9 +3658,9 @@ "dev": true }, "node_modules/regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", "dev": true, "dependencies": { "jsesc": "~0.5.0" @@ -4680,33 +3678,6 @@ "jsesc": "bin/jsesc" } }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true, - "optional": true - }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4723,13 +3694,17 @@ "dev": true }, "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.1.tgz", + "integrity": "sha512-lfEImVbnolPuaSZuLQ52cAxPBHeI77sPwCOWRdy12UG/CNa8an7oBHH1R+Fp1/mUqSJi4c8TIP6FOIPSZAUrEQ==", "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4744,24 +3719,6 @@ "node": ">=4" } }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true, - "optional": true - }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.12" - } - }, "node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -4780,16 +3737,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "optional": true, - "dependencies": { - "ret": "~0.1.10" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -4839,22 +3786,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "optional": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -4878,148 +3809,6 @@ "node": ">=6" } }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "optional": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "optional": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -5029,24 +3818,10 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "optional": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "peer": true, "dependencies": { @@ -5064,156 +3839,21 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true, - "optional": true - }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "optional": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/split-string/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/split-string/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "optional": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" @@ -5246,12 +3886,12 @@ } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -5269,10 +3909,22 @@ "node": ">=4" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/tapable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", - "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, "peer": true, "engines": { @@ -5280,36 +3932,43 @@ } }, "node_modules/terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", "dev": true, "peer": true, "dependencies": { "commander": "^2.20.0", "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" }, "engines": { "node": ">=10" + }, + "peerDependencies": { + "acorn": "^8.5.0" + }, + "peerDependenciesMeta": { + "acorn": { + "optional": true + } } }, "node_modules/terser-webpack-plugin": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz", - "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==", "dev": true, "peer": true, "dependencies": { - "jest-worker": "^27.0.2", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", + "jest-worker": "^27.4.1", + "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.0" + "terser": "^5.7.2" }, "engines": { "node": ">= 10.13.0" @@ -5320,22 +3979,17 @@ }, "peerDependencies": { "webpack": "^5.1.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } } }, "node_modules/terser-webpack-plugin/node_modules/source-map": { @@ -5374,74 +4028,16 @@ "node": ">=4" } }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "optional": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "optional": true, "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex/node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=8.0" } }, "node_modules/unbox-primitive": { @@ -5460,61 +4056,45 @@ } }, "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", "dev": true, "dependencies": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" }, "engines": { "node": ">=4" } }, "node_modules/unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", "dev": true, "engines": { "node": ">=4" } }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "optional": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -5524,69 +4104,6 @@ "node": ">= 4.0.0" } }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "optional": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "optional": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "optional": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=4", - "yarn": "*" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -5597,31 +4114,6 @@ "punycode": "^2.1.0" } }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true, - "optional": true - }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, "node_modules/util.promisify": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", @@ -5639,9 +4131,9 @@ } }, "node_modules/watchpack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz", - "integrity": "sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", + "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", "dev": true, "peer": true, "dependencies": { @@ -5652,10 +4144,18 @@ "node": ">=10.13.0" } }, + "node_modules/web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", + "engines": { + "node": ">= 8" + } + }, "node_modules/webpack": { - "version": "5.51.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.51.1.tgz", - "integrity": "sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==", + "version": "5.67.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.67.0.tgz", + "integrity": "sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==", "dev": true, "peer": true, "dependencies": { @@ -5668,12 +4168,12 @@ "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.8.0", - "es-module-lexer": "^0.7.1", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", "json-parse-better-errors": "^1.0.2", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", @@ -5681,8 +4181,8 @@ "schema-utils": "^3.1.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.2.0", - "webpack-sources": "^3.2.0" + "watchpack": "^2.3.1", + "webpack-sources": "^3.2.3" }, "bin": { "webpack": "bin/webpack.js" @@ -5701,9 +4201,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.0.tgz", - "integrity": "sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true, "peer": true, "engines": { @@ -5876,29 +4376,16 @@ "engines": { "node": ">=8" } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } }, "dependencies": { "@babel/cli": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.14.8.tgz", - "integrity": "sha512-lcy6Lymft9Rpfqmrqdd4oTDdUx9ZwaAhAfywVrHG4771Pa6PPT0danJ1kDHBXYqh4HHSmIdA+nlmfxfxSDPtBg==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.8.tgz", + "integrity": "sha512-FTKBbxyk5TclXOGmwYyqelqP5IF6hMxaeJskd85jbR5jBfYlwqgwAbJwnixi1ZBbTqKfFuAA95mdmUFeSRwyJA==", "dev": true, "requires": { - "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.2", + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", "chokidar": "^3.4.0", "commander": "^4.0.1", "convert-source-map": "^1.1.0", @@ -5910,35 +4397,35 @@ } }, "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "requires": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.16.7" } }, "@babel/compat-data": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", - "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", + "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", "dev": true }, "@babel/core": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.0.tgz", - "integrity": "sha512-tXtmTminrze5HEUPn/a0JtOzzfp0nk+UEXQ/tqIJo3WDGypl/2OFQEMll/zSFU8f/lfmfLXvTaORHF3cfXIQMw==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.10.tgz", + "integrity": "sha512-pbiIdZbCiMx/MM6toR+OfXarYix3uz0oVsnNtfdAGTcCTu3w/JGF8JhirevXLBJUu0WguSZI12qpKnx7EeMyLA==", "dev": true, "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.0", - "@babel/helper-compilation-targets": "^7.15.0", - "@babel/helper-module-transforms": "^7.15.0", - "@babel/helpers": "^7.14.8", - "@babel/parser": "^7.15.0", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.10", + "@babel/types": "^7.16.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -5948,278 +4435,289 @@ } }, "@babel/generator": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.0.tgz", - "integrity": "sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", "dev": true, "requires": { - "@babel/types": "^7.15.0", + "@babel/types": "^7.16.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/helper-annotate-as-pure": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz", - "integrity": "sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz", - "integrity": "sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", + "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", "dev": true, "requires": { - "@babel/helper-explode-assignable-expression": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-explode-assignable-expression": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-compilation-targets": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.0.tgz", - "integrity": "sha512-h+/9t0ncd4jfZ8wsdAsoIxSa61qhBYlycXiHWqJaQBCXAhDCMbPRSMTGnZIkkmt1u4ag+UQmuqcILwqKzZ4N2A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, "requires": { - "@babel/compat-data": "^7.15.0", - "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", "semver": "^6.3.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.0.tgz", - "integrity": "sha512-MdmDXgvTIi4heDVX/e9EFfeGpugqm9fobBVg/iioE8kueXrOHdRDe36FAY7SnE9xXLVeYCoJR/gdrBEIHRC83Q==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.10.tgz", + "integrity": "sha512-wDeej0pu3WN/ffTxMNCPW5UCiOav8IcLRxSIyp/9+IF2xJUM9h/OYjg0IJLHaL6F8oU8kqMz9nc1vryXhMsgXg==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-member-expression-to-functions": "^7.15.0", - "@babel/helper-optimise-call-expression": "^7.14.5", - "@babel/helper-replace-supers": "^7.15.0", - "@babel/helper-split-export-declaration": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7" } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz", - "integrity": "sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.7.tgz", + "integrity": "sha512-fk5A6ymfp+O5+p2yCkXAu5Kyj6v0xh0RBeNcAkYUMDvvAAoxvSKXn+Jb37t/yWFiQVDFK1ELpUTD8/aLhCPu+g==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-annotate-as-pure": "^7.16.7", "regexpu-core": "^4.7.1" } }, "@babel/helper-define-map": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.14.5.tgz", - "integrity": "sha512-spfQRnoChdYWwyFetQDBSDBgH42VskaquRI52kbLei5MjV7s3NPq30/sh2S3YdT20Ku/ZpaNnTVgmDo20NWylg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.16.7.tgz", + "integrity": "sha512-SoIOh18NdeBBQjiLF1H32jpDLkApTbUWwEXmqaxn1KEm7aqry4reaghMdCdkbdloVmMwUxM/uCcTmHWj9zJbxQ==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-function-name": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" } }, "@babel/helper-explode-assignable-expression": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz", - "integrity": "sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", + "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-function-name": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", - "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.14.5", - "@babel/template": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-get-function-arity": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", - "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-hoist-variables": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz", - "integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.0.tgz", - "integrity": "sha512-Jq8H8U2kYiafuj2xMTPQwkTBnEEdGKpT35lJEQsRRjnG0LW3neucsaMWLgKcwu3OHKNeYugfw+Z20BXBSEs2Lg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", + "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", "dev": true, "requires": { - "@babel/types": "^7.15.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-imports": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz", - "integrity": "sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-transforms": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.0.tgz", - "integrity": "sha512-RkGiW5Rer7fpXv9m1B3iHIFDZdItnO2/BLfWVW/9q7+KqQSDY5kUfQEbzdXM1MVhJGcugKV7kRrNVzNxmk7NBg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-replace-supers": "^7.15.0", - "@babel/helper-simple-access": "^7.14.8", - "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.9", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-optimise-call-expression": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz", - "integrity": "sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-plugin-utils": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", - "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "dev": true }, "@babel/helper-remap-async-to-generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz", - "integrity": "sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", + "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-wrap-function": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-wrap-function": "^7.16.8", + "@babel/types": "^7.16.8" } }, "@babel/helper-replace-supers": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.0.tgz", - "integrity": "sha512-6O+eWrhx+HEra/uJnifCwhwMd6Bp5+ZfZeJwbqUTuqkhIT6YcRhiZCOOFChRypOIe0cV46kFrRBlm+t5vHCEaA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.15.0", - "@babel/helper-optimise-call-expression": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/helper-simple-access": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", - "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", "dev": true, "requires": { - "@babel/types": "^7.14.8" + "@babel/types": "^7.16.7" } }, "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz", - "integrity": "sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.0" } }, "@babel/helper-split-export-declaration": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", - "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.16.7" } }, "@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true }, "@babel/helper-wrap-function": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz", - "integrity": "sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", + "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.14.5", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-function-name": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.8", + "@babel/types": "^7.16.8" } }, "@babel/helpers": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.3.tgz", - "integrity": "sha512-HwJiz52XaS96lX+28Tnbu31VeFSQJGOeKHJeaEPQlTl7PnlhFElWPj8tUXtqFIzeN86XxXoBr+WFAyK2PPVz6g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "dev": true, "requires": { - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.15.0", - "@babel/types": "^7.15.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.3.tgz", - "integrity": "sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.10.tgz", + "integrity": "sha512-Sm/S9Or6nN8uiFsQU1yodyDW3MWXQhFeqzMPM+t8MJjM+pLsnFVxFZzkpXKvUXh+Gz9cbMoYYs484+Jw/NTEFQ==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.9.tgz", - "integrity": "sha512-d1lnh+ZnKrFKwtTYdw320+sQWCTwgkB9fmUhNXRADA4akR6wLjaruSGnIEUjpt9HCOwTr4ynFTKu19b7rFRpmw==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", + "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8", "@babel/plugin-syntax-async-generators": "^7.8.4" } }, @@ -6245,12 +4743,12 @@ } }, "@babel/plugin-proposal-json-strings": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz", - "integrity": "sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", + "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-json-strings": "^7.8.3" } }, @@ -6265,23 +4763,23 @@ } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz", - "integrity": "sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", + "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz", - "integrity": "sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", + "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-syntax-async-generators": { @@ -6294,12 +4792,12 @@ } }, "@babel/plugin-syntax-decorators": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.14.5.tgz", - "integrity": "sha512-c4sZMRWL4GSvP1EXy0woIP7m4jkVcEuG8R1TOZxPBPtp4FSM/kiPZub9UIs/Jrb5ZAOzvTUSGYrWsrSu1JvoPw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.16.7.tgz", + "integrity": "sha512-vQ+PxL+srA7g6Rx6I1e15m55gftknl2X8GCUW1JTlkTaXZLJOS0UcaY0eK9jYT7IYf4awn6qwyghVHLDz1WyMw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-syntax-dynamic-import": { @@ -6312,12 +4810,12 @@ } }, "@babel/plugin-syntax-flow": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz", - "integrity": "sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.7.tgz", + "integrity": "sha512-UDo3YGQO0jH6ytzVwgSLv9i/CzMcUjbKenL67dTrAZPPv6GFAtDhe6jqnvmoKzC/7htNTohhos+onPtDMqJwaQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-syntax-json-strings": { @@ -6330,12 +4828,12 @@ } }, "@babel/plugin-syntax-jsx": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz", - "integrity": "sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz", + "integrity": "sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-syntax-object-rest-spread": { @@ -6357,50 +4855,50 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.14.5.tgz", - "integrity": "sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", + "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz", - "integrity": "sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", + "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz", - "integrity": "sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", + "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.14.5" + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8" } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz", - "integrity": "sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", + "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz", - "integrity": "sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", + "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-classes": { @@ -6420,12 +4918,12 @@ } }, "@babel/plugin-transform-computed-properties": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz", - "integrity": "sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", + "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-destructuring": { @@ -6438,80 +4936,81 @@ } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz", - "integrity": "sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", + "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-duplicate-keys": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz", - "integrity": "sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", + "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz", - "integrity": "sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", + "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", "dev": true, "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-flow-strip-types": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz", - "integrity": "sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.16.7.tgz", + "integrity": "sha512-mzmCq3cNsDpZZu9FADYYyfZJIOrSONmHcop2XEKPdBNMa4PDC4eEvcOvzZaCNcjKu72v0XQlA5y1g58aLRXdYg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-flow": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-flow": "^7.16.7" } }, "@babel/plugin-transform-for-of": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz", - "integrity": "sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", + "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-function-name": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz", - "integrity": "sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", + "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-literals": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz", - "integrity": "sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", + "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-modules-amd": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz", - "integrity": "sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", + "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "dependencies": { @@ -6527,14 +5026,14 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.0.tgz", - "integrity": "sha512-3H/R9s8cXcOGE8kgMlmjYYC9nqr5ELiPkJn4q0mypBrjhYQoc+5/Maq69vV4xRPWnkzZuwJPf5rArxpB/35Cig==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz", + "integrity": "sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.15.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-simple-access": "^7.14.8", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "dependencies": { @@ -6550,15 +5049,15 @@ } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz", - "integrity": "sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", + "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "dependencies": { @@ -6574,50 +5073,50 @@ } }, "@babel/plugin-transform-modules-umd": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz", - "integrity": "sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", + "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz", - "integrity": "sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", + "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7" } }, "@babel/plugin-transform-new-target": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz", - "integrity": "sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", + "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-object-super": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz", - "integrity": "sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", + "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7" } }, "@babel/plugin-transform-parameters": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz", - "integrity": "sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", + "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-react-constant-elements": { @@ -6640,40 +5139,40 @@ } }, "@babel/plugin-transform-react-jsx": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.9.tgz", - "integrity": "sha512-30PeETvS+AeD1f58i1OVyoDlVYQhap/K20ZrMjLmmzmC2AYR/G43D4sdJAaDAqCD3MYpSWbmrz3kES158QSLjw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.7.tgz", + "integrity": "sha512-8D16ye66fxiE8m890w0BpPpngG9o9OVBBy0gH2E+2AR7qMR2ZpTYJEqLxAsoroenMId0p/wMW+Blc0meDgu0Ag==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-jsx": "^7.14.5", - "@babel/types": "^7.14.9" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/plugin-transform-react-jsx-self": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.14.9.tgz", - "integrity": "sha512-Fqqu0f8zv9W+RyOnx29BX/RlEsBRANbOf5xs5oxb2aHP4FKbLXxIaVPUiCti56LAR1IixMH4EyaixhUsKqoBHw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.16.7.tgz", + "integrity": "sha512-oe5VuWs7J9ilH3BCCApGoYjHoSO48vkjX2CbA5bFVhIuO2HKxA3vyF7rleA4o6/4rTDbk6r8hBW7Ul8E+UZrpA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-react-jsx-source": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.14.5.tgz", - "integrity": "sha512-1TpSDnD9XR/rQ2tzunBVPThF5poaYT9GqP+of8fAtguYuI/dm2RkrMBDemsxtY0XBzvW7nXjYM0hRyKX9QYj7Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.16.7.tgz", + "integrity": "sha512-rONFiQz9vgbsnaMtQlZCjIRwhJvlrPET8TabIUK2hzlXw9B9s2Ieaxte1SCOOXMbWRHodbKixNf3BLcWVOQ8Bw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-regenerator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz", - "integrity": "sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", + "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", "dev": true, "requires": { "regenerator-transform": "^0.14.2" @@ -6700,70 +5199,70 @@ } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz", - "integrity": "sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", + "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-spread": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz", - "integrity": "sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", + "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz", - "integrity": "sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", + "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-template-literals": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz", - "integrity": "sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", + "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz", - "integrity": "sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", + "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-typescript": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.15.0.tgz", - "integrity": "sha512-WIIEazmngMEEHDaPTx0IZY48SaAmjVWe3TRSX7cmJXn0bEv9midFzAjxiruOWYIVf5iQ10vFx7ASDpgEO08L5w==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz", + "integrity": "sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.15.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-typescript": "^7.14.5" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-typescript": "^7.16.7" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz", - "integrity": "sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", + "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.14.5", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/preset-env": { @@ -6826,14 +5325,14 @@ } }, "@babel/preset-flow": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.14.5.tgz", - "integrity": "sha512-pP5QEb4qRUSVGzzKx9xqRuHUrM/jEzMqdrZpdMA+oUCRgd5zM1qGr5y5+ZgAL/1tVv1H0dyk5t4SKJntqyiVtg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.16.7.tgz", + "integrity": "sha512-6ceP7IyZdUYQ3wUVqyRSQXztd1YmFHWI4Xv11MIqAlE4WqxBSd/FZ61V9k+TS5Gd4mkHOtQtPp9ymRpxH4y1Ug==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-transform-flow-strip-types": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-option": "^7.16.7", + "@babel/plugin-transform-flow-strip-types": "^7.16.7" } }, "@babel/preset-react": { @@ -6869,67 +5368,55 @@ } }, "@babel/template": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", - "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/traverse": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.0.tgz", - "integrity": "sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", "dev": true, "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.0", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-hoist-variables": "^7.14.5", - "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/parser": "^7.15.0", - "@babel/types": "^7.15.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/types": "^7.16.8", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz", - "integrity": "sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" } }, "@nicolo-ribaudo/chokidar-2": { - "version": "2.1.8-no-fsevents.2", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.2.tgz", - "integrity": "sha512-Fb8WxUFOBQVl+CX4MWet5o7eCc6Pj04rXIwVKZ6h1NnqTo45eOQW6aWyhG25NIODvWFwTDMwBsYxrQ3imxpetg==", + "version": "2.1.8-no-fsevents.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^5.1.2", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } + "optional": true }, "@types/eslint": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", - "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.0.tgz", + "integrity": "sha512-JUYa/5JwoqikCy7O7jKtuNe9Z4ZZt615G+1EKfaDGSNEpzaA2OwbV/G1v08Oa7fd1XzlFoSCvt9ePl9/6FyAug==", "dev": true, "peer": true, "requires": { @@ -6938,9 +5425,9 @@ } }, "@types/eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", "dev": true, "peer": true, "requires": { @@ -6963,9 +5450,9 @@ "peer": true }, "@types/node": { - "version": "16.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz", - "integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==", + "version": "17.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", + "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==", "dev": true, "peer": true }, @@ -7145,16 +5632,16 @@ "peer": true }, "acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, "peer": true }, "acorn-import-assertions": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.7.6.tgz", - "integrity": "sha512-FlVvVFA1TX6l3lp8VjDnYYq7R1nyW6x3svAt4nDgrWQ9SBaSh9CnbwgSUTasgfNfOG5HlM1ehugCvM+hjo56LA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, "peer": true, "requires": {} @@ -7181,9 +5668,9 @@ "requires": {} }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -7196,26 +5683,13 @@ } }, "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, - "optional": true, "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" } }, "argparse": { @@ -7227,55 +5701,6 @@ "sprintf-js": "~1.0.2" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "optional": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "optional": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, - "optional": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "optional": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "optional": true - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "optional": true - }, "babel-loader": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz", @@ -7386,34 +5811,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "optional": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -7421,11 +5818,10 @@ "dev": true }, "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true }, "brace-expansion": { "version": "1.1.11", @@ -7438,35 +5834,25 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "optional": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "fill-range": "^7.0.1" } }, "browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001251", - "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", "escalade": "^3.1.1", - "node-releases": "^1.1.75" + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" } }, "buffer-from": { @@ -7476,24 +5862,6 @@ "dev": true, "peer": true }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "optional": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -7535,9 +5903,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001251", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz", - "integrity": "sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A==", + "version": "1.0.30001301", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz", + "integrity": "sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA==", "dev": true }, "chalk": { @@ -7552,9 +5920,9 @@ } }, "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", @@ -7565,75 +5933,6 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" - }, - "dependencies": { - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "chrome-trace-event": { @@ -7643,72 +5942,6 @@ "dev": true, "peer": true }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "optional": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true - } - } - } - } - }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -7720,17 +5953,6 @@ "wrap-ansi": "^6.2.0" } }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "optional": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -7746,12 +5968,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", - "dev": true - }, "commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -7764,13 +5980,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true, - "optional": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -7786,20 +5995,6 @@ "safe-buffer": "~5.1.1" } }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true - }, "cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -7812,10 +6007,15 @@ "parse-json": "^4.0.0" } }, + "data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" + }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -7827,13 +6027,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true, - "optional": true - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -7843,21 +6036,10 @@ "object-keys": "^1.0.12" } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - } - }, "electron-to-chromium": { - "version": "1.3.814", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.814.tgz", - "integrity": "sha512-0mH03cyjh6OzMlmjauGg0TLd87ErIJqWiYxMcOLKf5w6p0YEOl7DJAj7BDlXEFmCguY5CQaKVOiMjAMODO2XDw==", + "version": "1.4.50", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.50.tgz", + "integrity": "sha512-g5X/6oVoqLyzKfsZ1HsJvxKoUAToFMCuq1USbmp/GPIwJDRYV1IEcv+plYTdh6h11hg140hycCBId0vf7rL0+Q==", "dev": true }, "emoji-regex": { @@ -7881,9 +6063,9 @@ } }, "enhanced-resolve": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", - "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", "dev": true, "peer": true, "requires": { @@ -7901,22 +6083,25 @@ } }, "es-abstract": { - "version": "1.18.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", - "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", "dev": true, "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", "internal-slot": "^1.0.3", - "is-callable": "^1.2.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", + "is-string": "^1.0.7", + "is-weakref": "^1.0.1", "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", @@ -7926,9 +6111,9 @@ } }, "es-module-lexer": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz", - "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true, "peer": true }, @@ -7983,9 +6168,9 @@ }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "peer": true } @@ -8005,131 +6190,6 @@ "dev": true, "peer": true }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "optional": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - } - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "optional": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -8144,17 +6204,22 @@ "dev": true, "peer": true }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, + "fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" } }, "find-cache-dir": { @@ -8199,21 +6264,12 @@ "is-callable": "^1.1.3" } }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true, - "optional": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "optional": true, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "requires": { - "map-cache": "^0.2.2" + "fetch-blob": "^3.1.2" } }, "fs-extra": { @@ -8275,17 +6331,20 @@ "has-symbols": "^1.0.1" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, - "optional": true + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -8319,9 +6378,9 @@ "dev": true }, "graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, "has": { @@ -8360,41 +6419,6 @@ "has-symbols": "^1.0.2" } }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "optional": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -8449,25 +6473,6 @@ "loose-envify": "^1.0.0" } }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^6.0.0" - }, - "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true - } - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -8484,13 +6489,12 @@ } }, "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "optional": true, "requires": { - "binary-extensions": "^1.0.0" + "binary-extensions": "^2.0.0" } }, "is-boolean-object": { @@ -8503,13 +6507,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true, - "optional": true - }, "is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", @@ -8517,33 +6514,14 @@ "dev": true }, "is-core-module": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", - "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", "dev": true, "requires": { "has": "^1.0.3" } }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^6.0.0" - }, - "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true - } - } - }, "is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -8553,40 +6531,12 @@ "has-tostringtag": "^1.0.0" } }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true - } - } - }, "is-directory": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "optional": true - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -8600,29 +6550,25 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, "is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-number-object": { "version": "1.0.6", @@ -8633,16 +6579,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "optional": true, - "requires": { - "isobject": "^3.0.1" - } - }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -8653,6 +6589,12 @@ "has-tostringtag": "^1.0.0" } }, + "is-shared-array-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", + "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "dev": true + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -8676,31 +6618,19 @@ "has-symbols": "^1.0.2" } }, - "is-windows": { + "is-weakref": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "optional": true + "requires": { + "call-bind": "^1.0.2" + } }, "jest-worker": { - "version": "27.0.6", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz", - "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==", + "version": "27.4.6", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.6.tgz", + "integrity": "sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw==", "dev": true, "peer": true, "requires": { @@ -8793,16 +6723,6 @@ "integrity": "sha512-xWga7QCZsR2Wjy2vNL3Kq/irT+IwxwItEWycRRlT5yhqHZK2fmEhziP+LzcJBWSTAMranGKtGTQ6lFpyJS3+jA==", "dev": true }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, "loader-runner": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", @@ -8875,23 +6795,6 @@ } } }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "optional": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "optional": true, - "requires": { - "object-visit": "^1.0.0" - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -8899,73 +6802,21 @@ "dev": true, "peer": true }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true - } - } - }, "mime-db": { - "version": "1.49.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", - "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", "dev": true, "peer": true }, "mime-types": { - "version": "2.1.32", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", - "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", "dev": true, "peer": true, "requires": { - "mime-db": "1.49.0" + "mime-db": "1.51.0" } }, "minimatch": { @@ -8983,29 +6834,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "optional": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -9021,56 +6849,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "optional": true - } - } - }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -9078,15 +6856,25 @@ "dev": true, "peer": true }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.0.tgz", + "integrity": "sha512-8xeimMwMItMw8hRrOl3C9/xzU49HV/yE6ORew/l+dxWimO5A4Ra8ld2rerlJvc/O7et5Z1zrWsPX43v1QBjCxw==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } }, "node-releases": { - "version": "1.1.75", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz", - "integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", "dev": true }, "normalize-path": { @@ -9095,75 +6883,10 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "optional": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true - } - } - } - } - }, "object-inspect": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true }, "object-keys": { @@ -9172,16 +6895,6 @@ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "optional": true, - "requires": { - "isobject": "^3.0.0" - } - }, "object.assign": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", @@ -9195,24 +6908,14 @@ } }, "object.getownpropertydescriptors": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz", - "integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz", + "integrity": "sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.2" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "optional": true, - "requires": { - "isobject": "^3.0.1" + "es-abstract": "^1.19.1" } }, "once": { @@ -9258,13 +6961,6 @@ "json-parse-better-errors": "^1.0.1" } }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "optional": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -9283,10 +6979,16 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pify": { @@ -9324,20 +7026,6 @@ } } }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "optional": true - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -9355,32 +7043,13 @@ "safe-buffer": "^5.1.0" } }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "optional": true, "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" + "picomatch": "^2.2.1" } }, "regenerate": { @@ -9390,12 +7059,12 @@ "dev": true }, "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", "dev": true, "requires": { - "regenerate": "^1.4.0" + "regenerate": "^1.4.2" } }, "regenerator-runtime": { @@ -9414,9 +7083,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.15.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz", - "integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -9430,52 +7099,18 @@ } } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "regexpu-core": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", - "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", "dev": true, "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^9.0.0", + "regjsgen": "^0.5.2", + "regjsparser": "^0.7.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" } }, "regjsgen": { @@ -9485,9 +7120,9 @@ "dev": true }, "regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -9501,27 +7136,6 @@ } } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true, - "optional": true - }, - "repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "optional": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "optional": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -9535,13 +7149,14 @@ "dev": true }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.1.tgz", + "integrity": "sha512-lfEImVbnolPuaSZuLQ52cAxPBHeI77sPwCOWRdy12UG/CNa8an7oBHH1R+Fp1/mUqSJi4c8TIP6FOIPSZAUrEQ==", "dev": true, "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.8.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-from": { @@ -9550,20 +7165,6 @@ "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", "dev": true }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true, - "optional": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "optional": true - }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -9579,16 +7180,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "optional": true, - "requires": { - "ret": "~0.1.10" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -9628,19 +7219,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - } - }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -9658,151 +7236,16 @@ "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "optional": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "optional": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.2.0" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "optional": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "peer": true, "requires": { @@ -9819,135 +7262,21 @@ } } }, - "source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true, - "optional": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^3.0.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "optional": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true - } - } - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "string.prototype.trimend": { @@ -9971,12 +7300,12 @@ } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "supports-color": { @@ -9988,23 +7317,29 @@ "has-flag": "^3.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "tapable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", - "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, "peer": true }, "terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", "dev": true, "peer": true, "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "dependencies": { "commander": { @@ -10024,30 +7359,19 @@ } }, "terser-webpack-plugin": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz", - "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==", "dev": true, "peer": true, "requires": { - "jest-worker": "^27.0.2", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", + "jest-worker": "^27.4.1", + "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.0" + "terser": "^5.7.2" }, "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "peer": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -10063,61 +7387,13 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "optional": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "optional": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "unbox-primitive": { @@ -10133,103 +7409,39 @@ } }, "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", "dev": true }, "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", "dev": true, "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" } }, "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", "dev": true }, "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", "dev": true }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "optional": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "optional": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "optional": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "optional": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "optional": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true - }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -10240,27 +7452,6 @@ "punycode": "^2.1.0" } }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true, - "optional": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, "util.promisify": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", @@ -10275,9 +7466,9 @@ } }, "watchpack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz", - "integrity": "sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", + "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", "dev": true, "peer": true, "requires": { @@ -10285,10 +7476,15 @@ "graceful-fs": "^4.1.2" } }, + "web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==" + }, "webpack": { - "version": "5.51.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.51.1.tgz", - "integrity": "sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==", + "version": "5.67.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.67.0.tgz", + "integrity": "sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==", "dev": true, "peer": true, "requires": { @@ -10301,12 +7497,12 @@ "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.8.0", - "es-module-lexer": "^0.7.1", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", "json-parse-better-errors": "^1.0.2", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", @@ -10314,14 +7510,14 @@ "schema-utils": "^3.1.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.2.0", - "webpack-sources": "^3.2.0" + "watchpack": "^2.3.1", + "webpack-sources": "^3.2.3" } }, "webpack-sources": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.0.tgz", - "integrity": "sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true, "peer": true }, @@ -10462,13 +7658,6 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "peer": true } } } diff --git a/samples/client/petstore/javascript-flowtyped/package.json b/samples/client/petstore/javascript-flowtyped/package.json index a3dd89f5cbf..393540acf32 100644 --- a/samples/client/petstore/javascript-flowtyped/package.json +++ b/samples/client/petstore/javascript-flowtyped/package.json @@ -19,7 +19,7 @@ "build:flow": "flow-copy-source -v -i '**/__tests__/**' src lib" }, "dependencies": { - "node-fetch": ">=2.6.1", + "node-fetch": ">=3.1.1", "portable-fetch": "^3.0.0" }, "devDependencies": { From 28cc28626531158ce0517dcaabb160208d62aba3 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Sat, 22 Jan 2022 06:11:04 -0500 Subject: [PATCH 076/113] [typescript] Default auth method support and optional param object when all params optional (#11321) * add default auth * private * default when optional params and fix types * build samples * remove extra space * re-add space before default empty * switch to default authentication method support in config * generated samples * null check chaining * generate samples * remove extra spaces * regen samples * formatting fixes * more samples * remove from abstract methods * samples * add default to inversify as well * samples again * exclude inversify * samples once more * samples --- .../resources/typescript/api/api.mustache | 18 +++- .../resources/typescript/auth/auth.mustache | 12 +++ .../typescript/types/ObjectParamAPI.mustache | 2 +- .../composed-schemas/apis/DefaultApi.ts | 20 +++- .../builds/composed-schemas/auth/auth.ts | 3 + .../composed-schemas/types/ObjectParamAPI.ts | 6 +- .../typescript/builds/default/apis/PetApi.ts | 93 +++++++++++++------ .../builds/default/apis/StoreApi.ts | 31 ++++++- .../typescript/builds/default/apis/UserApi.ts | 81 ++++++++++++---- .../typescript/builds/default/auth/auth.ts | 3 + .../builds/default/types/ObjectParamAPI.ts | 4 +- .../typescript/builds/deno/apis/PetApi.ts | 93 +++++++++++++------ .../typescript/builds/deno/apis/StoreApi.ts | 31 ++++++- .../typescript/builds/deno/apis/UserApi.ts | 81 ++++++++++++---- .../typescript/builds/deno/auth/auth.ts | 3 + .../builds/deno/types/ObjectParamAPI.ts | 4 +- .../builds/inversify/apis/PetApi.ts | 61 ++++++------ .../builds/inversify/apis/StoreApi.ts | 15 ++- .../builds/inversify/apis/UserApi.ts | 49 ++++++---- .../builds/inversify/types/ObjectParamAPI.ts | 4 +- .../typescript/builds/jquery/apis/PetApi.ts | 93 +++++++++++++------ .../typescript/builds/jquery/apis/StoreApi.ts | 31 ++++++- .../typescript/builds/jquery/apis/UserApi.ts | 81 ++++++++++++---- .../typescript/builds/jquery/auth/auth.ts | 3 + .../builds/jquery/types/ObjectParamAPI.ts | 4 +- .../builds/object_params/apis/PetApi.ts | 93 +++++++++++++------ .../builds/object_params/apis/StoreApi.ts | 31 ++++++- .../builds/object_params/apis/UserApi.ts | 81 ++++++++++++---- .../builds/object_params/auth/auth.ts | 3 + .../object_params/types/ObjectParamAPI.ts | 4 +- 30 files changed, 762 insertions(+), 276 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index 4ccded577e4..0ca80559310 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -1,7 +1,7 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi{{extensionForDeno}}'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi{{extensionForDeno}}'; import {Configuration} from '../configuration{{extensionForDeno}}'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http{{extensionForDeno}}'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http{{extensionForDeno}}'; {{#platforms}} {{#node}} import * as FormData from "form-data"; @@ -11,6 +11,7 @@ import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer{{extensionForDeno}}'; import {ApiException} from './exception{{extensionForDeno}}'; import {canConsumeForm, isCodeInRange} from '../util{{extensionForDeno}}'; +import {SecurityAuthentication} from '../auth/auth'; {{#useInversify}} import { injectable } from "inversify"; @@ -151,15 +152,22 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory { {{/bodyParam}} {{#hasAuthMethods}} - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; {{/hasAuthMethods}} {{#authMethods}} // Apply auth methods authMethod = _config.authMethods["{{name}}"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } {{/authMethods}} + + {{^useInversify}} + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + {{/useInversify}} return requestContext; } diff --git a/modules/openapi-generator/src/main/resources/typescript/auth/auth.mustache b/modules/openapi-generator/src/main/resources/typescript/auth/auth.mustache index bfb303e741e..09ff0ca2bb9 100644 --- a/modules/openapi-generator/src/main/resources/typescript/auth/auth.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/auth/auth.mustache @@ -107,6 +107,9 @@ export class {{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication {{/authMethods}} export type AuthMethods = { + {{^useInversify}} + "default"?: SecurityAuthentication, + {{/useInversify}} {{#authMethods}} "{{name}}"?: SecurityAuthentication{{^-last}},{{/-last}} {{/authMethods}} @@ -114,6 +117,9 @@ export type AuthMethods = { {{#useInversify}} export const authMethodServices = { + {{^useInversify}} + "default"?: SecurityAuthentication, + {{/useInversify}} {{#authMethods}} "{{name}}": {{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication{{^-last}},{{/-last}} {{/authMethods}} @@ -126,6 +132,9 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; export type AuthMethodsConfiguration = { + {{^useInversify}} + "default"?: SecurityAuthentication, + {{/useInversify}} {{#authMethods}} "{{name}}"?: {{#isApiKey}}ApiKeyConfiguration{{/isApiKey}}{{#isBasicBasic}}HttpBasicConfiguration{{/isBasicBasic}}{{#isBasicBearer}}HttpBearerConfiguration{{/isBasicBearer}}{{#isOAuth}}OAuth2Configuration{{/isOAuth}}{{^-last}},{{/-last}} {{/authMethods}} @@ -141,6 +150,9 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine if (!config) { return authMethods; } + {{^useInversify}} + authMethods["default"] = config["default"] + {{/useInversify}} {{#authMethods}} if (config["{{name}}"]) { diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache index d44164bd019..9a639033718 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache @@ -47,7 +47,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts index 59a3ac16973..a2c52ae901e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { Cat } from '../models/Cat'; @@ -44,6 +45,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -74,6 +80,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -104,6 +115,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/auth/auth.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/auth/auth.ts index fa859aaa098..49340932e11 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/auth/auth.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/auth/auth.ts @@ -24,6 +24,7 @@ export interface TokenProvider { export type AuthMethods = { + "default"?: SecurityAuthentication, } export type ApiKeyConfiguration = string; @@ -32,6 +33,7 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; export type AuthMethodsConfiguration = { + "default"?: SecurityAuthentication, } /** @@ -44,6 +46,7 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine if (!config) { return authMethods; } + authMethods["default"] = config["default"] return authMethods; } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts index d94a613229e..84ebc7d8c69 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts @@ -50,21 +50,21 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public filePost(param: DefaultApiFilePostRequest, options?: Configuration): Promise { + public filePost(param: DefaultApiFilePostRequest = {}, options?: Configuration): Promise { return this.api.filePost(param.inlineObject, options).toPromise(); } /** * @param param the request object */ - public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest, options?: Configuration): Promise { + public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration): Promise { return this.api.petsFilteredPatch(param.petByAgePetByType, options).toPromise(); } /** * @param param the request object */ - public petsPatch(param: DefaultApiPetsPatchRequest, options?: Configuration): Promise { + public petsPatch(param: DefaultApiPetsPatchRequest = {}, options?: Configuration): Promise { return this.api.petsPatch(param.catDog, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts index ff3b13bc845..e85797baebc 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { ApiResponse } from '../models/ApiResponse'; @@ -51,11 +52,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -88,11 +94,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", "")); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -125,11 +136,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -162,11 +178,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -195,11 +216,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -239,11 +265,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -304,11 +335,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -371,11 +407,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts index 46cf6d33efc..821e181892b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { Order } from '../models/Order'; @@ -39,6 +40,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -58,11 +64,16 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -91,6 +102,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -127,6 +143,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts index 99a7c43b2e5..9a87f64e9c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { User } from '../models/User'; @@ -49,11 +50,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -91,11 +97,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -133,11 +144,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -166,11 +182,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -198,6 +219,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -240,6 +266,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -258,11 +289,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -309,11 +345,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/default/auth/auth.ts b/samples/openapi3/client/petstore/typescript/builds/default/auth/auth.ts index 1f1d1ecac67..a67ed0e90cc 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/auth/auth.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/auth/auth.ts @@ -66,6 +66,7 @@ export class PetstoreAuthAuthentication implements SecurityAuthentication { export type AuthMethods = { + "default"?: SecurityAuthentication, "api_key"?: SecurityAuthentication, "petstore_auth"?: SecurityAuthentication } @@ -76,6 +77,7 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; export type AuthMethodsConfiguration = { + "default"?: SecurityAuthentication, "api_key"?: ApiKeyConfiguration, "petstore_auth"?: OAuth2Configuration } @@ -90,6 +92,7 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine if (!config) { return authMethods; } + authMethods["default"] = config["default"] if (config["api_key"]) { authMethods["api_key"] = new ApiKeyAuthentication( diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts index 829c9d0363a..a590e3ca492 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts @@ -244,7 +244,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -409,7 +409,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { return this.api.logoutUser( options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts index 9ae92b9b212..f11b208baf2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi.ts'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; import {canConsumeForm, isCodeInRange} from '../util.ts'; +import {SecurityAuthentication} from '../auth/auth'; import { ApiResponse } from '../models/ApiResponse.ts'; @@ -49,11 +50,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -86,11 +92,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", "")); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -123,11 +134,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -160,11 +176,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -193,11 +214,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -237,11 +263,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -302,11 +333,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -369,11 +405,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts index 767734aed21..f83700b35cf 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi.ts'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; import {canConsumeForm, isCodeInRange} from '../util.ts'; +import {SecurityAuthentication} from '../auth/auth'; import { Order } from '../models/Order.ts'; @@ -37,6 +38,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -56,11 +62,16 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -89,6 +100,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -125,6 +141,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts index 7caf789d015..f2de9aeb598 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi.ts'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; import {canConsumeForm, isCodeInRange} from '../util.ts'; +import {SecurityAuthentication} from '../auth/auth'; import { User } from '../models/User.ts'; @@ -47,11 +48,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -89,11 +95,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -131,11 +142,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -164,11 +180,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -196,6 +217,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -238,6 +264,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -256,11 +287,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -307,11 +343,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/auth/auth.ts b/samples/openapi3/client/petstore/typescript/builds/deno/auth/auth.ts index e7609dabbec..85086dde5fa 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/auth/auth.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/auth/auth.ts @@ -64,6 +64,7 @@ export class PetstoreAuthAuthentication implements SecurityAuthentication { export type AuthMethods = { + "default"?: SecurityAuthentication, "api_key"?: SecurityAuthentication, "petstore_auth"?: SecurityAuthentication } @@ -74,6 +75,7 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; export type AuthMethodsConfiguration = { + "default"?: SecurityAuthentication, "api_key"?: ApiKeyConfiguration, "petstore_auth"?: OAuth2Configuration } @@ -88,6 +90,7 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine if (!config) { return authMethods; } + authMethods["default"] = config["default"] if (config["api_key"]) { authMethods["api_key"] = new ApiKeyAuthentication( diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts index ebcd714f27c..a6988e3ef19 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts @@ -244,7 +244,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -409,7 +409,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { return this.api.logoutUser( options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts index 9b8cd23af11..81a75d96bce 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { injectable } from "inversify"; @@ -53,12 +54,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -90,12 +92,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", "")); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -127,12 +130,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -164,12 +168,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -197,12 +202,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -241,12 +247,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -306,12 +313,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -373,12 +381,13 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts index 356d2cfbc4d..4115b9dc6d9 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { injectable } from "inversify"; @@ -41,6 +42,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + return requestContext; } @@ -60,12 +62,13 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -93,6 +96,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + return requestContext; } @@ -129,6 +133,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts index 3991a33b383..124034df988 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { injectable } from "inversify"; @@ -51,12 +52,13 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -93,12 +95,13 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -135,12 +138,13 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -168,12 +172,13 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -200,6 +205,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + return requestContext; } @@ -242,6 +248,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } + return requestContext; } @@ -260,12 +267,13 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } @@ -311,12 +319,13 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); } + return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts index 829c9d0363a..a590e3ca492 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts @@ -244,7 +244,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -409,7 +409,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { return this.api.logoutUser( options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts index a2b9813749e..fe20e750a83 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { ApiResponse } from '../models/ApiResponse'; @@ -49,11 +50,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -86,11 +92,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", "")); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -123,11 +134,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -160,11 +176,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -193,11 +214,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -237,11 +263,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -302,11 +333,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -369,11 +405,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts index a8bc438d420..020bb040706 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { Order } from '../models/Order'; @@ -37,6 +38,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -56,11 +62,16 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -89,6 +100,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -125,6 +141,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts index 3f493441c39..75cb0453992 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts @@ -1,10 +1,11 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { User } from '../models/User'; @@ -47,11 +48,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -89,11 +95,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -131,11 +142,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -164,11 +180,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -196,6 +217,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -238,6 +264,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -256,11 +287,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -307,11 +343,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/auth/auth.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/auth/auth.ts index d8924a4216c..ed2aa2bfe6d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/auth/auth.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/auth/auth.ts @@ -64,6 +64,7 @@ export class PetstoreAuthAuthentication implements SecurityAuthentication { export type AuthMethods = { + "default"?: SecurityAuthentication, "api_key"?: SecurityAuthentication, "petstore_auth"?: SecurityAuthentication } @@ -74,6 +75,7 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; export type AuthMethodsConfiguration = { + "default"?: SecurityAuthentication, "api_key"?: ApiKeyConfiguration, "petstore_auth"?: OAuth2Configuration } @@ -88,6 +90,7 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine if (!config) { return authMethods; } + authMethods["default"] = config["default"] if (config["api_key"]) { authMethods["api_key"] = new ApiKeyAuthentication( diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts index 829c9d0363a..a590e3ca492 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts @@ -244,7 +244,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -409,7 +409,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { return this.api.logoutUser( options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts index ff3b13bc845..e85797baebc 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { ApiResponse } from '../models/ApiResponse'; @@ -51,11 +52,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -88,11 +94,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", "")); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -125,11 +136,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -162,11 +178,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -195,11 +216,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -239,11 +265,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -304,11 +335,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -371,11 +407,16 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Content-Type", contentType); } - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["petstore_auth"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts index 46cf6d33efc..821e181892b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { Order } from '../models/Order'; @@ -39,6 +40,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -58,11 +64,16 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -91,6 +102,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -127,6 +143,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts index 99a7c43b2e5..9a87f64e9c5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts @@ -1,12 +1,13 @@ // TODO: better import syntax? -import { BaseAPIRequestFactory, RequiredError } from './baseapi'; +import {BaseAPIRequestFactory, RequiredError} from './baseapi'; import {Configuration} from '../configuration'; -import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; +import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; import {canConsumeForm, isCodeInRange} from '../util'; +import {SecurityAuthentication} from '../auth/auth'; import { User } from '../models/User'; @@ -49,11 +50,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -91,11 +97,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -133,11 +144,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -166,11 +182,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -198,6 +219,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -240,6 +266,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } return requestContext; } @@ -258,11 +289,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; @@ -309,11 +345,16 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { ); requestContext.setBody(serializedBody); - let authMethod = null; + let authMethod: SecurityAuthentication | undefined; // Apply auth methods authMethod = _config.authMethods["api_key"] - if (authMethod) { - await authMethod.applySecurityAuthentication(requestContext); + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); } return requestContext; diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/auth/auth.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/auth/auth.ts index 1f1d1ecac67..a67ed0e90cc 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/auth/auth.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/auth/auth.ts @@ -66,6 +66,7 @@ export class PetstoreAuthAuthentication implements SecurityAuthentication { export type AuthMethods = { + "default"?: SecurityAuthentication, "api_key"?: SecurityAuthentication, "petstore_auth"?: SecurityAuthentication } @@ -76,6 +77,7 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider }; export type OAuth2Configuration = { accessToken: string }; export type AuthMethodsConfiguration = { + "default"?: SecurityAuthentication, "api_key"?: ApiKeyConfiguration, "petstore_auth"?: OAuth2Configuration } @@ -90,6 +92,7 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine if (!config) { return authMethods; } + authMethods["default"] = config["default"] if (config["api_key"]) { authMethods["api_key"] = new ApiKeyAuthentication( diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts index 829c9d0363a..a590e3ca492 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts @@ -244,7 +244,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -409,7 +409,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { return this.api.logoutUser( options).toPromise(); } From 78f4748c0682971bcf085107c1f803c39cb088e4 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sun, 23 Jan 2022 14:16:46 -0800 Subject: [PATCH 077/113] Adds generator default template engine (#11366) * Revert "Revert "Has generators set default template engine (#11245)" (#11316)" This reverts commit 57987424a4eaa22d73337388489cd86d7f42a023. * Only loads in the default template engine if the config file contains the generatorName * Only sets templatingEngineName using condif default in one place * Adds config files that lack generatorName * Revert "Adds config files that lack generatorName" This reverts commit 7dafc93c0f02c037d9be5d2c0a3ee7377c8b479d. * Adds generator default templating engine to the generator metadata --- bin/configs/python-experimental.yaml | 1 - docs/generators/ada-server.md | 1 + docs/generators/ada.md | 1 + docs/generators/android.md | 1 + docs/generators/apache2.md | 1 + docs/generators/apex.md | 1 + docs/generators/asciidoc.md | 1 + docs/generators/aspnetcore.md | 1 + docs/generators/avro-schema.md | 1 + docs/generators/bash.md | 1 + docs/generators/c.md | 1 + docs/generators/clojure.md | 1 + docs/generators/cpp-pistache-server.md | 1 + docs/generators/cpp-qt-client.md | 1 + docs/generators/cpp-qt-qhttpengine-server.md | 1 + docs/generators/cpp-restbed-server.md | 1 + docs/generators/cpp-restsdk.md | 1 + docs/generators/cpp-tiny.md | 1 + docs/generators/cpp-tizen.md | 1 + docs/generators/cpp-ue4.md | 1 + docs/generators/crystal.md | 1 + docs/generators/csharp-dotnet2.md | 1 + docs/generators/csharp-nancyfx.md | 1 + docs/generators/csharp-netcore-functions.md | 1 + docs/generators/csharp-netcore.md | 1 + docs/generators/csharp.md | 1 + docs/generators/cwiki.md | 1 + docs/generators/dart-dio-next.md | 1 + docs/generators/dart-dio.md | 1 + docs/generators/dart-jaguar.md | 1 + docs/generators/dart.md | 1 + docs/generators/dynamic-html.md | 1 + docs/generators/eiffel.md | 1 + docs/generators/elixir.md | 1 + docs/generators/elm.md | 1 + docs/generators/erlang-client.md | 1 + docs/generators/erlang-proper.md | 1 + docs/generators/erlang-server.md | 1 + docs/generators/flash-deprecated.md | 1 + docs/generators/fsharp-functions.md | 1 + docs/generators/fsharp-giraffe-server.md | 1 + docs/generators/go-deprecated.md | 1 + docs/generators/go-echo-server.md | 1 + docs/generators/go-gin-server.md | 1 + docs/generators/go-server.md | 1 + docs/generators/go.md | 1 + docs/generators/graphql-nodejs-express-server.md | 1 + docs/generators/graphql-schema.md | 1 + docs/generators/groovy.md | 1 + docs/generators/haskell-http-client.md | 1 + docs/generators/haskell-yesod.md | 1 + docs/generators/haskell.md | 1 + docs/generators/html.md | 1 + docs/generators/html2.md | 1 + docs/generators/java-camel.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/javascript-apollo.md | 1 + docs/generators/javascript-closure-angular.md | 1 + docs/generators/javascript-flowtyped.md | 1 + docs/generators/javascript.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/jmeter.md | 1 + docs/generators/k6.md | 1 + docs/generators/kotlin-server-deprecated.md | 1 + docs/generators/kotlin-server.md | 1 + docs/generators/kotlin-spring.md | 1 + docs/generators/kotlin-vertx.md | 1 + docs/generators/kotlin.md | 1 + docs/generators/ktorm-schema.md | 1 + docs/generators/lua.md | 1 + docs/generators/markdown.md | 1 + docs/generators/mysql-schema.md | 1 + docs/generators/nim.md | 1 + docs/generators/nodejs-express-server.md | 1 + docs/generators/objc.md | 1 + docs/generators/ocaml.md | 1 + docs/generators/openapi-yaml.md | 1 + docs/generators/openapi.md | 1 + docs/generators/perl.md | 1 + docs/generators/php-dt.md | 1 + docs/generators/php-laravel.md | 1 + docs/generators/php-lumen.md | 1 + docs/generators/php-mezzio-ph.md | 1 + docs/generators/php-silex-deprecated.md | 1 + docs/generators/php-slim-deprecated.md | 1 + docs/generators/php-slim4.md | 1 + docs/generators/php-symfony.md | 1 + docs/generators/php.md | 1 + docs/generators/plantuml.md | 1 + docs/generators/powershell.md | 1 + docs/generators/protobuf-schema.md | 1 + docs/generators/python-aiohttp.md | 1 + docs/generators/python-blueplanet.md | 1 + docs/generators/python-experimental.md | 1 + docs/generators/python-fastapi.md | 1 + docs/generators/python-flask.md | 1 + docs/generators/python-legacy.md | 1 + docs/generators/python.md | 1 + docs/generators/r.md | 1 + docs/generators/ruby-on-rails.md | 1 + docs/generators/ruby-sinatra.md | 1 + docs/generators/ruby.md | 1 + docs/generators/rust-server.md | 1 + docs/generators/rust.md | 1 + docs/generators/scala-akka-http-server.md | 1 + docs/generators/scala-akka.md | 1 + docs/generators/scala-finch.md | 1 + docs/generators/scala-gatling.md | 1 + docs/generators/scala-httpclient-deprecated.md | 1 + docs/generators/scala-lagom-server.md | 1 + docs/generators/scala-play-server.md | 1 + docs/generators/scala-sttp.md | 1 + docs/generators/scalatra.md | 1 + docs/generators/scalaz.md | 1 + docs/generators/spring.md | 1 + docs/generators/swift4-deprecated.md | 1 + docs/generators/swift5.md | 1 + docs/generators/typescript-angular.md | 1 + docs/generators/typescript-angularjs-deprecated.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-nestjs.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + docs/generators/typescript.md | 1 + docs/generators/wsdl-schema.md | 1 + .../java/org/openapitools/codegen/cmd/ConfigHelp.java | 1 + .../openapitools/codegen/config/WorkflowSettings.java | 2 +- .../java/org/openapitools/codegen/CodegenConfig.java | 2 ++ .../java/org/openapitools/codegen/DefaultCodegen.java | 5 +++++ .../codegen/config/CodegenConfigurator.java | 10 ++++++---- .../languages/PythonExperimentalClientCodegen.java | 5 +++++ 151 files changed, 164 insertions(+), 6 deletions(-) diff --git a/bin/configs/python-experimental.yaml b/bin/configs/python-experimental.yaml index 1a8ea6e002c..dd204f44938 100644 --- a/bin/configs/python-experimental.yaml +++ b/bin/configs/python-experimental.yaml @@ -2,7 +2,6 @@ generatorName: python-experimental outputDir: samples/openapi3/client/petstore/python-experimental inputSpec: modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/python-experimental -templatingEngineName: handlebars additionalProperties: packageName: petstore_api recursionLimit: "1234" diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 4dcede68c0d..63c530a26cb 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -10,6 +10,7 @@ title: Documentation for the ada-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Ada | | +| generator default templating engine | mustache | | | helpTxt | Generates an Ada server implementation (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/ada.md b/docs/generators/ada.md index 12fd0187cfa..8bb28aefe70 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -10,6 +10,7 @@ title: Documentation for the ada Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Ada | | +| generator default templating engine | mustache | | | helpTxt | Generates an Ada client implementation (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/android.md b/docs/generators/android.md index 36a0bc0406d..650b819bea6 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -10,6 +10,7 @@ title: Documentation for the android Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates an Android client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 5b8e5d4e456..8cc8e289328 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -10,6 +10,7 @@ title: Documentation for the apache2 Generator | generator stability | STABLE | | | generator type | CONFIG | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates an Apache2 Config file with the permissions | | ## CONFIG OPTIONS diff --git a/docs/generators/apex.md b/docs/generators/apex.md index 2c815c44960..f92f9e57177 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -10,6 +10,7 @@ title: Documentation for the apex Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Apex | | +| generator default templating engine | mustache | | | helpTxt | Generates an Apex API client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index b966cd6e179..712f00d17b4 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -10,6 +10,7 @@ title: Documentation for the asciidoc Generator | generator stability | STABLE | | | generator type | DOCUMENTATION | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates asciidoc markup based documentation. | | ## CONFIG OPTIONS diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 1488ec9672f..6956ac6d9c1 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -10,6 +10,7 @@ title: Documentation for the aspnetcore Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | C# | | +| generator default templating engine | mustache | | | helpTxt | Generates an ASP.NET Core Web API server. | | ## CONFIG OPTIONS diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index d8929e448ea..8ea48f62882 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -10,6 +10,7 @@ title: Documentation for the avro-schema Generator | generator stability | BETA | | | generator type | SCHEMA | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Avro model (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/bash.md b/docs/generators/bash.md index d7053aaa12c..8a4f10696e3 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -10,6 +10,7 @@ title: Documentation for the bash Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Bash | | +| generator default templating engine | mustache | | | helpTxt | Generates a Bash client script based on cURL. | | ## CONFIG OPTIONS diff --git a/docs/generators/c.md b/docs/generators/c.md index 700b9c59efd..3bab335a5f6 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -10,6 +10,7 @@ title: Documentation for the c Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | C | | +| generator default templating engine | mustache | | | helpTxt | Generates a C (libcurl) client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index 512688ead46..542a27c2998 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -10,6 +10,7 @@ title: Documentation for the clojure Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Clojure | | +| generator default templating engine | mustache | | | helpTxt | Generates a Clojure client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index 534d5a52f48..e561cac7c5a 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-pistache-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a C++ API server (based on Pistache) | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 9ea981421a5..a03ff5bc48b 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-qt-client Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Qt C++ client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index 12fd8dc3a63..5de00c76638 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-qt-qhttpengine-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Qt C++ Server using the QHTTPEngine HTTP Library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-restbed-server.md b/docs/generators/cpp-restbed-server.md index f5037c7ac5d..c499ba8e28d 100644 --- a/docs/generators/cpp-restbed-server.md +++ b/docs/generators/cpp-restbed-server.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-restbed-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a C++ API Server with Restbed (https://github.com/Corvusoft/restbed). | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index 700f1c657d1..5cad57183bc 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-restsdk Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a C++ API client with C++ REST SDK (https://github.com/Microsoft/cpprestsdk). | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index 08a7e4f6919..ca65611bf81 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-tiny Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a C++ Arduino REST API client. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index c81dec1d03a..9b5f89bb2c7 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-tizen Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Samsung Tizen C++ client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index 563f1325a4c..f619e7eaf7b 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -10,6 +10,7 @@ title: Documentation for the cpp-ue4 Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | C++ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Unreal Engine 4 C++ Module (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index 0961a1e0514..45aaac6e9e5 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -10,6 +10,7 @@ title: Documentation for the crystal Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | Crystal | | +| generator default templating engine | mustache | | | helpTxt | Generates a Crystal client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md index 539eb8282e6..274150134c9 100644 --- a/docs/generators/csharp-dotnet2.md +++ b/docs/generators/csharp-dotnet2.md @@ -10,6 +10,7 @@ title: Documentation for the csharp-dotnet2 Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | C# | | +| generator default templating engine | mustache | | | helpTxt | Generates a C# .Net 2.0 client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx.md index 076cf18395c..37d2be9eb02 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx.md @@ -10,6 +10,7 @@ title: Documentation for the csharp-nancyfx Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | C# | | +| generator default templating engine | mustache | | | helpTxt | Generates a C# NancyFX Web API server. | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md index eca318215d8..c694b4626ff 100644 --- a/docs/generators/csharp-netcore-functions.md +++ b/docs/generators/csharp-netcore-functions.md @@ -10,6 +10,7 @@ title: Documentation for the csharp-netcore-functions Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | C# | | +| generator default templating engine | mustache | | | helpTxt | Generates a csharp server. | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index ad581afc56b..d693fdf9e44 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -10,6 +10,7 @@ title: Documentation for the csharp-netcore Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | C# | | +| generator default templating engine | mustache | | | helpTxt | Generates a C# client library (.NET Standard, .NET Core). | | ## CONFIG OPTIONS diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 656b537a2c0..0dd162bc8d6 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -10,6 +10,7 @@ title: Documentation for the csharp Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | C# | | +| generator default templating engine | mustache | | | helpTxt | Generates a CSharp client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index 19997fc3e8d..1f74c2420be 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -9,6 +9,7 @@ title: Documentation for the cwiki Generator | generator name | cwiki | pass this to the generate command after -g | | generator stability | STABLE | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Generates confluence wiki markup. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index 0bb7adfd786..d247192fd97 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -10,6 +10,7 @@ title: Documentation for the dart-dio-next Generator | generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Dart | | +| generator default templating engine | mustache | | | helpTxt | Generates a Dart Dio client library with null-safety. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 00aa3d7e869..b94bed6bcc7 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -10,6 +10,7 @@ title: Documentation for the dart-dio Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Dart | | +| generator default templating engine | mustache | | | helpTxt | Generates a Dart Dio client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index aa68db809fe..0f6aed48cbe 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -10,6 +10,7 @@ title: Documentation for the dart-jaguar Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Dart | | +| generator default templating engine | mustache | | | helpTxt | Generates a Dart Jaguar client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 190fd2cd8ae..5c8c4ffac8b 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -10,6 +10,7 @@ title: Documentation for the dart Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Dart | | +| generator default templating engine | mustache | | | helpTxt | Generates a Dart 2.x client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index d7c58fc6869..e9d3b13c8d0 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -9,6 +9,7 @@ title: Documentation for the dynamic-html Generator | generator name | dynamic-html | pass this to the generate command after -g | | generator stability | STABLE | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Generates a dynamic HTML site. | | ## CONFIG OPTIONS diff --git a/docs/generators/eiffel.md b/docs/generators/eiffel.md index c462e16da44..ff72e722de9 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -10,6 +10,7 @@ title: Documentation for the eiffel Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Eiffel | | +| generator default templating engine | mustache | | | helpTxt | Generates a Eiffel client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index a71bf4df0a7..6bd748e76ae 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -10,6 +10,7 @@ title: Documentation for the elixir Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Elixir | | +| generator default templating engine | mustache | | | helpTxt | Generates an elixir client library (alpha). | | ## CONFIG OPTIONS diff --git a/docs/generators/elm.md b/docs/generators/elm.md index 99ddd6afb20..78b5e8ef63e 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -10,6 +10,7 @@ title: Documentation for the elm Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Elm | | +| generator default templating engine | mustache | | | helpTxt | Generates an Elm client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/erlang-client.md b/docs/generators/erlang-client.md index 31c0a53e805..f1708efec37 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -10,6 +10,7 @@ title: Documentation for the erlang-client Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Erlang | | +| generator default templating engine | mustache | | | helpTxt | Generates an Erlang client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 08ca60c92f1..ead391057ce 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -10,6 +10,7 @@ title: Documentation for the erlang-proper Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Erlang | | +| generator default templating engine | mustache | | | helpTxt | Generates an Erlang library with PropEr generators (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/erlang-server.md b/docs/generators/erlang-server.md index 77677a3d6c1..944c2be8ced 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -10,6 +10,7 @@ title: Documentation for the erlang-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Erlang | | +| generator default templating engine | mustache | | | helpTxt | Generates an Erlang server library (beta) using OpenAPI Generator (https://openapi-generator.tech). By default, it will also generate service classes, which can be disabled with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/flash-deprecated.md b/docs/generators/flash-deprecated.md index 1ac45d4a6d3..7969d5f8e0e 100644 --- a/docs/generators/flash-deprecated.md +++ b/docs/generators/flash-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the flash-deprecated Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Flash | | +| generator default templating engine | mustache | | | helpTxt | Generates a Flash (ActionScript) client library (beta). IMPORTANT: this generator has been deprecated in v5.x | | ## CONFIG OPTIONS diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index 80f49c5c4f4..dbb88f99e33 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -10,6 +10,7 @@ title: Documentation for the fsharp-functions Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | F# | | +| generator default templating engine | mustache | | | helpTxt | Generates a fsharp-functions server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/fsharp-giraffe-server.md b/docs/generators/fsharp-giraffe-server.md index 289cf42a68a..8c98bc32942 100644 --- a/docs/generators/fsharp-giraffe-server.md +++ b/docs/generators/fsharp-giraffe-server.md @@ -10,6 +10,7 @@ title: Documentation for the fsharp-giraffe-server Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | F# | | +| generator default templating engine | mustache | | | helpTxt | Generates a F# Giraffe server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/go-deprecated.md b/docs/generators/go-deprecated.md index 978447f56b9..e72c7b7f847 100644 --- a/docs/generators/go-deprecated.md +++ b/docs/generators/go-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the go-deprecated Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Go | | +| generator default templating engine | mustache | | | helpTxt | Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead. | | ## CONFIG OPTIONS diff --git a/docs/generators/go-echo-server.md b/docs/generators/go-echo-server.md index dc3fd01982d..7e638bc7c67 100644 --- a/docs/generators/go-echo-server.md +++ b/docs/generators/go-echo-server.md @@ -10,6 +10,7 @@ title: Documentation for the go-echo-server Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Go | | +| generator default templating engine | mustache | | | helpTxt | Generates a go-echo server. (Beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/go-gin-server.md b/docs/generators/go-gin-server.md index d7989246b6b..035d0bfeda3 100644 --- a/docs/generators/go-gin-server.md +++ b/docs/generators/go-gin-server.md @@ -10,6 +10,7 @@ title: Documentation for the go-gin-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Go | | +| generator default templating engine | mustache | | | helpTxt | Generates a Go server library with the gin framework using OpenAPI-Generator.By default, it will also generate service classes. | | ## CONFIG OPTIONS diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index f17d5eb1106..d57d712e154 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -10,6 +10,7 @@ title: Documentation for the go-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Go | | +| generator default templating engine | mustache | | | helpTxt | Generates a Go server library using OpenAPI-Generator. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/go.md b/docs/generators/go.md index 066b561c154..782f6f05abd 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -10,6 +10,7 @@ title: Documentation for the go Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Go | | +| generator default templating engine | mustache | | | helpTxt | Generates a Go client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index 593c0488ded..a1ab7ae06e9 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -10,6 +10,7 @@ title: Documentation for the graphql-nodejs-express-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Javascript | | +| generator default templating engine | mustache | | | helpTxt | Generates a GraphQL Node.js Express server (beta) including it's types, queries, mutations, (resolvers) | | ## CONFIG OPTIONS diff --git a/docs/generators/graphql-schema.md b/docs/generators/graphql-schema.md index bb2fb950265..84837ae7c6f 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -10,6 +10,7 @@ title: Documentation for the graphql-schema Generator | generator stability | STABLE | | | generator type | SCHEMA | | | generator language | GraphQL | | +| generator default templating engine | mustache | | | helpTxt | Generates GraphQL schema files (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 2506900b8f3..06b15957dde 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -10,6 +10,7 @@ title: Documentation for the groovy Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Groovy | | +| generator default templating engine | mustache | | | helpTxt | Generates a Groovy API client. | | ## CONFIG OPTIONS diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 13d7e7b478d..50fe695fa91 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -10,6 +10,7 @@ title: Documentation for the haskell-http-client Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Haskell | | +| generator default templating engine | mustache | | | helpTxt | Generates a Haskell http-client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index f1bc1a3e40e..fcb8ce3d49c 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -10,6 +10,7 @@ title: Documentation for the haskell-yesod Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Haskell | | +| generator default templating engine | mustache | | | helpTxt | Generates a haskell-yesod server. | | ## CONFIG OPTIONS diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index cd49e615f46..4ac8e5c7fbf 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -10,6 +10,7 @@ title: Documentation for the haskell Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Haskell | | +| generator default templating engine | mustache | | | helpTxt | Generates a Haskell server and client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/html.md b/docs/generators/html.md index 056f8ccb7bd..fe176f2cc73 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -9,6 +9,7 @@ title: Documentation for the html Generator | generator name | html | pass this to the generate command after -g | | generator stability | STABLE | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Generates a static HTML file. | | ## CONFIG OPTIONS diff --git a/docs/generators/html2.md b/docs/generators/html2.md index d4fa263b979..92f3425056f 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -9,6 +9,7 @@ title: Documentation for the html2 Generator | generator name | html2 | pass this to the generate command after -g | | generator stability | STABLE | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Generates a static HTML file. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index c0ebb548e2e..4a8a1392133 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -10,6 +10,7 @@ title: Documentation for the java-camel Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Camel server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index dfd33352a15..50f1bfb4817 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -10,6 +10,7 @@ title: Documentation for the java-inflector Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Inflector Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index de17d8a6593..00bb283b8c7 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -10,6 +10,7 @@ title: Documentation for the java-micronaut-client Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Micronaut Client. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 8bcecf519c6..b02b75270d8 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -10,6 +10,7 @@ title: Documentation for the java-msf4j Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Micro Service based on WSO2 Microservices Framework for Java (MSF4J) | | ## CONFIG OPTIONS diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index cb1dd0866f5..4e1183c50be 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -10,6 +10,7 @@ title: Documentation for the java-pkmst Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a PKMST SpringBoot Server application using the SpringFox integration. Also enables EurekaServerClient / Zipkin / Spring-Boot admin | | ## CONFIG OPTIONS diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 444b2b3f08b..b262f6e4442 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -10,6 +10,7 @@ title: Documentation for the java-play-framework Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Play Framework Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 7800643d463..e8c9d5c33bc 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -10,6 +10,7 @@ title: Documentation for the java-undertow-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Undertow Server application (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 83d720aedfa..24fe9e99f2b 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -10,6 +10,7 @@ title: Documentation for the java-vertx-web Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Vert.x-Web Server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 98b7527553e..873382854ae 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -10,6 +10,7 @@ title: Documentation for the java-vertx Generator | generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a java-Vert.X Server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/java.md b/docs/generators/java.md index 719a6645747..132437fd9bd 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -10,6 +10,7 @@ title: Documentation for the java Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java client library (HTTP lib: Jersey (1.x, 2.x), Retrofit (2.x), OpenFeign (10.x) and more. | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 3e1091b4d65..e91486057e1 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -10,6 +10,7 @@ title: Documentation for the javascript-apollo Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | Javascript | | +| generator default templating engine | mustache | | | helpTxt | Generates a JavaScript client library (beta) using Apollo RESTDatasource. | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 054f051f232..2f78d0e865e 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -10,6 +10,7 @@ title: Documentation for the javascript-closure-angular Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Javascript | | +| generator default templating engine | mustache | | | helpTxt | Generates a Javascript AngularJS client library (beta) annotated with Google Closure Compiler annotations(https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en) | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 0fb54da17cd..48e249aa7f6 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -10,6 +10,7 @@ title: Documentation for the javascript-flowtyped Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Javascript | | +| generator default templating engine | mustache | | | helpTxt | Generates a Javascript client library (beta) using Flow types and Fetch API. | | ## CONFIG OPTIONS diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index f4d7273d1e8..aa5f7aaaca6 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -10,6 +10,7 @@ title: Documentation for the javascript Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Javascript | | +| generator default templating engine | mustache | | | helpTxt | Generates a JavaScript client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 5730e2350d7..4388a69e60c 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-cxf-cdi Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an Apache CXF runtime and a Java EE runtime with CDI enabled. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index efe13a9fc6e..6d53881cb17 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-cxf-client Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS Client based on Apache CXF framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 02c43fd4390..65495572e1f 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-cxf-extended Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Extends jaxrs-cxf with options to generate a functional mock server. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index fbb1f8066a5..1818ba5b42e 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-cxf Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS Server application based on Apache CXF framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 4a882e778e2..aa4bf2ebf96 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-jersey Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS Server application based on Jersey framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 9bac2055e79..a3ed32580ca 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-resteasy-eap Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS-Resteasy Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index f9600dc744c..6ff30a6051e 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-resteasy Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS-Resteasy Server application. | | ## CONFIG OPTIONS diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 2f6a30961ac..9c8059ccd14 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -10,6 +10,7 @@ title: Documentation for the jaxrs-spec Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java JAXRS Server according to JAXRS 2.0 specification. | | ## CONFIG OPTIONS diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 3f3b3545862..83b447c9732 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -10,6 +10,7 @@ title: Documentation for the jmeter Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a JMeter .jmx file. | | ## CONFIG OPTIONS diff --git a/docs/generators/k6.md b/docs/generators/k6.md index f26f01cfa31..8cbeda61021 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -10,6 +10,7 @@ title: Documentation for the k6 Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | k6 | | +| generator default templating engine | mustache | | | helpTxt | Generates a k6 script (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md index d2d71faffd8..3e7884c9e66 100644 --- a/docs/generators/kotlin-server-deprecated.md +++ b/docs/generators/kotlin-server-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the kotlin-server-deprecated Generator | generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | Kotlin | | +| generator default templating engine | mustache | | | helpTxt | Generates a Kotlin server (Ktor v1.1.3). IMPORTANT: this generator has been deprecated. Please migrate to `kotlin-server` which supports Ktor v1.5.2+. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 8e48bda46da..4d79d17024f 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -10,6 +10,7 @@ title: Documentation for the kotlin-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Kotlin | | +| generator default templating engine | mustache | | | helpTxt | Generates a Kotlin server. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index a773df36b05..20a0ab7cd69 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -10,6 +10,7 @@ title: Documentation for the kotlin-spring Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Kotlin | | +| generator default templating engine | mustache | | | helpTxt | Generates a Kotlin Spring application. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 17c3415382c..123104743a0 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -10,6 +10,7 @@ title: Documentation for the kotlin-vertx Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Kotlin | | +| generator default templating engine | mustache | | | helpTxt | Generates a kotlin-vertx server. | | ## CONFIG OPTIONS diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index a942e2e3f9b..64c36540bea 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -10,6 +10,7 @@ title: Documentation for the kotlin Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Kotlin | | +| generator default templating engine | mustache | | | helpTxt | Generates a Kotlin client. | | ## CONFIG OPTIONS diff --git a/docs/generators/ktorm-schema.md b/docs/generators/ktorm-schema.md index f7ff70e5590..4ee60417519 100644 --- a/docs/generators/ktorm-schema.md +++ b/docs/generators/ktorm-schema.md @@ -10,6 +10,7 @@ title: Documentation for the ktorm-schema Generator | generator stability | BETA | | | generator type | SCHEMA | | | generator language | Ktorm | | +| generator default templating engine | mustache | | | helpTxt | Generates a kotlin-ktorm schema (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/lua.md b/docs/generators/lua.md index 18ec54ad4c0..cf2ece49ed1 100644 --- a/docs/generators/lua.md +++ b/docs/generators/lua.md @@ -10,6 +10,7 @@ title: Documentation for the lua Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | Lua | | +| generator default templating engine | mustache | | | helpTxt | Generates a Lua client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 71e1e6ac51a..c930ef6fd68 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -9,6 +9,7 @@ title: Documentation for the markdown Generator | generator name | markdown | pass this to the generate command after -g | | generator stability | BETA | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Generates a markdown documentation. | | ## CONFIG OPTIONS diff --git a/docs/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 1abe0062392..656452b91a6 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -10,6 +10,7 @@ title: Documentation for the mysql-schema Generator | generator stability | STABLE | | | generator type | SCHEMA | | | generator language | Mysql | | +| generator default templating engine | mustache | | | helpTxt | Generates a MySQL schema based on the model or schema defined in the OpenAPI specification (v2, v3). | | ## CONFIG OPTIONS diff --git a/docs/generators/nim.md b/docs/generators/nim.md index fa582893419..2cf0c86e25a 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -10,6 +10,7 @@ title: Documentation for the nim Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | Nim | | +| generator default templating engine | mustache | | | helpTxt | Generates a nim client (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index 62d154361a4..ec3e45fa4ee 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -10,6 +10,7 @@ title: Documentation for the nodejs-express-server Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Javascript | | +| generator default templating engine | mustache | | | helpTxt | Generates a NodeJS Express server (alpha). IMPORTANT: this generator may subject to breaking changes without further notice). | | ## CONFIG OPTIONS diff --git a/docs/generators/objc.md b/docs/generators/objc.md index f15b6bcb49f..b76a06f29a3 100644 --- a/docs/generators/objc.md +++ b/docs/generators/objc.md @@ -10,6 +10,7 @@ title: Documentation for the objc Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Objective-C | | +| generator default templating engine | mustache | | | helpTxt | Generates an Objective-C client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index eaa087b13c6..fec524c3f16 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -10,6 +10,7 @@ title: Documentation for the ocaml Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | OCaml | | +| generator default templating engine | mustache | | | helpTxt | Generates an OCaml client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index c12743b4383..854f487d343 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -9,6 +9,7 @@ title: Documentation for the openapi-yaml Generator | generator name | openapi-yaml | pass this to the generate command after -g | | generator stability | STABLE | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Creates a static openapi.yaml file (OpenAPI spec v3). | | ## CONFIG OPTIONS diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index f6ea2597cf0..75573383de4 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -9,6 +9,7 @@ title: Documentation for the openapi Generator | generator name | openapi | pass this to the generate command after -g | | generator stability | STABLE | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Creates a static openapi.json file (OpenAPI spec v3.0). | | ## CONFIG OPTIONS diff --git a/docs/generators/perl.md b/docs/generators/perl.md index 8a2245c05dd..9fd91025c36 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -10,6 +10,7 @@ title: Documentation for the perl Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Perl | | +| generator default templating engine | mustache | | | helpTxt | Generates a Perl client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index 3642ebb5f0a..ad004234dcc 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -10,6 +10,7 @@ title: Documentation for the php-dt Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP client relying on Data Transfer ( https://github.com/Articus/DataTransfer ) and compliant with PSR-7, PSR-11, PSR-17 and PSR-18. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index 8a62c49894b..bdce19bad5e 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -10,6 +10,7 @@ title: Documentation for the php-laravel Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP laravel server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 54148245f77..ad7f5afc061 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -10,6 +10,7 @@ title: Documentation for the php-lumen Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP Lumen server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 3905506371f..18854d244ef 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -10,6 +10,7 @@ title: Documentation for the php-mezzio-ph Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates PHP server stub using Mezzio ( https://docs.mezzio.dev/mezzio/ ) and Path Handler ( https://github.com/Articus/PathHandler ). | | ## CONFIG OPTIONS diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index ed0b98d2907..38d5c63f112 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the php-silex-deprecated Generator | generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP Silex server library. IMPORTANT NOTE: this generator is no longer actively maintained. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index a3f433a625b..4163fda38ef 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the php-slim-deprecated Generator | generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP Slim Framework server library. IMPORTANT NOTE: this generator (Slim 3.x) is no longer actively maintained so please use 'php-slim4' generator instead. | | ## CONFIG OPTIONS diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index cd8ab1f3468..0c56d968d14 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -10,6 +10,7 @@ title: Documentation for the php-slim4 Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP Slim 4 Framework server library(with Mock server). | | ## CONFIG OPTIONS diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 22184a49be2..e602a0570af 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -10,6 +10,7 @@ title: Documentation for the php-symfony Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP Symfony server bundle. | | ## CONFIG OPTIONS diff --git a/docs/generators/php.md b/docs/generators/php.md index fc04a4b5d81..f7a74f48c6a 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -10,6 +10,7 @@ title: Documentation for the php Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | PHP | | +| generator default templating engine | mustache | | | helpTxt | Generates a PHP client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index 51dee6f7e47..033b995b72b 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -9,6 +9,7 @@ title: Documentation for the plantuml Generator | generator name | plantuml | pass this to the generate command after -g | | generator stability | BETA | | | generator type | DOCUMENTATION | | +| generator default templating engine | mustache | | | helpTxt | Generates a plantuml documentation. | | ## CONFIG OPTIONS diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index 4c56c6e27fa..f35ad8599ac 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -10,6 +10,7 @@ title: Documentation for the powershell Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | PowerShell | | +| generator default templating engine | mustache | | | helpTxt | Generates a PowerShell API client (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index 913489defe9..eb8d398cba9 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -10,6 +10,7 @@ title: Documentation for the protobuf-schema Generator | generator stability | BETA | | | generator type | SCHEMA | | | generator language | Protocol Buffers (Protobuf) | | +| generator default templating engine | mustache | | | helpTxt | Generates gRPC and protocol buffer schema files (beta) | | ## CONFIG OPTIONS diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 7578a6be290..0fea01b13bd 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -11,6 +11,7 @@ title: Documentation for the python-aiohttp Generator | generator type | SERVER | | | generator language | Python | | | generator language version | 3.5.2+ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 1759a675b6c..2445094ea2f 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -11,6 +11,7 @@ title: Documentation for the python-blueplanet Generator | generator type | SERVER | | | generator language | Python | | | generator language version | 2.7+ and 3.5.2+ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 0d46556daf7..956038d2ac0 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -11,6 +11,7 @@ title: Documentation for the python-experimental Generator | generator type | CLIENT | | | generator language | Python | | | generator language version | >=3.9 | | +| generator default templating engine | handlebars | | | helpTxt | Generates a Python client library

Features in this generator:
- type hints on endpoints and model creation
- model parameter names use the spec defined keys and cases
- robust composition (oneOf/anyOf/allOf) where paload data is stored in one instance only
- endpoint parameter names use the spec defined keys and cases
- inline schemas are supported at any location including composition
- multiple content types supported in request body and response bodies
- run time type checking
- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema
- quicker load time for python modules (a single endpoint can be imported and used without loading others)
- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed
- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)
- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor
- Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | | ## CONFIG OPTIONS diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index 2464a81f1bc..163a85e5041 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -11,6 +11,7 @@ title: Documentation for the python-fastapi Generator | generator type | SERVER | | | generator language | Python | | | generator language version | 3.7 | | +| generator default templating engine | mustache | | | helpTxt | Generates a Python FastAPI server (beta). Models are defined with the pydantic library | | ## CONFIG OPTIONS diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index 21e2ab52495..8cf4ec6e7a9 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -11,6 +11,7 @@ title: Documentation for the python-flask Generator | generator type | SERVER | | | generator language | Python | | | generator language version | 2.7 and 3.5.2+ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Python server library using the Connexion project. By default, it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable. | | ## CONFIG OPTIONS diff --git a/docs/generators/python-legacy.md b/docs/generators/python-legacy.md index 8b4a7e2a948..08c0c42c002 100644 --- a/docs/generators/python-legacy.md +++ b/docs/generators/python-legacy.md @@ -11,6 +11,7 @@ title: Documentation for the python-legacy Generator | generator type | CLIENT | | | generator language | Python | | | generator language version | 2.7 and 3.4+ | | +| generator default templating engine | mustache | | | helpTxt | Generates a Python client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/python.md b/docs/generators/python.md index b6a2df4f9c2..1910f46d544 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -11,6 +11,7 @@ title: Documentation for the python Generator | generator type | CLIENT | | | generator language | Python | | | generator language version | >=3.6 | | +| generator default templating engine | mustache | | | helpTxt | Generates a Python client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/r.md b/docs/generators/r.md index b5eef889bfa..d034e862078 100644 --- a/docs/generators/r.md +++ b/docs/generators/r.md @@ -10,6 +10,7 @@ title: Documentation for the r Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | R | | +| generator default templating engine | mustache | | | helpTxt | Generates a R client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index 84b67956163..ecb8a858a81 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -10,6 +10,7 @@ title: Documentation for the ruby-on-rails Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Ruby | | +| generator default templating engine | mustache | | | helpTxt | Generates a Ruby on Rails (v5) server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index 56aff137de1..a9655ea8e53 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -10,6 +10,7 @@ title: Documentation for the ruby-sinatra Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Ruby | | +| generator default templating engine | mustache | | | helpTxt | Generates a Ruby Sinatra server library. | | ## CONFIG OPTIONS diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index c635612e090..f0188be575f 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -10,6 +10,7 @@ title: Documentation for the ruby Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Ruby | | +| generator default templating engine | mustache | | | helpTxt | Generates a Ruby client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md index d894959db87..52f2b52909d 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -10,6 +10,7 @@ title: Documentation for the rust-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Rust | | +| generator default templating engine | mustache | | | helpTxt | Generates a Rust client/server library (beta) using the openapi-generator project. | | ## CONFIG OPTIONS diff --git a/docs/generators/rust.md b/docs/generators/rust.md index cc2f93c4b89..0f45ded3438 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -10,6 +10,7 @@ title: Documentation for the rust Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Rust | | +| generator default templating engine | mustache | | | helpTxt | Generates a Rust client library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 172d71db74f..3cbb4c8fb1d 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -10,6 +10,7 @@ title: Documentation for the scala-akka-http-server Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a scala-akka-http server (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index b3a160f5dea..b6ba593dcc4 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -10,6 +10,7 @@ title: Documentation for the scala-akka Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scala client library (beta) base on Akka/Spray. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-finch.md b/docs/generators/scala-finch.md index 2b732d98f07..5ace1e1652f 100644 --- a/docs/generators/scala-finch.md +++ b/docs/generators/scala-finch.md @@ -10,6 +10,7 @@ title: Documentation for the scala-finch Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scala server application with Finch. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 51e3084079c..e3be5dfa0b5 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -10,6 +10,7 @@ title: Documentation for the scala-gatling Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a gatling simulation library (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index 3b7d7a9ef28..35d8e770dbe 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the scala-httpclient-deprecated Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scala client library (beta). IMPORTANT: This generator is no longer actively maintained and will be deprecated. PLease use 'scala-akka' generator instead. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index bc8984497d1..0014d87fedb 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -10,6 +10,7 @@ title: Documentation for the scala-lagom-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Lagom API server (Beta) in scala | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index 4a78dfb8271..58562232a92 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -10,6 +10,7 @@ title: Documentation for the scala-play-server Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scala server application (beta) with Play Framework. | | ## CONFIG OPTIONS diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index d1ef1d48cdc..ad67f76194d 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -10,6 +10,7 @@ title: Documentation for the scala-sttp Generator | generator stability | BETA | | | generator type | CLIENT | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scala client library (beta) based on Sttp. | | ## CONFIG OPTIONS diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index 03a957f6ef8..2a8b10482dc 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -10,6 +10,7 @@ title: Documentation for the scalatra Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scala server application with Scalatra. | | ## CONFIG OPTIONS diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 81af6b8eb8f..6916c86fe9f 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -10,6 +10,7 @@ title: Documentation for the scalaz Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Scala | | +| generator default templating engine | mustache | | | helpTxt | Generates a Scalaz client library (beta) that uses http4s | | ## CONFIG OPTIONS diff --git a/docs/generators/spring.md b/docs/generators/spring.md index c06ac0fa707..d778596fbf1 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -10,6 +10,7 @@ title: Documentation for the spring Generator | generator stability | STABLE | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java SpringBoot Server application using the SpringFox integration. | | ## CONFIG OPTIONS diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md index f2eaf80a50b..dd39ea98776 100644 --- a/docs/generators/swift4-deprecated.md +++ b/docs/generators/swift4-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the swift4-deprecated Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Swift | | +| generator default templating engine | mustache | | | helpTxt | Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.) | | ## CONFIG OPTIONS diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 4183ade7215..5f79e7ae5c3 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -10,6 +10,7 @@ title: Documentation for the swift5 Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Swift | | +| generator default templating engine | mustache | | | helpTxt | Generates a Swift 5.x client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index b92521c6a3e..29e49049c07 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-angular Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript Angular (6.x - 13.x) client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index 5f9e08c77c4..1097c4cd2f5 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-angularjs-deprecated Generator | generator stability | DEPRECATED | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript AngularJS client library. This generator has been deprecated and will be removed in the future release. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index eb24409651a..1acd1fca031 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-aurelia Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript client library for the Aurelia framework (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 05e51236f5e..0bbf056acc1 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-axios Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript client library using axios. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index bdd09c09525..b0a8a58c143 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-fetch Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript client library using Fetch API (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index c79ad504731..a6df7b68414 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-inversify Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates Typescript services using Inversify IOC | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 4cdac527636..f9614b9384f 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-jquery Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript jquery client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index bfab1479590..0e00ef4f247 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-nestjs Generator | generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript Nestjs 6.x client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index f017b86055f..54dcee73307 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-node Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript NodeJS client library. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index c7d325a40fa..f219e8a3e5e 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-redux-query Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript client library using redux-query API (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 2e4febab52a..93aca0c5f81 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -10,6 +10,7 @@ title: Documentation for the typescript-rxjs Generator | generator stability | STABLE | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript client library using Rxjs API. | | ## CONFIG OPTIONS diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index 4172f40be71..4ce5f1ba11a 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -10,6 +10,7 @@ title: Documentation for the typescript Generator | generator stability | EXPERIMENTAL | | | generator type | CLIENT | | | generator language | Typescript | | +| generator default templating engine | mustache | | | helpTxt | Generates a TypeScript client library using Fetch API (beta). | | ## CONFIG OPTIONS diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index b0ec6860192..e54072e7335 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -10,6 +10,7 @@ title: Documentation for the wsdl-schema Generator | generator stability | BETA | | | generator type | SCHEMA | | | generator language | Web Services Description Language (WSDL) | | +| generator default templating engine | mustache | | | helpTxt | Generates WSDL files. | | ## CONFIG OPTIONS diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 73858d84691..3bfd97c90a4 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -311,6 +311,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand { if (config.generatorLanguageVersion() != null) { sb.append("| generator language version | "+config.generatorLanguageVersion()+" | |").append(newline); } + sb.append("| generator default templating engine | "+config.defaultTemplatingEngine()+" | |").append(newline); sb.append("| helpTxt | "+config.getHelp()+" | |").append(newline); sb.append(newline); 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 e2feddb9822..64e426fa68a 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 @@ -46,7 +46,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 boolean DEFAULT_GENERATE_ALIAS_AS_MODEL = false; - public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; + public static final String DEFAULT_TEMPLATING_ENGINE_NAME = null; // this is set by the generator public static final Map DEFAULT_GLOBAL_PROPERTIES = Collections.unmodifiableMap(new HashMap<>()); private String inputSpec; 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 2207e3170fb..952d3a841f2 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 @@ -305,6 +305,8 @@ public interface CodegenConfig { Schema unaliasSchema(Schema schema, Map usedImportMappings); + public String defaultTemplatingEngine(); + public GeneratorLanguage generatorLanguage(); /* 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 3270e831c62..1ff9e2ddd09 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 @@ -7384,6 +7384,11 @@ public class DefaultCodegen implements CodegenConfig { return xOf; } + @Override + public String defaultTemplatingEngine() { + return "mustache"; + } + @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.JAVA; } 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 b5bd0b23c33..2bb65a47865 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 @@ -79,8 +79,8 @@ public class CodegenConfigurator { } - @SuppressWarnings("DuplicatedCode") public static CodegenConfigurator fromFile(String configFile, Module... modules) { + // NOTE: some config parameters may be missing from the configFile and may be passed in as command line args if (isNotEmpty(configFile)) { DynamicSettings settings = readDynamicSettings(configFile, modules); @@ -482,15 +482,17 @@ public class CodegenConfigurator { Validate.notEmpty(generatorName, "generator name must be specified"); Validate.notEmpty(inputSpec, "input spec must be specified"); + GeneratorSettings generatorSettings = generatorSettingsBuilder.build(); + CodegenConfig config = CodegenConfigLoader.forName(generatorSettings.getGeneratorName()); if (isEmpty(templatingEngineName)) { - // Built-in templates are mustache, but allow users to use a simplified handlebars engine for their custom templates. - workflowSettingsBuilder.withTemplatingEngineName("mustache"); + // if templatingEngineName is empty check the config for a default + String defaultTemplatingEngine = config.defaultTemplatingEngine(); + workflowSettingsBuilder.withTemplatingEngineName(defaultTemplatingEngine); } else { workflowSettingsBuilder.withTemplatingEngineName(templatingEngineName); } // at this point, all "additionalProperties" are set, and are now immutable per GeneratorSettings instance. - GeneratorSettings generatorSettings = generatorSettingsBuilder.build(); WorkflowSettings workflowSettings = workflowSettingsBuilder.build(); if (workflowSettings.isVerbose()) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java index ca237e47eca..5424080f0d7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonExperimentalClientCodegen.java @@ -2086,6 +2086,11 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen { return co; } + @Override + public String defaultTemplatingEngine() { + return "handlebars"; + } + @Override public String generatorLanguageVersion() { return ">=3.9"; }; } From e9d69f2b45a079e2800f655ebd38e79e415dd08d Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 23 Jan 2022 18:42:27 -0800 Subject: [PATCH 078/113] [java] javaparser 3.24.0 (#11382) --- modules/openapi-generator/pom.xml | 2 +- .../org/openapitools/codegen/TestUtils.java | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 2efa246d044..e7fd2c138e9 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -338,7 +338,7 @@ com.github.javaparser javaparser-core - 3.14.11 + 3.24.0 test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index 7c7ee64361d..337f0c73a82 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -5,8 +5,9 @@ import static org.testng.Assert.fail; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertFalse; -import com.github.javaparser.ParseProblemException; -import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.JavaParser; +import com.github.javaparser.ParserConfiguration; +import com.github.javaparser.ParseResult; import com.github.javaparser.ast.CompilationUnit; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.Components; @@ -150,13 +151,11 @@ public class TestUtils { } public static void assertValidJavaSourceCode(String javaSourceCode, String filename) { - try { - CompilationUnit compilation = StaticJavaParser.parse(javaSourceCode); - assertTrue(compilation.getTypes().size() > 0, "File: " + filename); - } - catch (ParseProblemException ex) { - fail("Java parse problem: " + filename, ex); - } + ParserConfiguration config = new ParserConfiguration(); + config.setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_11); + JavaParser parser = new JavaParser(config); + ParseResult parseResult = parser.parse(javaSourceCode); + assertTrue(parseResult.isSuccessful(), String.valueOf(parseResult.getProblems())); } public static void assertFileContains(Path path, String... lines) { From 57e3ed293021872ec2cddea80ce5f13c52145371 Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 23 Jan 2022 18:46:07 -0800 Subject: [PATCH 079/113] [java] JavaClientCodegenTest validateJavaSourceFiles (#11379) --- .../codegen/java/JavaClientCodegenTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 4b2f0b6e4a0..47b490e46ef 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -585,6 +585,8 @@ public class JavaClientCodegenTest { generator.setGenerateMetadata(false); List files = generator.opts(clientOptInput).generate(); + validateJavaSourceFiles(files); + Assert.assertEquals(files.size(), 1); files.forEach(File::deleteOnExit); } @@ -678,6 +680,8 @@ public class JavaClientCodegenTest { List files = generator.opts(clientOptInput).generate(); files.forEach(File::deleteOnExit); + validateJavaSourceFiles(files); + Assert.assertEquals(files.size(), 1); TestUtils.ensureContainsFile(files, output, "src/main/java/org/openapitools/client/model/ParentType.java"); @@ -920,6 +924,7 @@ public class JavaClientCodegenTest { List files = generator.opts(configurator.toClientOptInput()).generate(); files.forEach(File::deleteOnExit); + validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); TestUtils.assertFileContains(defaultApi, @@ -968,6 +973,7 @@ public class JavaClientCodegenTest { List files = generator.opts(configurator.toClientOptInput()).generate(); files.forEach(File::deleteOnExit); + validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); TestUtils.assertFileContains(defaultApi, @@ -1046,6 +1052,7 @@ public class JavaClientCodegenTest { List files = generator.opts(configurator.toClientOptInput()).generate(); files.forEach(File::deleteOnExit); + validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); TestUtils.assertFileContains(defaultApi, @@ -1174,6 +1181,7 @@ public class JavaClientCodegenTest { List files = generator.opts(configurator.toClientOptInput()).generate(); files.forEach(File::deleteOnExit); + validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); TestUtils.assertFileContains(defaultApi, @@ -1245,6 +1253,8 @@ public class JavaClientCodegenTest { .generate(); files.forEach(File::deleteOnExit); + validateJavaSourceFiles(files); + final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); TestUtils.assertFileContains(defaultApi, "value instanceof Map"); } From 549715ebf2d3b0a92e1198b8be18a94ff04f301f Mon Sep 17 00:00:00 2001 From: aderito7 Date: Mon, 24 Jan 2022 05:12:59 +0200 Subject: [PATCH 080/113] [docs] use correct separator (#11386) --- docs/configuration.md | 2 +- modules/openapi-generator-gradle-plugin/README.adoc | 2 +- modules/openapi-generator-maven-plugin/README.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index aa7d1b5c9b2..b5590ec21ad 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -36,7 +36,7 @@ _How_ you provide values to options also depends on the tool. OpenAPI Generator openApiGenerate { globalProperties = [ apis: "", - models: "User,Pet" + models: "User:Pet" ] } ``` diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index f3ba58cc7c1..51f6e08e15f 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -398,7 +398,7 @@ openApiGenerate { // other settings omitted globalProperties = [ apis: "", - models: "User,Pet" + models: "User:Pet" ] } ---- diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index 9a9abb68620..be709bea8af 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -116,12 +116,12 @@ For configuration options documented as a **map** above, the key/value options m ``` This configuration node location will match that of the plugin configuration examples at the top of this document and in the section below. Here, `option` matches in option name in the first column in the table from the previous section. -The `key` and `value` text are any values you'd like to provide for that option. As an example, to configure `globalProperties` to match the `--global-property models=User,Pet` example from our [Selective Generation](https://openapi-generator.tech/docs/customization#selective-generation) documentation, see below. +The `key` and `value` text are any values you'd like to provide for that option. As an example, to configure `globalProperties` to match the `--global-property models=User:Pet` example from our [Selective Generation](https://openapi-generator.tech/docs/customization#selective-generation) documentation, see below. ```xml - User,Pet + User:Pet ``` @@ -131,7 +131,7 @@ Not that some of these environment variable options may overwrite or conflict wi ```xml true - User,Pet + User:Pet ``` From 0fc3f65ce33ff4b9074a325a05614655558fcc2a Mon Sep 17 00:00:00 2001 From: sullis Date: Sun, 23 Jan 2022 23:23:55 -0800 Subject: [PATCH 081/113] mockito 4.2.0 (#11387) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6df240be400..0dd62e012c4 100644 --- a/pom.xml +++ b/pom.xml @@ -1606,7 +1606,7 @@ 3.0.0 2.5.3 3.7.1 - 3.12.4 + 4.2.0 3.12.0 0.10 1.3 From 7f07fa5ba0ea933b2cc9f4b565b187bd521b09ca Mon Sep 17 00:00:00 2001 From: vanjur <41238964+vanjur@users.noreply.github.com> Date: Mon, 24 Jan 2022 02:38:19 -0600 Subject: [PATCH 082/113] [Python] Some regex patterns can generate invalid code. #6675 (#10920) * fix issue 6675 & add javadoc * fix formatting issue * update JUnit test for 6675 * build & update samples for PR * clean package and regenerating samples * add progress for fix to issue 10957 * Revert "add progress for fix to issue 10957" This reverts commit 8240c7ccb17141f7551ab34eda864ab4e068ebd8. * fix version issues * fix more versioning issues * fix discrepancies with backslashes * update samples Co-authored-by: William Cheng --- .../languages/PythonLegacyClientCodegen.java | 14 ++++++++++++++ .../python/PythonLegacyClientCodegenTest.java | 3 +++ .../src/test/resources/3_0/issue_1517.yaml | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java index 7fc09f0cbfa..bdaa9a06ef3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java @@ -311,6 +311,13 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python * does not support this in as natural a way so it needs to convert it. See * https://docs.python.org/2/howto/regex.html#compilation-flags for details. + * + * @param pattern (the String pattern to convert from python to Perl convention) + * @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/) + * @return void + * @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention + * + * Includes fix for issue #6675 */ public void postProcessPattern(String pattern, Map vendorExtensions) { if (pattern != null) { @@ -321,6 +328,13 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements throw new IllegalArgumentException("Pattern must follow the Perl " + "/pattern/modifiers convention. " + pattern + " is not valid."); } + + //check for instances of extra backslash that could cause compile issues and remove + int firstBackslash = pattern.indexOf("\\"); + int bracket = pattern.indexOf("["); + if (firstBackslash == 0 || firstBackslash == 1 || firstBackslash == bracket+1) { + pattern = pattern.substring(0,firstBackslash)+pattern.substring(firstBackslash+1); + } String regex = pattern.substring(1, i).replace("'", "\\'"); List modifiers = new ArrayList(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java index d3bff53a8ea..72dbdda27ab 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java @@ -91,6 +91,9 @@ public class PythonLegacyClientCodegenTest { Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/"); // pattern_with_modifiers '/^pattern\d{3}$/i Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i"); + // pattern_with_backslash_after_bracket '/^[\pattern\d{3}$/i' + // added to test fix for issue #6675 + Assert.assertEquals(op.allParams.get(6).pattern, "/^[\\pattern\\d{3}$/i"); } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_1517.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_1517.yaml index 038a637608f..788b46a6dd5 100644 --- a/modules/openapi-generator/src/test/resources/3_0/issue_1517.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/issue_1517.yaml @@ -45,6 +45,11 @@ paths: schema: type: string pattern: '/^pattern\d{3}$/i' + - name: pattern_with_backslash_after_bracket + in: header + schema: + type: string + pattern: '/^[\pattern\d{3}$/i' responses: '200': From a68babe86db3866241daf62c4b3727a6678e7d12 Mon Sep 17 00:00:00 2001 From: sullis Date: Mon, 24 Jan 2022 01:07:43 -0800 Subject: [PATCH 083/113] migrate to official Apache Maven Wrapper (#11381) https://maven.apache.org/wrapper/index.html https://github.com/apache/maven-wrapper-plugin --- .mvn/wrapper/maven-wrapper.jar | Bin 50710 -> 58727 bytes .mvn/wrapper/maven-wrapper.properties | 20 +++++++++++++++-- mvnw | 18 ++++++++++------ mvnw.cmd | 30 +++++++++++++++----------- 4 files changed, 48 insertions(+), 20 deletions(-) mode change 100755 => 100644 .mvn/wrapper/maven-wrapper.jar mode change 100755 => 100644 mvnw.cmd diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar old mode 100755 new mode 100644 index 2cc7d4a55c0cd0092912bf49ae38b3a9e3fd0054..c1dd12f17644411d6e840bd5a10c6ecda0175f18 GIT binary patch literal 58727 zcmb5W18`>1vNjyPv28mO+cqb*Z6_1kwr$(?#I}=(ZGUs`Jr}3`|DLbDUA3!L?dtC8 zUiH*ktDo+@6r@4HP=SCTA%WmZqm^Ro`Ls)bfPkcdfq?#g1(Fq27W^S8Cq^$TC?_c< zs-#ROD;6C)1wFuk7<3)nGuR^#!H;n&3*IjzXg+s8Z_S!!E0jUq(`}Itt=YdYa5Z_s z&e>2={87knpF*PKNzU;lsbk#P(l^WBvb$yEz)z+nYH43pKodrDkMp@h?;n{;K}hl>Fb^ zqx}C0|D7kg|Cj~3f7hn_zkAE}|6t|cZT|S5Hvb#3nc~C14u5UI{6#F<|FkJ0svs&S zA}S{=DXLT*BM1$`2rK%`D@vEw9l9%*=92X_2g?Fwfi=6Zfpr7+<~sgP#Bav+Df2ts zwtu~70zhqV?mrzM)}r7mMS`Hk_)NrI5K%CTtQtDxqw5iv5F0!ksIon{qqpPVnU?ds zN$|Vm{MHKEReUy>1kVfT-$3))Js0p2W_LFy3cjjZ7za0R zPdBH>y&pb0vr1|ckDpt2p$IQhwnPs5G*^b-y}sg4W!ALn}a`pY0JIa$H0$eV2T8WjWD= zWaENacQhlTyK4O!+aOXBurVR2k$eb8HVTCxy-bcHlZ4Xr!`juLAL#?t6|Ba!g9G4I zSwIt2Lla>C?C4wAZ8cKsZl9-Yd3kqE`%!5HlGdJJaFw0mu#--&**L-i|BcIdc3B$;0FC;FbE-dunVZ; zdIQ=tPKH4iJQQ=$5BeEMLov_Hn>gXib|9nOr}>eZt@B4W^m~>Zp#xhn1dax+?hS!AchWJ4makWZs@dQUeXQ zsI2+425_{X@t2KN zIbqec#)Jg5==VY3^YBeJ2B+%~^Y8|;F!mE8d(`UgNl2B9o>Ir5)qbBr)a?f%nrP zQyW(>FYPZjCVKDOU;Bw#PqPF1CCvp)dGdA&57a5hD&*vIc)jA)Z-!y5pS{5W6%#prH16zgD8s zexvpF#a|=*acp>L^lZ(PT)GiA8BJL-9!r8S$ZvXRKMVtiGe`+!@O%j<1!@msc177U zTDy>WOZu)W5anPrweQyjIu3IJC|ngdjZofGbdW&oj^DJlC7$;|xafB45evT|WBgGf-b|9y0J`fe0W-vw6xh}` z=(Tnq(-K0O{;VUcKe2y63{HXc+`R_#HLwnZ0rzWO*b#VeSuC4NG!H_ApCypbt1qx( z6y7Q$5(JOpQ&pTkc^0f}A0Kq*?;g9lEfzeE?5e2MBNZB)^8W1)YgdjsVyN+I9EZlh z3l}*}*)cFl=dOq|DvF=!ui$V%XhGQ%bDn3PK9 zV%{Y|VkAdt^d9~y4laGDqSwLd@pOnS&^@sI7}YTIb@El1&^_sq+{yAGf0|rq5TMp# z6d~;uAZ(fY3(eH=+rcbItl2=u6mf|P{lD4kiRCv;>GtFaHR3gim?WU9RjHmFZLm+m z+j<}_exaOQ1a}=K#voc~En+Mk_<(L!?1e#Uay~|H5q)LjD*yE6xFYQ-Wx{^iH1@pP zC0De#D6I26&W{;J40sZB!=%{c?XdO?YQvnTMA3TwfhAm@bvkX*(x?JTs*dFDv^=2X z284}AK)1nRn+8(Q2P?f)e>0~;NUI9%p%fnv1wBVpoXL+9OE`Vv1Y7=+nub$o7AN>y zB?R(^G8PYcMk4bxe7XItq@48QqWKb8fa*i9-N)=wdU-Q^=}!nFgTr_uT=Z=9pq z`{7!$U|+fnXFcsJ4GNm3JQQCN+G85k$)ZLhF{NbIy{REj84}Zt;0fe#>MARW)AoSb zrBpwF37ZVBMd>wZn_hAadI*xu8)Y#`aMbwRIA2n^-OS~M58_@j?#P1|PXJ1XBC9{4 zT^8*|xu<@(JlSOT*ILrVGr+7$nZN`Z3GxJJO@nY&mHsv^^duAh*lCu5q+S6zWA+`- z%^*y#)O7ko_RwGJl;bcEpP03FOrhlLWs`V_OUCrR-g>NJz*pN|itmN6O@Hw05Zq;Xtif%+sp4Py0{<7<^c zeoHHhRq>2EtYy9~2dZywm&OSk`u2ECWh6dJY?;fT-3-$U`!c(o$&hhPC%$~fT&bw3 zyj+8aXD;G!p*>BC6rpvx#6!|Qaic;KEv5>`Y+R(6F^1eIeYG6d1q3D3OL{7%7iw3R zwO)W7gMh27ASSB>-=OfP(YrKqBTNFv4hL@Im~~ombbSu44p~VoH$H-6+L_JW>Amkl zhDU~|r77?raaxD!-c$Ta?WAAi{w3T}YV=+S?1HQGC0+{Bny_^b+4Jum}oW4c=$ z#?D<}Ds{#d5v`L`${Pee;W84X*osNQ96xsKp^EAzuUh9#&zDX=eqdAp$UY)EGrkU% z(6m35n=46B$TNnejNSlih_!<)Iu@K!PW5S@Ya^0OK+EMWM=1w=GUKW^(r59U%i?d zzbo?|V4tDWGHHsrAQ}}ma#<`9r=M8%XF#%a=@Hn(p3wFBlkZ2L@8=*@J-^zuyF0aN zzJ7f!Jf8I+^6Tt$e+IIh zb80@?7y#Iz3w-0VEjgbHurqI>$qj<@n916)&O340!_5W9DtwR)P5mk6v2ljyK*DG5 zYjzE~m`>tq8HYXl%1JJ%e-%BqV4kRdPUZB1Cm$BQZr(fzp_@rn_W+;GwI$?L2Y4;b z)}c5D$#LT}2W8Si<`EHKIa_X+>+2PF(C*u~F=8E!jL(=IdQxY40%|( zoNg2Z&Aob@LEui-lJ#@)Ts)tE0_!*3{Uk)r{;-IZpX`N4mZX`#E|A;viQWImB6flI z?M_|xHCXV$5LOY-!U1_O1k;OWa=EchwlDCK4xHwBW2jE-6&%}og+9NILu${v10Z^Z#* zap|)B9a-AMU~>$r)3&|dQuP#MA$jnw54w*Ax~*_$iikp+j^OR8I5Fo<_UR#B-c>$? zeg)=;w^sGeAMi<3RGDRj$jA30Qq$e|zf2z;JyQ}tkU)ZI_k6tY%(`#AvL)p)iYXUy z5W9Su3NJ8mVyy)WqzFSk&vZM!;kUh8dVeA-myqcV%;xUne`PbHCPpvH?br`U2Y&dM zV!nJ!^n%`!H&!QSlpzLWnZpgi;#P0OAleH+<CfLa?&o|kyw1}W%6Pij zp$Vv5=;Z0LFN|j9i&9>zqX>*VnV3h#>n!2L?5gO6HJS3~kpy5G zYAVPMaB-FJOk3@OrxL(*-O~OB9^d{!G0K>wlzXuBm*$&%p1O#6SQ*?Q0CETLQ->XpfkW7< zj&Nep(}eAH1u$wWFvLV*lA{JOltP_%xKXC*a8DB&;{fD&2bATy>rC^kFY+$hFS7us;Y) zy_H?cv9XTHYz<4C<0b`WKC#{nJ15{F=oaq3x5}sYApT?Po+(Cmmo#dHZFO^{M#d~d znRT=TFATGVO%z_FNG-@G;9az|udZ>t@5l+A-K)BUWFn_|T#K3=d3EXRNqHyi#>;hX z*JQ`pT3#&tH>25laFlL6Rllu(seA*OboEd%rxMtz3@5v-+{qDP9&BcoS$2fgjgvp$ zc8!3=p0p@Ee1$u{Gg}Kkxg@M*qgZfYLlnD88{uwG1T?zxCbBR+x(RK$JB(eWJH#~; zZoY6L+esVRV?-*QmRCG}h`rB*Lv=uE%URF@+#l-g!Artx>Y9D;&G=jY2n2`J z{6-J%WX~Glx*QBmOOJ(RDRIzhfk&ibsm1t&&7aU{1P3U0uM%F2zJb4~50uby_ng+# zN)O9lK=dkJpxsUo7u8|e`Y~mmbxOTDn0i!i;d;ml#orN(Lc=j+n422NoSnlH6?0<0?th-qB7u}`5My%#?ES}>@RldOQz}WILz<$+cN~&ET zwUI01HCB((TyU$Ej8bxsE8oLmT-c7gA1Js?Iq`QMzIHV|)v)n2 zT_L(9x5%8*wU(C`VapaHoicWcm|0X@9TiNtbc|<4N6_H1F6&qgEEj=vjegFt;hC7- zLG7_=vedRFZ6Chbw!{#EpAlM?-sc#pc<~j#537n)M%RT)|L}y(ggi_-SLpsE3qi3V z=EEASxc>a{Su)jXcRS41Z@Mxk&0B7B<(?Izt5wpyyIBO|-M}ex8BhbIgi*X4 zDZ+Yk1<6&=PoZ=U-!9`!?sBVpYF#Y!JK<`fx}bXN651o0VVaW;t6ASVF@gq-mIDV_)?F^>rq1XX0NYy~(G=I6x%Fi5C2rMtvs z%P`g2>0{xLUy~#ye)%QAz^NkD5GUyPYl}K#;e-~UQ96`I$U0D!sMdQ>;%+c0h>k*Y z)sD1mi_@|rZnQ+zbWq~QxFlBQXj8WEY7NKaOYjUxAkGB8S#;l@b^C?;twRKl=mt0< zazifrBs`(q7_r14u1ZS`66VmsLpV>b5U!ktX>g4Nq~VPq6`%`3iCdr(>nS~uxxylU z>h(2p$XPJVh9BDpRLLzTDlNdp+oq8sOUlJ#{6boG`k)bwnsw5iy@#d{f_De-I|}vx6evw;ch97=;kLvM)-DBGwl6%fA%JItoMeyqjCR*_5Q70yd!KN zh=>ek8>f#~^6CJR0DXp0;7ifZjjSGBn}Cl{HeX!$iXMbtAU$F+;`%A<3TqbN#PCM& z&ueq$cB%pu2oMm_-@*aYzgn9`OiT@2ter*d+-$Aw42(@2Ng4mKG%M-IqX?q%3R|_( zN|&n$e1L#Ev=YMX5F53!O%))qDG3D(0rsOHblk;9ghWyqEOpg)mC$OduqpHAuIxr_>*|zy+|=EmOFn zFM+Ni%@CymLS-3vRWn=rVk?oZEz0V#y356IE6HR5#>7EigxZ05=cA|4<_tC8jyBJ| zgg!^kNwP7S^ooIj6riI9x`jFeQfRr4JCPumr<82M zto$j^Qb~MPmJ-|*2u{o7?yI8BI``zDaOCg2tG_5X;w<|uj5%oDthnLx-l4l)fmUGx z6N^jR|DC);yLi4q-ztTkf>*U$@2^w5(lhxu=OC|=WuTTp^!?2Nn27R`2FY_ zLHY-zFS}r+4|XyZw9b0D3)DmS!Gr+-LSdI}m{@-gL%^8CFSIYL?UZaCVd)2VI3|ay zwue39zshVrB+s2lp*};!gm<79@0HkjhgF^>`UhoR9Mi`aI#V#fI@x&1K3f&^8kaq% zkHVg$CTBoaGqEjrL)k*Y!rtiD2iQLYZ%|B}oBl8GHvR%n>HiIQN*+$mCN>I=c7H2N z&K4$4e@E^ff-cVHCbrHNMh4Dy|2Q;M{{xu|DYjeaRh2FK5QK!bG_K`kbBk$l$S4UF zq?F-%7UrX_Q?9M)a#WvcZ^R-fzJB5IFP>3uEoeCAAhN5W-ELRB&zsCnWY6#E?!)E56Pe+bxHjGF6;R9Hps)+t092-bf4 z_Wieg+0u5JL++k)#i0r?l`9*k)3ZlHOeMJ1DTdx9E1J2@BtdD3qX;&S_wMExOGv$T zl^T%oxb+)vq6vJvR`8{+YOsc@8}wSXpoK%v0k@8X*04Se3<8f)rE|fRXAoT!$6MdrKSuzeK@L*yug?MQs8oTbofqW)Df# zC2J3irHAaX_e~SGlBoRhEW`W6Z}&YX|5IMfzskAt{B*m z*w=3i!;x5Gfgc~>y9fPXFAPMhO@Si}SQESjh`P|dlV5HPRo7j(hV=$o8UMIT7~7+k z*@Sd>f%#{ARweJYhQs~ECpHie!~YXL|FJA;KS4m|CKFnT{fN`Ws>N?CcV@(>7WMPYN} z1}Wg+XU2(Yjpq7PJ|aSn;THEZ{4s8*@N!dz&bjys_Zk7%HiD+56;cF26`-a zEIo!B(T|L*uMXUvqJs&54`^@sUMtH-i~rOM9%$xGXTpmow$DxI>E5!csP zAHe|);0w%`I<==_Zw9t$e}?R+lIu%|`coRum(1p~*+20mBc?Z=$+z<0n&qS0-}|L4 zrgq|(U*eB%l3nfC=U1Y?(Tf@0x8bhdtsU2w&Y-WvyzkiyJ>GZqUP6c+<_p0`ZOnIK z#a~ynuzRWxO6c;S@*}B1pTjLJQHi(+EuE2;gG*p^Fq%6UoE1x95(^BY$H$$soSf=vpJ)_3E zp&$l=SiNaeoNLAK8x%XaHp3-So@F7 z3NMRRa@%k+Z$a%yb25ud&>Cdcb<+}n>=jZ`91)a z{wcA(j$%z#RoyB|&Z+B4%7Pe*No`pAX0Y;Ju4$wvJE{VF*Qej8C}uVF=xFpG^rY6Y+9mcz$T9^x(VP3uY>G3Zt&eU{pF*Bu<4j9MPbi4NMC=Z$kS6DMW9yN#vhM&1gd1t}8m(*YY9 zh2@s)$1p4yYT`~lYmU>>wKu+DhlnI1#Xn4(Rnv_qidPQHW=w3ZU!w3(@jO*f;4;h? zMH0!08(4=lT}#QA=eR(ZtW1=~llQij7)L6n#?5iY_p>|_mLalXYRH!x#Y?KHyzPB^ z6P3YRD}{ou%9T%|nOpP_??P;Rmra7$Q*Jz-f?42PF_y>d)+0Q^)o5h8@7S=je}xG# z2_?AdFP^t{IZHWK)9+EE_aPtTBahhUcWIQ7Awz?NK)ck2n-a$gplnd4OKbJ;;tvIu zH4vAexlK2f22gTALq5PZ&vfFqqERVT{G_d`X)eGI%+?5k6lRiHoo*Vc?ie6dx75_t z6hmd#0?OB9*OKD7A~P$e-TTv3^aCdZys6@`vq%Vi_D8>=`t&q9`Jn1=M#ktSC>SO3 z1V?vuIlQs6+{aHDHL?BB&3baSv;y#07}(xll9vs9K_vs2f9gC9Biy+9DxS77=)c z6dMbuokO-L*Te5JUSO$MmhIuFJRGR&9cDf)@y5OQu&Q$h@SW-yU&XQd9;_x;l z<`{S&Hnl!5U@%I~5p)BZspK894y7kVQE7&?t7Z|OOlnrCkvEf7$J5dR?0;Jt6oANc zMnb_Xjky|2ID#fhIB2hs-48Er>*M?56YFnjC)ixiCes%fgT?C|1tQupZ0Jon>yr|j z6M66rC(=;vw^orAMk!I1z|k}1Ox9qOILGJFxU*ZrMSfCe?)wByP=U73z+@Pfbcndc=VzYvSUnUy z+-B+_n`=f>kS8QBPwk+aD()=#IqkdxHPQMJ93{JGhP=48oRkmJyQ@i$pk(L&(p6<0 zC9ZEdO*i+t`;%(Ctae(SjV<@i%r5aune9)T4{hdzv33Uo9*K=V18S$6VVm^wgEteF za0zCLO(9~!U9_z@Qrh&rS|L0xG}RWoE1jXiEsrTgIF4qf#{0rl zE}|NGrvYLMtoORV&FWaFadDNCjMt|U8ba8|z&3tvd)s7KQ!Od*Kqe(48&C7=V;?`SQV)Qc?6L^k_vNUPbJ>>!5J?sDYm5kR&h_RZk)MfZ1 znOpQ|T;Me(%mdBJR$sbEmp3!HKDDSmMDnVpeo{S13l#9e6OImR$UPzjd-eCwmMwyT zm5~g6DIbY<_!8;xEUHdT(r_OQ<6QCE9Jy|QLoS>d(B zW6GRzX)~&Mx}})ITysFzl5_6JM*~ciBfVP(WF_r zY>z4gw&AxB%UV3Y{Y6z*t*o!p@~#u3X_t{Q9Us8ar8_9?N% zN&M~6y%2R(mAZ~@Tg1Oapt?vDr&fHuJ=V$wXstq|)eIG_4lB#@eU>fniJh zwJY<8yH5(+SSQ=$Y=-$2f$@^Ak#~kaR^NYFsi{XGlFCvK(eu{S$J(owIv17|p-%0O zL-@NyUg!rx0$Uh~JIeMX6JJE>*t<7vS9ev#^{AGyc;uio_-Je1?u#mA8+JVczhA2( zhD!koe;9$`Qgaxlcly4rdQ1VlmEHUhHe9TwduB+hm3wH2o27edh?|vrY{=;1Doy4& zIhP)IDd91@{`QQqVya(ASth4}6OY z-9BQj2d-%+-N7jO8!$QPq%o$9Fy8ja{4WT$gRP+b=Q1I48g-g|iLNjbhYtoNiR*d- z{sB}~8j*6*C3eM8JQj5Jn?mD#Gd*CrVEIDicLJ-4gBqUwLA-bp58UXko;M|ql+i5` zym-&U5BIS9@iPg#fFbuXCHrprSQKRU0#@yd%qrX1hhs*85R}~hahfFDq=e@bX))mf zWH%mXxMx|h5YhrTy;P_Xi_IDH*m6TYv>|hPX*_-XTW0G9iu!PqonQneKKaCVvvF^% zgBMDpN7!N?|G5t`v{neLaCFB{OyIl>qJQ_^0MJXQ zY2%-si~ej?F^%ytIIHU(pqT+3d+|IQ{ss#!c91R{2l*00e3ry!ha|XIsR%!q=E^Fal`6Oxu`K0fmPM?P6ZgzH7|TVQhl;l2 z)2w0L9CsN-(adU5YsuUw19OY_X69-!=7MIJ^(rUNr@#9l6aB8isAL^M{n2oD0FAHk97;X* z-INjZ5li`a|NYNt9gL2WbKT!`?%?lB^)J)9|025nBcBtEmWBRXQwi21EGg8>!tU>6Wf}S3p!>7vHNFSQR zgC>pb^&OHhRQD~7Q|gh5lV)F6i++k4Hp_F2L2WrcxH&@wK}QgVDg+y~o0gZ=$j&^W zz1aP8*cvnEJ#ffCK!Kz{K>yYW`@fc8ByF9X4XmyIv+h!?4&$YKl*~`ToalM{=Z_#^ zUs<1Do+PA*XaH;&0GW^tDjrctWKPmCF-qo7jGL)MK=XP*vt@O4wN1Y!8o`{DN|Rh) znK?nvyU&`ATc@U*l}=@+D*@l^gYOj&6SE|$n{UvyPwaiRQ_ua2?{Vfa|E~uqV$BhH z^QNqA*9F@*1dA`FLbnq;=+9KC@9Mel*>6i_@oVab95LHpTE)*t@BS>}tZ#9A^X7nP z3mIo+6TpvS$peMe@&=g5EQF9Mi9*W@Q`sYs=% z`J{3llzn$q;2G1{N!-#oTfQDY`8>C|n=Fu=iTk443Ld>>^fIr4-!R3U5_^ftd>VU> zij_ix{`V$I#k6!Oy2-z#QFSZkEPrXWsYyFURAo`Kl$LkN>@A?_);LE0rZIkmjb6T$ zvhc#L-Cv^4Ex*AIo=KQn!)A4;7K`pu-E+atrm@Cpmpl3e>)t(yo4gGOX18pL#xceU zbVB`#5_@(k{4LAygT1m#@(7*7f5zqB)HWH#TCrVLd9}j6Q>?p7HX{avFSb?Msb>Jg z9Q9DChze~0Psl!h0E6mcWh?ky! z$p#@LxUe(TR5sW2tMb#pS1ng@>w3o|r~-o4m&00p$wiWQ5Sh-vx2cv5nemM~Fl1Pn z@3ALEM#_3h4-XQ&z$#6X&r~U-&ge+HK6$)-`hqPj0tb|+kaKy*LS5@a9aSk!=WAEB z7cI`gaUSauMkEbg?nl0$44TYIwTngwzvUu0v0_OhpV;%$5Qgg&)WZm^FN=PNstTzW z5<}$*L;zrw>a$bG5r`q?DRc%V$RwwnGIe?m&(9mClc}9i#aHUKPLdt96(pMxt5u`F zsVoku+IC|TC;_C5rEU!}Gu*`2zKnDQ`WtOc3i#v}_9p>fW{L4(`pY;?uq z$`&LvOMMbLsPDYP*x|AVrmCRaI$UB?QoO(7mlBcHC};gA=!meK)IsI~PL0y1&{Dfm6! zxIajDc1$a0s>QG%WID%>A#`iA+J8HaAGsH z+1JH=+eX5F(AjmZGk|`7}Gpl#jvD6_Z!&{*kn@WkECV-~Ja@tmSR|e_L@9?N9 z3hyyry*D0!XyQh_V=8-SnJco#P{XBd1+7<5S3FA)2dFlkJY!1OO&M7z9uO?$#hp8K z><}uQS-^-B;u7Z^QD!7#V;QFmx0m%{^xtl3ZvPyZdi;^O&c;sNC4CHxzvvOB8&uHl zBN;-lu+P=jNn`2k$=vE0JzL{v67psMe_cb$LsmVfxA?yG z^q7lR00E@Ud3)mBPnT0KM~pwzZiBREupva^PE3~e zBgQ9oh@kcTk2)px3Hv^VzTtMzCG?*X(TDZ1MJ6zx{v- z;$oo46L#QNjk*1przHSQn~Ba#>3BG8`L)xla=P{Ql8aZ!A^Z6rPv%&@SnTI7FhdzT z-x7FR0{9HZg8Bd(puRlmXB(tB?&pxM&<=cA-;RT5}8rI%~CSUsR^{Dr%I2WAQghoqE5 zeQ874(T`vBC+r2Mi(w`h|d zA4x%EfH35I?h933@ic#u`b+%b+T?h=<}m@x_~!>o35p|cvIkkw07W=Ny7YcgssA_^ z|KJQrnu||Nu9@b|xC#C5?8Pin=q|UB?`CTw&AW0b)lKxZVYrBw+whPwZJCl}G&w9r zr7qsqm>f2u_6F@FhZU0%1Ioc3X7bMP%by_Z?hds`Q+&3P9-_AX+3CZ=@n!y7udAV2 zp{GT6;VL4-#t0l_h~?J^;trk1kxNAn8jdoaqgM2+mL&?tVy{I)e`HT9#Tr}HKnAfO zAJZ82j0+49)E0+=x%#1_D;sKu#W>~5HZV6AnZfC`v#unnm=hLTtGWz+21|p)uV+0= zDOyrLYI2^g8m3wtm-=pf^6N4ebLJbV%x`J8yd1!3Avqgg6|ar z=EM0KdG6a2L4YK~_kgr6w5OA;dvw0WPFhMF7`I5vD}#giMbMzRotEs&-q z^ji&t1A?l%UJezWv?>ijh|$1^UCJYXJwLX#IH}_1K@sAR!*q@j(({4#DfT|nj}p7M zFBU=FwOSI=xng>2lYo5*J9K3yZPwv(=7kbl8Xv0biOba>vik>6!sfwnH(pglq1mD-GrQi8H*AmfY*J7&;hny2F zupR}4@kzq+K*BE%5$iX5nQzayWTCLJ^xTam-EEIH-L2;huPSy;32KLb>>4 z#l$W^Sx7Q5j+Sy*E;1eSQQuHHWOT;1#LjoYpL!-{7W3SP4*MXf z<~>V7^&sY|9XSw`B<^9fTGQLPEtj=;<#x^=;O9f2{oR+{Ef^oZ z@N>P$>mypv%_#=lBSIr_5sn zBF-F_WgYS81vyW6$M;D_PoE&%OkNV1&-q+qgg~`A7s}>S`}cn#E$2m z%aeUXwNA(^3tP=;y5%pk#5Yz&H#AD`Jph-xjvZm_3KZ|J>_NR@croB^RUT~K;Exu5%wC}1D4nov3+@b8 zKyU5jYuQ*ZpTK23xXzpN51kB+r*ktnQJ7kee-gP+Ij0J_#rFTS4Gux;pkVB;n(c=6 zMks#)ZuXUcnN>UKDJ-IP-u2de1-AKdHxRZDUGkp)0Q#U$EPKlSLQSlnq)OsCour)+ zIXh@3d!ImInH7VrmR>p8p4%n;Tf6l2jx1qjJu>e3kf5aTzU)&910nXa-g0xn$tFa& z2qZ7UAl*@5o=PAh`6L${6S-0?pe3thPB4pahffb$#nL8ncN(Nyos`}r{%{g64Ji^= zK8BIywT0-g4VrhTt}n~Y;3?FGL74h?EG*QfQy0A8u>BtXuI{C-BYu*$o^}U1)z;8d zVN(ssw?oCbebREPD~I$-t7}`_5{{<0d10So7Pc2%EREdpMWIJI&$|rq<0!LL+BQM4 zn7)cq=qy|8YzdO(?NOsVRk{rW)@e7g^S~r^SCawzq3kj#u(5@C!PKCK0cCy zT@Tey2IeDYafA2~1{gyvaIT^a-Yo9kx!W#P-k6DfasKEgFji`hkzrmJ#JU^Yb%Nc~ zc)+cIfTBA#N0moyxZ~K!`^<>*Nzv-cjOKR(kUa4AkAG#vtWpaD=!Ku&;(D#(>$&~B zI?V}e8@p%s(G|8L+B)&xE<({g^M`#TwqdB=+oP|5pF3Z8u>VA!=w6k)zc6w2=?Q2` zYCjX|)fRKI1gNj{-8ymwDOI5Mx8oNp2JJHG3dGJGg!vK>$ji?n>5qG)`6lEfc&0uV z)te%G&Q1rN;+7EPr-n8LpNz6C6N0*v{_iIbta7OTukSY zt5r@sO!)rjh0aAmShx zd3=DJ3c(pJXGXzIh?#RR_*krI1q)H$FJ#dwIvz);mn;w6Rlw+>LEq4CN6pP4AI;!Y zk-sQ?O=i1Mp5lZX3yka>p+XCraM+a!1)`F`h^cG>0)f0OApGe(^cz-WoOno-Y(EeB zVBy3=Yj}ak7OBj~V259{&B`~tbJCxeVy@OEE|ke4O2=TwIvf-=;Xt_l)y`wuQ-9#D z(xD-!k+2KQzr`l$7dLvWf*$c8=#(`40h6d$m6%!SB1JzK+tYQihGQEwR*-!cM>#LD>x_J*w(LZbcvHW@LTjM?RSN z0@Z*4$Bw~Ki3W|JRI-r3aMSepJNv;mo|5yDfqNLHQ55&A>H5>_V9<_R!Ip`7^ylX=D<5 zr40z>BKiC@4{wSUswebDlvprK4SK2!)w4KkfX~jY9!W|xUKGTVn}g@0fG94sSJGV- z9@a~d2gf5s>8XT@`If?Oway5SNZS!L5=jpB8mceuf2Nd%aK2Zt|2FVcg8~7O{VPgI z#?H*_Kl!9!B}MrK1=O!Aw&faUBluA0v#gWVlAmZt;QN7KC<$;;%p`lmn@d(yu9scs zVjomrund9+p!|LWCOoZ`ur5QXPFJtfr_b5%&Ajig2dI6}s&Fy~t^j}()~4WEpAPL= zTj^d;OoZTUf?weuf2m?|R-7 z*C4M6ZhWF(F@2}nsp85rOqt+!+uZz3$ReX#{MP5-r6b`ztXDWl$_mcjFn*{sEx7f*O(ck+ou8_?~a_2Ztsq6qB|SPw26k!tLk{Q~Rz z$(8F1B;zK-#>AmmDC7;;_!;g&CU7a?qiIT=6Ts0cbUNMT6yPRH9~g zS%x{(kxYd=D&GKCkx;N21sU;OI8@4vLg2}L>Lb{Qv`B*O0*j>yJd#`R5ypf^lp<7V zCc|+>fYgvG`ROo>HK+FAqlDm81MS>&?n2E-(;N7}oF>3T9}4^PhY=Gm`9i(DPpuS- zq)>2qz!TmZ6q8;&M?@B;p1uG6RM_Y8zyId{-~XQD_}bXL{Jp7w`)~IR{l5a2?7!Vg zp!OfP4E$Ty_-K3VY!wdGj%2RL%QPHTL)uKfO5Am5<$`5 zHCBtvI~7q-ochU`=NJF*pPx@^IhAk&ZEA>w$%oPGc-}6~ywV~3-0{>*sb=|ruD{y$ ze%@-m`u28vKDaf*_rmN`tzQT>&2ltg-lofR8~c;p;E@`zK!1lkgi?JR0 z+<61+rEupp7F=mB=Ch?HwEjuQm}1KOh=o@ zMbI}0J>5}!koi&v9?!B?4FJR88jvyXR_v{YDm}C)lp@2G2{a{~6V5CwSrp6vHQsfb-U<{SSrQ zhjRbS;qlDTA&TQ2#?M(4xsRXFZ^;3A+_yLw>o-9GJ5sgsauB`LnB-hGo9sJ~tJ`Q>=X7sVmg<=Fcv=JDe*DjP-SK-0mJ7)>I zaLDLOU*I}4@cro&?@C`hH3tiXmN`!(&>@S2bFyAvI&axlSgd=!4IOi#+W;sS>lQ28 zd}q&dew9=x;5l0kK@1y9JgKWMv9!I`*C;((P>8C@JJRGwP5EL;JAPHi5fI|4MqlLU z^4D!~w+OIklt7dx3^!m6Be{Lp55j{5gSGgJz=hlNd@tt_I>UG(GP5s^O{jFU;m~l0 zfd`QdE~0Ym=6+XN*P`i0ogbgAJVjD9#%eBYJGIbDZ4s(f-KRE_>8D1Dv*kgO1~NSn zigx8f+VcA_xS)V-O^qrs&N9(}L!_3HAcegFfzVAntKxmhgOtsb4k6qHOpGWq6Q0RS zZO=EomYL%;nKgmFqxD<68tSGFOEM^u0M(;;2m1#4GvSsz2$jawEJDNWrrCrbO<}g~ zkM6516erswSi_yWuyR}}+h!VY?-F!&Y5Z!Z`tkJz&`8AyQ=-mEXxkQ%abc`V1s>DE zLXd7!Q6C)`7#dmZ4Lm?>CTlyTOslb(wZbi|6|Pl5fFq3y^VIzE4DALm=q$pK>-WM> z@ETsJj5=7=*4 z#Q8(b#+V=~6Gxl?$xq|?@_yQJ2+hAYmuTj0F76c(B8K%;DPhGGWr)cY>SQS>s7%O- zr6Ml8h`}klA=1&wvbFMqk}6fml`4A%G=o@K@8LHifs$)}wD?ix~Id@9-`;?+I7 zOhQN(D)j=^%EHN16(Z3@mMRM5=V)_z(6y^1b?@Bn6m>LUW7}?nupv*6MUVPSjf!Ym zMPo5YoD~t(`-c9w)tV%RX*mYjAn;5MIsD?0L&NQ#IY`9k5}Fr#5{CeTr)O|C2fRhY z4zq(ltHY2X)P*f?yM#RY75m8c<%{Y?5feq6xvdMWrNuqnR%(o(uo8i|36NaN<#FnT ze-_O*q0DXqR>^*1sAnsz$Ueqe5*AD@Htx?pWR*RP=0#!NjnaE-Gq3oUM~Kc9MO+o6 z7qc6wsBxp7GXx+hwEunnebz!|CX&`z{>loyCFSF-zg za}zec;B1H7rhGMDfn+t9n*wt|C_0-MM~XO*wx7-`@9~-%t?IegrHM(6oVSG^u?q`T zO<+YuVbO2fonR-MCa6@aND4dBy^~awRZcp!&=v+#kH@4jYvxt=)zsHV0;47XjlvDC8M1hSV zm!GB(KGLwSd{F-?dmMAe%W0oxkgDv8ivbs__S{*1U}yQ=tsqHJYI9)jduSKr<63$> zp;a-B^6Hg3OLUPi1UwHnptVSH=_Km$SXrCM2w8P z%F#Boi&CcZ5vAGjR1axw&YNh~Q%)VDYUDZ6f^0;>W7_sZr&QvRWc2v~p^PqkA%m=S zCwFUg2bNM(DaY>=TLmOLaDW&uH;Za?8BAwQo4+Xy4KXX;Z}@D5+}m)U#o?3UF}+(@jr$M4ja*`Y9gy~Y`0 z6Aex1*3ng@2er)@{%E9a3A;cts9cAor=RWt7ege)z=$O3$d5CX&hORZ3htL>jj5qT zW#KGQ;AZ|YbS0fvG~Y)CvVwXnBLJkSps7d~v;cj$D3w=rB9Tx>a&4>(x00yz!o*SOd*M!yIwx;NgqW?(ysFv8XLxs6Lrh8-F`3FO$}V{Avztc4qmZ zoz&YQR`*wWy_^&k-ifJ&N8Qh=E-fH6e}-}0C{h~hYS6L^lP>=pLOmjN-z4eQL27!6 zIe2E}knE;dxIJ_!>Mt|vXj%uGY=I^8(q<4zJy~Q@_^p@JUNiGPr!oUHfL~dw9t7C4I9$7RnG5p9wBpdw^)PtGwLmaQM=KYe z;Dfw@%nquH^nOI6gjP+K@B~0g1+WROmv1sk1tV@SUr>YvK7mxV3$HR4WeQ2&Y-{q~ z4PAR&mPOEsTbo~mRwg&EJE2Dj?TOZPO_@Z|HZX9-6NA!%Pb3h;G3F5J+30BoT8-PU z_kbx`I>&nWEMtfv(-m>LzC}s6q%VdBUVI_GUv3@^6SMkEBeVjWplD5y58LyJhikp4VLHhyf?n%gk0PBr(PZ3 z+V`qF971_d@rCO8p#7*#L0^v$DH>-qB!gy@ut`3 zy3cQ8*t@@{V7F*ti(u{G4i55*xY9Erw3{JZ8T4QPjo5b{n=&z4P^}wxA;x85^fwmD z6mEq9o;kx<5VneT_c-VUqa|zLe+BFgskp_;A)b>&EDmmP7Gx#nU-T@;O+(&&n7ljK zqK7&yV!`FIJAI+SaA6y=-H=tT`zWvBlaed!3X^_Lucc%Q=kuiG%65@@6IeG}e@`ieesOL} zKHBJBso6u&7gzlrpB%_yy<>TFwDI>}Ec|Gieb4=0fGwY|3YGW2Dq46=a1 zVo`Vi%yz+L9)9hbb%FLTC@-G(lODgJ(f&WmSCK9zV3-IV7XI<{2j}ms_Vmb!os)06 zhVIZPZF)hW--kWTCyDVRd2T&t|P&aDrtO5kzXy<*A+5$k7$>4+y%;% znYN-t#1^#}Z6d+ahj*Gzor+@kBD7@f|IGNR$4U=Y0J2#D2)YSxUCtiC1weJg zLp0Q&JFrt|In8!~1?fY0?=fPyaqPy$iQXJDhHP>N%B42Yck`Qz-OM_~GMuWow)>=Q z0pCCC7d0Z^Ipx29`}P3;?b{dO?7z0e{L|O*Z}nxi>X|RL8XAw$1eOLKd5j@f{RQ~Y zG?7$`hy@s7IoRF2@KA%2ZM6{ru9T5Gj)iDCz};VvlG$WuT+>_wCTS~J6`I9D{nsrU z2;X#OyopBgo778Q>D%_E>rMN~Po~d5H<`8|Zcv}F`xL5~NCVLX4Wkg007HhMgj9Pa z94$km3A+F&LzOJlpeFR*j+Y%M!Qm42ziH~cKM&3b;15s)ycD@3_tL-dk{+xP@J7#o z-)bYa-gd2esfy<&-nrj>1{1^_L>j&(MA1#WNPg3UD?reL*}V{ag{b!uT755x>mfbZ z0PzwF+kx91`qqOn`1>xw@801XAJlH>{`~|pyi6J;3s=cTOfelA&K5HX#gBp6s<|r5 zjSSj+CU*-TulqlnlP`}?)JkJ_7fg){;bRlXf+&^e8CWwFqGY@SZ=%NmLCXpYb+}7* z$4k}%iFUi^kBdeJg^kHt)f~<;Ovlz!9frq20cIj>2eIcG(dh57ry;^E^2T)E_8#;_9iJT>4sdCB_db|zO?Z^*lBN zNCs~f+Jkx%EUgkN2-xFF?B%TMr4#)%wq?-~+Nh;g9=n3tM>i5ZcH&nkVcPXgYRjG@ zf(Y7WN@hGV7o0bjx_2@bthJ`hjXXpfaes_(lWIw!(QK_nkyqj?{j#uFKpNVpV@h?7_WC3~&%)xHR1kKo`Cypj15#%0m z-o0GXem63g^|IltM?eZV=b+Z2e8&Z1%{0;*zmFc62mNqLTy$Y_c|9HiH0l>K z+mAx7DVYoHhXfdCE8Bs@j=t0f*uM++Idd25BgIm`Ad;I_{$mO?W%=JF82blr8rl>yMk6?pM z^tMluJ-ckG_}OkxP91t2o>CQ_O8^VZn$s$M_APWIXBGBq0Lt^YrTD5(Vwe2ta4y#DEYa(W~=eLOy7rD^%Vd$kL27M)MSpwgoP3P{ z!yS$zc|uP{yzaIqCwE!AfYNS;KW|OdP1Q%!LZviA0e^WDsIS5#= z!B{TW)VB)VHg{LoS#W7i6W>*sFz!qr^YS0t2kh90y=Je5{p>8)~D@dLS@QM(F# zIp{6M*#(@?tsu1Rq-Mdq+eV}ibRSpv#976C_5xlI`$#1tN`sK1?)5M+sj=OXG6dNu zV1K{y>!i0&9w8O{a>`IA#mo(3a zf*+Q=&HW7&(nX8~C1tiHZj%>;asBEp$p_Q!@Y0T8R~OuPEy3Lq@^t$8=~(FhPVmJJ z#VF8`(fNzK-b%Iin7|cxWP0xr*M&zoz|fCx@=Y!-0j_~cuxsDHHpmSo)qOalZ$bRl z2F$j0k3llJ$>28HH3l_W(KjF^!@LwtLej_b9;i;{ku2x+&WA@jKTO0ad71@_Yta!{ z2oqhO4zaU433LK371>E{bZ?+3kLZ9WQ2+3PTZAP90%P13Yy3lr3mhmy|>eN6(SHs1C%Q39p)YsUr7(kuaoIJGJhXV-PyG zjnxhcAC;fqY@6;MWWBnRK6ocG`%T&0&*k95#yK7DFtZV?;cy;!RD_*YJjsb6Q`$;K zy)&X{P`*5xEgjTQ9r=oh0|>Z_yeFm?ev!p z7q;JA4mtu@qa39v%6i)Z4%qwdxcHuOMO;a1wFMP_290FqH1OsmCG{ zq^afYrz2BQyQ0*JGE}1h!W9fKgk$b!)|!%q(1x?5=}PpmZQ$e;2EB*k4%+&+u;(E* z2n@=9HsqMv;4>Nn^2v&@4T-YTkd`TdWU^U*;sA5|r7TjZGnLY*xC=_K-GmDfkWEGC z;oN&!c1xB-<4J7=9 zJ(BedZwZhG4|64<=wvCn4)}w%Zx_TEs6ehmjVG&p5pi46r zg=3-3Q~;v55KR&8CfG;`Lv6NsXB}RqPVyNeKAfj9=Ol>fQlEUl2cH7=mPV!68+;jgtKvo5F#8&9m? z``w+#S5UR=QHFGM~noocC zVFa#v2%oo{%;wi~_~R2ci}`=B|0@ zinDfNxV3%iHIS(7{h_WEXqu!v~`CMH+7^SkvLe_3i}=pyDRah zN#L)F-`JLj6BiG}sj*WBmrdZuVVEo86Z<6VB}s)T$ZcWvG?i0cqI}WhUq2Y#{f~x# zi1LjxSZCwiKX}*ETGVzZ157=jydo*xC^}mJ<+)!DDCd4sx?VM%Y;&CTpw5;M*ihZ| zJ!FBJj0&j&-oJs?9a_I$;jzd%7|pdsQ3m`bPBe$nLoV1!YV8?Pw~0D zmSD-5Ue60>L$Rw;yk{_2d~v@CnvZa%!7{{7lb$kxWx!pzyh;6G~RbN5+|mFTbxcxf!XyfbLI^zMQSb6P~xzESXmV{9 zCMp)baZSz%)j&JWkc|Gq;_*$K@zQ%tH^91X2|Byv>=SmWR$7-shf|_^>Ll;*9+c(e z{N%43;&e8}_QGW+zE0m0myb-@QU%=Qo>``5UzB(lH0sK=E``{ZBl2Ni^-QtDp0ME1 zK88E-db_XBZQaU}cuvkCgH7crju~9eE-Y`os~0P-J=s;aS#wil$HGdK;Ut?dSO71ssyrdm{QRpMAV2nXslvlIE#+Oh>l7y_~?;}F!;ENCR zO+IG#NWIRI`FLntsz^FldCkky2f!d-%Pij9iLKr>IfCK);=}}?(NL%#4PfE(4kPQN zSC%BpZJ*P+PO5mHw0Wd%!zJsn&4g<$n#_?(=)JnoR2DK(mCPHp6e6VdV>?E5KCUF@ zf7W9wm%G#Wfm*NxTWIcJX-qtR=~NFxz4PSmDVAU8(B2wIm#IdHae-F{3jKQFiX?8NlKEhXR2Z|JCUd@HMnNVwqF~V9YJtD+T zQlOroDX-mg2% zBKV^Q5m5ECK{nWjJ7FHOSUi*a-C_?S_yo~G5HuRZH6R``^dS3Bh6u!nD`kFbxYThD zw~2%zL4tHA26rcdln4^=A(C+f9hLlcuMCv{8`u;?uoEVbU=YVNkBP#s3KnM@Oi)fQ zt_F3VjY)zASub%Q{Y?XgzlD3M5#gUBUuhW;$>uBSJH9UBfBtug*S|-;h?|L#^Z&uE zB&)spqM89dWg9ZrXi#F{KtL@r9g^xeR8J+$EhL~2u@cf`dS{8GUC76JP0hHtCKRg0 zt*rVyl&jaJAez;!fb!yX^+So4-8XMNpP@d3H*eF%t_?I|zN^1Iu5aGBXSm+}eCqn3 z^+vzcM*J>wV-FJRrx@^5;l>h0{OYT)lg{dr8!{s7(i{5T|3bivDoTonV1yo1@nVPR zXxEgGg^x5KHgp?=$xBwm_cKHeDurCgO>$B$GSO`Cd<~J8@>ni>Z-Ef!3+ck(MHVy@ z@#<*kCOb5S$V+Fvc@{Qv$oLfnOAG&YO5z_E2j6E z7a+c(>-`H)>g+6DeY1Y*ag-B6>Cl@@VhkZY@Uihe!{LlRpuTsmIsN4;+UDsHd954n9WZV6qq*{qZ5j<W)`UorOmXtVnLo3T{t#h3q^fooqQ~A+EY<$TDG4RKP*cK0liX95STt= zToC<2M2*(H1tZ)0s|v~iSAa^F-9jMwCy4cK0HM*3$@1Q`Pz}FFYm`PGP0wuamWrt*ehz3(|Fn%;0;K4}!Q~cx{0U0L=cs6lcrY^Y%Vf_rXpQIw~DfxB-72tZU6gdK8C~ea6(2P@kGH}!2N?>r(Ca{ zsI!6B!alPl%j1CHq97PTVRng$!~?s2{+6ffC#;X2z(Xb#9GsSYYe@9zY~7Dc7Hfgh z5Tq!})o30pA3ywg<9W3NpvUs;E%Cehz=s?EfLzcV0H?b{=q?vJCih2y%dhls6w3j$ zk9LB0L&(15mtul3T^QSK7KIZVTod#Sc)?1gzY~M=?ay87V}6G?F>~AIv()-N zD3rHX`;r;L{9N|Z8REN}OZB&SZ|5a80B%dQd-CNESP7HnuNn43T~Agcl1YOF@#W03 z1b*t!>t5G@XwVygHYczDIC|RdMB+ z$s5_5_W-EXN-u_5Pb{((!+8xa+?@_#dwtYHeJ_49Dql%3Fv0yXeV?!cC&Iqx@s~P%$X6%1 zYzS9pqaUv&aBQqO zBQs7d63FZIL1B&<8^oni%CZOdf6&;^oNqQ-9j-NBuQ^|9baQuZ^Jtyt&?cHq$Q9JE z5D>QY1?MU7%VVbvjysl~-a&ImiE(uFwHo{!kp;Jd`OLE!^4k8ID{`e-&>2uB7XB~= z+nIQGZ8-Sbfa}OrVPL}!mdieCrs3Nq8Ic_lpTKMIJ{h>XS$C3`h~ z?p2AbK~%t$t(NcOq5ZB3V|`a0io8A))v_PMt)Hg3x+07RL>i zGUq@t&+VV`kj55_snp?)Y@0rKZr`riC`9Q(B1P^nxffV9AvBLPrE<8D>ZP{HCDY@JIvYcYNRz8 z0Rf+Q0riSU@KaVpK)0M{2}Wuh!o~t*6>)EZSCQD{=}N4Oxjo1KO-MNpPYuPABh}E|rM!=TSl^F%NV^dg+>WNGi@Q5C z%JGsP#em`4LxDdIzA@VF&`2bLDv%J)(7vedDiXDqx{y6$Y0o~j*nVY73pINPCY?9y z$Rd&^64MN)Pkxr-CuZ+WqAJx6vuIAwmjkN{aPkrJ0I4F5-Bl}$hRzhRhZ^xN&Oe5$ za4Wrh6PyFfDG+Nzd8NTp2})j>pGtyejb&;NkU3C5-_H;{?>xK1QQ9S`xaHoMgee=2 zEbEh+*I!ggW@{T{qENlruZT)ODp~ZXHBc_Ngqu{jyC#qjyYGAQsO8VT^lts$z0HP+ z2xs^QjUwWuiEh863(PqO4BAosmhaK`pEI{-geBD9UuIn8ugOt-|6S(xkBLeGhW~)< z8aWBs0)bzOnY4wC$yW{M@&(iTe{8zhDnKP<1yr9J8akUK)1svAuxC)}x-<>S!9(?F zcA?{_C?@ZV2Aei`n#l(9zu`WS-hJsAXWt(SGp4(xg7~3*c5@odW;kXXbGuLOFMj{d z{gx81mQREmRAUHhfp#zoWh>z}GuS|raw1R#en%9R3hSR`qGglQhaq>#K!M%tooG;? zzjo}>sL7a3M5jW*s8R;#Y8b(l;%*I$@YH9)YzWR!T6WLI{$8ScBvw+5&()>NhPzd! z{>P(yk8{(G&2ovV^|#1HbcVMvXU&;0pk&6CxBTvBAB>#tK~qALsH`Ad1P0tAKWHv+BR8Fv4!`+>Obu1UX^Ov zmOpuS@Ui|NK4k-)TbG?+9T$)rkvq+?=0RDa=xdmY#JHLastjqPXdDbShqW>7NrHZ7 z7(9(HjM1-Ef(^`%3TlhySDJ27vQ?H`xr9VOM%0ANsA|A3-jj|r`KAo%oTajX3>^E` zq{Nq+*dAH{EQyjZw_d4E!54gka%phEHEm}XI5o%$)&Z+*4qj<_EChj#X+kA1t|O3V@_RzoBA(&rgxwAF+zhjMY6+Xi>tw<6k+vgz=?DPJS^! zei4z1%+2HDqt}Ow+|2v^3IZQkTR<&IRxc0IZ_-Di>CErQ+oFQ~G{;lJSzvh9rKkAiSGHlAB$1}ZRdR^v zs2OS)Pca>Ap(RaSs7lM2GfJ#%F`}$!)K4#RaGJ_tY}6PMzY{5uHi}HjU>Qb~wlXQ) zdd(`#gdDgN_cat+Q#1q&iH{`26k}U3UR5(?FXM>Jm{W%IKpM4Jo{`3aEHN)XI&Bwx zs}a_P|M)fwG1Tybl)Rkw#D__n_uM+eDn*}}uN4z)3dq)U)n>pIk&pbWpPt@TXlB?b z8AAgq!2_g-!QL>xdU4~4f6CB06j6@M?60$f;#gpb)X1N0YO*%fw2W`m=M@%ZGWPx; z)r*>C$WLCDX)-_~S%jEx%dBpzU6HNHNQ%gLO~*egm7li)zfi|oMBt1pwzMA$x@ zu{Ht#H}ZBZwaf0Ylus3KCZ*qfyfbTUYGuOQI9>??gLrBPf-0XB84}sCqt5Q(O$M& zoJ+1hx4Wp#z?uex+Q1crm2ai?kci;AE!yriBr}c@tQdCnhs$P-CE8jdP&uriF`WFt>D9wO9fCS0WzaqUKjV_uRWg>^hIC!n-~q=1K87NAECZb^W?R zjbI&9pJ)4SSxiq06Zasv*@ATm7ghLgGw3coL-dn6@_D-UhvwPXC3tLC)q3xA2`^D{ z&=G&aeSCN)6{2W6l@cg&2`cCja~D2N{_>ZQ)(5oSf!ns1i9szOif~I8@;2b)f2yQ5 zCqr{lGy5(^+d!<0g??wFzH^wuv=~0)g55&^7m8Ptk3y$OU|eI7 zIovLvNCoY%N(aW#=_C%GDqEO|hH3O9&iCp+LU=&CJ(=JYDGI;&ag&NKq}d;B`TonC zK+-t8V5KjcmDyMR@jvDs|7lkga4>TQej$5B+>A`@{zE&?j-QbQWk4J*eP2@%RzQ{J z?h`1~zwArwi^D7k9~%xtyf(2&$=GsP*n-fTKneej-y6y(3nNfC7|0{drDx{zz~cSs z<_+d2#ZDst@+`w{mwzmn?dM2aB;E;bS-Opq$%w@WnDwa$hUGL90u9c=as)+_6aO10 zLR|CR8nr<2DQTvkaH0QDsyn@TYCs7Nk3lN}Ix$)JM0*zf=0Ad$w9j723W#%{r8V&`{wx-8kSv#)mZ{FU%UZDIi zvbgLHyJ>z0BZe`GNM$Q;D6D48#zc9s(4^SGr>u-arE}okN62N{zuwX)@FL5>$ib=b z5Wtm~!ojD3X|g59lw%^hE?dL;c^bgVtBOkJxQR{Eb*nR1wVM&fJQ{<))bn9e3bSlu z3E-qpLbAE(S^I4mVn`?lycoV!yO!Qj_4qYgsg7tXR)Gu2%1)5FZu&lY7x>bU`eE}x zSZ5c`z~^&$9V?eEH!^Rp-Fz3WiCvEgf`Tq}CnWRZY+@jZ{2NewmyGUM6|xa3Sh7)v zj6d&NWUVqu9f-&W)tQ>Y%Ea!e76@y!Vm*aQp|wU5u<%knNvHZ!U}`fp*_)mIWba=j z*w9~{f5pD;zCmEWePjM#ERNiNjv!SnM-&rGpB9Nmiv}J+hwB&0f_+x?%*lgJFRHsqfFDPwyvh8<*xLT0u_BeEHw{q+UGj=$4udEx)Vq#sV zKB3+_C!RUKy?ac3-`+}dL2!D_2(5=8&@hBf`-AbU`-<_3>Ilqkg6qSI>9G(@Kx?g<0h0K&31$AR>R%d}{%DyXPss$&c^ja7NR z$0AN7Fl$>VpGxqHW15CjxAa6DUVmCpQNbOwBv8D^Y{bXg28> zEQE9xl?CWh0gS6%Y=G4Cy($Vb>jBb2f_dm#0_B<_Ce`|~Obt_Xp^nkR zK%o_`{h1XkWn}i|5Dp#q8D(;k;2|+{DAG{2gJgPNQ=KZ=FKY@d>QEu6W;oLsE(1}< zpnwSEj(K{Bu^#CXdi7L_$!X`QOx^tA1c{&-XTHo3G?3(H*&VM~*Aud?8%FU=dE&kV zJ$SqZoj^g@(q9x;7B30J$(-qUml{?3e+I^Cf?X0PpLr}m zS}W9`QaCwINRU&D5>j9O*j6S}R1`7{5+{d-xUlI~)U!^4+*b5tkuon-Msz03Z{{Kp zH!GAXoyr#1K;t5o#h#a%Lzj3XQGqM0TRnfu$(fsQe^wb_?W!m!+7r55q>svWN`k~T zS(gk9bi|@+8wg;dR<&0f;MpwQbY27$N{{laPQk3@3uCz$w1&jq)`uW*yn!Pe-V^%Q zR9)cW;UB~ODlwolWFAX?ik#_|v)AtHNwoq72E9Jg#v2e5SErf+7nTleI8&}%tn6hf zuz#5YtRs94Ui&E_1PakHfo+^t-{#ewhO*j5ls-zhm^C{kCARNEB1aORsxE!1SXBRz z6Oc-^#|0W6=7AJ;I|}pH#qby@i^C+Vsu9?zdtkE{0`oO_Hw|N=Lz9Is8j}R zI+8thGK?(KSZ5ZW4nQG1`v(=0Jd*0gIlavVihzo#fPaa=}(Rqdxl3^6O8K+{MqU`;1iTJ$<^k)Nms(A$j?A-wHJKvh9 zUHW3}JkE;x?FETPV8DFTxFLY8eSAd%C8vp?P_EuaMakmyFN_e?Hf|LBctnncUb}zF zIGP4WqtKCydoov~Bi<_I%y%$l+})!;SQVcP?>)9wM3q-GE6t9*LfoePBlo{gx~~e{g_XM5PQ8Y5dsuG%3Xq}I&qcY6 zTCo?<6E%)O$A2torq3-g8j3?GGd){+VHg@gM6Kw|E($M9}3HVIyL1D9321C zu#6~~h<<*=V7*ria%j^d5A;S^E;n!mOnFppfi+4)!BQ@#O2<|WH$RS~)&2Qol|@ff zFR#zmU(|jaqCXPA@q?UhrgbMO7zNXQYA@8$E+;4Bz7g=&zV-)=&08J_noLAz#ngz$ zA)8L8MrbXIDZuFsR_M(DsdX)s$}yH!*bLr{s$YWl5J?alLci=I#p`&MbL4`5bC}=2 z^8-(u4v2hs9*us}hjB!uiiY6vvv&QWJcVLTJ=SFG=lpR+S4Cd91l}oZ+B-*ehY2Ic_85)SRSa% zMEL~a3xrvH8ZnMIC!{9@pfOT7lrhxMf^8N20{CJXg}M35=`50S;6g-JYwjwj!K{^) z5Bohf6_G6z=+0V8&>F8xLbJ4mkCVu^g66#h&?tL z9odv&iW21IAh~y9D-DupKP-NcernF2(*RsFkAsM<$<>@-Cl1?&XAi4+Mh2Zm@2x#u zWH&J^1=8G|`|H2%94bnjUZyI>QACu9FS}^$lbtzzCz4AMspqGYEwFFM<%G!Oc$+;7 z3r_L!H~PR}5n8+3-&4v*fFr$uK{y_VamM0*TKn^))nQsn5U?7Iv?`4|Oy&m6himAG z%=a;2ji3f_RtDPqkwR>ISxhnS0f)E`ITo}TR!zIxPwECZy#jzo%q{BNYtd!<IP_S+=*yDOk1GgwLqe!d9esV@3$iVAm1!8RoE| zqnTz;5a)B(~~KcP)c>?+ysFAlAGF4EBor6)K{K*Kn>B(&QtMAkR^ynG%k%UbJpKM zI$}qQXXP3PISHe_vTFssbcL`irhG2zN7J((3ZFmh*bnPuiK~=#YG=820hXqOON#HI<0bvIT{z&SaqRvqaMG-d5<06zdP?-kIH{%UMR$Xn@S}Hx3 zFjg}6no}vN_512D+RIn-mo9^_Li-)WI5%VigYt{Jd!RyI%d|-LqJU$y3aJ*a$y6$1 zjyTuIF2&t>1rPlw&k5OVLhrYBvk5Vl8T(*Gd?Alqi}> z<@-`X_o@9EOB8Ik&?|;lvKHFU@#O+?T!kEf&oJUaLzN;>!}!!e1WIs(T}V#Irf$AK z42`x`z-9ogxd@%CS;D5S z2M^b;Pu)q)c&_KBO!va-4xnI57L7V@*_I_r4vU)z>xk5z6PDVqg92R7_iZH|VlO_B z#8R`5HZVn?ou>czd>gZ~s;w4ZkzVXJNP8FiezlB5JXe6Z-OLsDw%N7!(135!Vl2Lb zLYI79?U{h#W-_#W6hf`<$BQHJCu5ehv?IF+-uxUqt~j!ZW1cxfiEJal^q7~RMWQ0a z2CEaPa1_p|P6qRmmeKgas*N}@(2tH%U37-<5i(DSnVOFFxg-Sv%7&{hPeRh{U`&ufGz=V|JdYQ2sG5 zk%3JimSwQFP=Yr?u_beSG^B$nnh$4hrxb4lpTTiUFRQEZ3ulr+L3m;>;Io?D;jG6Wjj!b)nsZds<6 zX@cD%+aVr!ra~F7HYr`TB!|y-t)HSb^FQt zbo+_XP44IWJGGxg73JyhBjKMSv`77ngDOw}6Eve6ZIol$Q5s65d(1-sP{BU{1_y)7 zF8sh5A~jxRHk=wq3c5i3*e&otCd9>cstT?IQ&D4slC-&^q!ut1;WAQ}fE}Y+jU}r{ zmpSI%sW?})RAm8}$WUU+V$PmQOF5gSKOGQ2;LF-E(gd<67rYu2K| zom8mOppa%XJ6C(@I7-*opqLn73e9BMFStaBER?suJ{jte1$vA%z?$_`Em=a=(?T-q z*A=VZOQ`P{co!*UUKyV@Rd-c#*wmb7v<%rN=TGFmWmqhbj#&+?X|3bZYAjbNGTv~O zs7SIYi3VgW6@?=PGnbNNZIWaY^*+ChW&a)A$uqH8xxehwx2`<1w6mag?zuHbsVJiO$a)tQ zuBBoR>rLfhpA@)Qf`8BwRMx886%9HP5rOR%YCy9pQ|^Xw!=Mcnwx8j=(ZE)P-tJ&s zON&Nsr%14jS@K+IvrJj720NkCR*C(j&aI$EFCV)w$9M<#LdihyRKdzTjJPI|t9_S} z--#oF#;F?Y1KN%_yE);Bxv}9PWZphz_g5mReOKR`y%9UZ=n}GXWw?E$T1%NAfK1Ad z|0$Lp^;sntA>}=ybW)mkxNv1?hkZ`<8hCemcT5 zYl6$I^bhXDzPlz<>6zOy3Fu*3?>#q$;1fJ>nuxyx#&<&x6Y}j zCU&VmtCJ`;aYN+qP}nwr%s2ZQC|Z**axS^?iGu+x^{{>FIv!k0#HaXtEG=*C7kPe!mMnknbn}TKpp6Xv9 zVvq&%A3nmY^N*XTg&+=wO>(|{uTwm;ZP9@+M)6%T zwXPh-&{+aAfv^ZCzOEb;yj>A=f5Pbu)7T{9PT3u>#w*%?K8jqEF%I>A?q;E%CXn)f z|0ohNa5DMv@HVk^vT(L=HBtH*Vzo81L?)M=g7)>@j*vUx?S zxqZo23n3vn@K-Q@bx3lLT+5=fB_oz8+p?P;@*UU<-u)jb5WFEXzoc+8*EC5P6(HWr zY$mfFr=L&G>(jvl8US2fLQqTzHtAGizfR*;W4-kN2^I>L3KkXgx=e*}+i*N($}{?c zi=Q67G)oEMW{|Gdsm{)|V)5Evo}KLj%}gIe>98FFoNTLrJX z-ACRdewnT1w#Egct%wpGg~q%?!$}>$_UJPC4SP0^)G_$d4jN0jBEx}+rcd*^aDtnx zewG{`m!oSbQ?A~FZ6L{&V0hUE+b$DxjO_;oskFha>@gzy(jDnzGO>z3Tzz|i&Dakg zFid5$;SFxINis^4JzK5XIVabKoP`=ZWp|p|t{hTi8n|#XE=-rINwJ*blo?=%Se(qw zkW7x5Qs(LV5RVGxu2e&4);c73lY#0(iZo1x=MY;7mW`uUQIY+$_PqH`4a`6O#urwU zE6(FrvyExmB{c5z*YAj_P&t??F1t6TN2N!$N#~02u(t(PDVyD)$mL3hqKQ4E91N#GOIngPr&pUb-f_Z4*XV8`p1pq+mzrUlUY=4~i|3RDo;Lo36U}uwm zaOah}mO8c@%J*~~{Up7_7->8|3x<}WemgaMA}h>xD17Fey@V9;LgjQFSBS(A<+2kCP9( zlkD%;oXzWtZ_hgu0IxeTjH`6=vi|t_04Btl32=g8swD1oZguWr4|lx0RuXoDHbh27 z+ks?gkVWYnr~_{h+PzQjQ(#8kaJai4We{F!JuqCzU0t*+H{n6i3;K<>_6XUn1n)}) zJ?}JCUPYhT9S1Hi-M+$(Z**%fz7Z%IiMN6%kD>wh%r4#C?Ge4{>w9o??Vbehy9!3@ zffZs8?LGxyWQr@yB(|%~Aa>fVj3$O=i{K*f;?h-a@-ce{(cY8qByOCA1r0;NC}}gr zcC^fCa$Ot`42n>`ehclOAqBo7L&D6Mi=;M5!pd@jj$H z?U7LQWX_u7bHpBzF7L-s4*`C)`dUrbEIgKy5=QHsi7%#&WYozvQOXrNcG{~HIIM%x zV^eEHrB=(%$-FXVCvH@A@|nvmh`|agsu9s1UhmdPdKflZa7m&1G`3*tdUI5$9Z>*F zYy|l8`o!QqR9?pP4D7|Lqz&~*Rl-kIL8%z?mi`BQh9Pk9a$Z}_#nRe4NIwqEYR(W0 z1lAKVtT#ZTXK2pwfcCP%Apfo#EVU|strP=o4bbt3j zP?k0Bn$A&Xv$GTun3!izxU#IXsK1GQt;F0k`Tglr{z>v2>gCINX!vfs`aqag!S*AG5Z`y-# zUv_u&J4r;|EA`r!-gsoYGn<^nSZLH-nj1SRGc0MRG%LWVL)PckFn9z!ebIJ}eg+ix zIJo7GN;j1s$D6!({bYW)auypcB~eAWN;vhF%(l=|RR})$TOn;ldq^@8ZPi<%Xz~{Z zQQ|KAJ@JHaX!Ka2nhP%Cb^I}V6_C|e1SjOQpcPMMwfNz#U@Az|+rmH*Zn=cYJu-KR z{>f++Z~P=jm)4-7^yc#52U4qeNcBRYb!hhT3Q7Ngu5t@CvY*ygxu^Eh?2l6= zhdqN{QEaP(!p>1p1*toD!TllHH6EH~S%l9`mG62dyAd+?}1(vf@N*x^6vhEFU<-RqS7#12*q-xtU z5d|F^n%WSAQHnm-vL)4L-VvoUVvO0kvhpIg57Wf@9p;lYS5YfrG9jtrr?E<_JL{q% z7uPQ52{)aP{7<_v^&=J)?_|}Ep*`{dH-=cDt*65^%LodzPSH@+Z~;7sAL}ZECxQv+;z*f;(?k)>-Lp@jBh9%J`XotGJO(HcJc!21iZ98g zS-O!L9vpE(xMx1mf9DIcy8J5)hGpT!o|C8H4)o-_$BR!bDb^zNiWIT6UA{5}dYySM zHQT8>e*04zk1)?F99$dp5F^2Htt*jJ=( zH(#XwfEZ`EErdI~k(THhgbwNK9a(()+Ha1EBDWVRLSB?0Q;=5Y(M0?PRJ>2M#uzuD zmf5hDxfxr%P1;dy0k|ogO(?oahcJqGgVJmb=m16RKxNU3!xpt19>sEsWYvwP{J!u& zhdu+RFZ4v8PVYnwc{fM7MuBs+CsdV}`PdHl)2nn0;J!OA&)^P23|uK)87pmdZ@8~F$W)lLA}u#meb zcl7EI?ng$CAA;AN+8y~9?aon#I*BgYxWleUO+W3YsQxAUF@2;Lu-m#U?F(tFRNIYA zvXuKXpMuxLjHEn&4;#P|=^k+?^~TbcB2pzqPMEz1N%;UDcf{z2lSiwvJs(KhoK+3^2 zfrmK%Z-ShDHo^OUl@cfy#(cE=fZvfHxbQ!Chs#(vIsL%hf55_zyx>0|h2JT=|7JWo z+Uth3y@G;48O|plybV_jER4KV{y{$yL5wc#-5H&w(6~)&1NfQe9WP99*Kc+Z^!6u7 zj`vK@fV-8(sZW=(Si)_WUKp0uKT$p8mKTgi$@k}(Ng z#xPo-5i8eZl6VB8Bk%2=&`o=v+G7g|dW47~gh}b3hDtjW%w)47v#X!VYM}Z7hG1GI zj16;ufr@1^yZ*w3R&6pB8PMbuz%kQ%r=|F4+a!Gw2RBX6RD5c!3fU@+QCq#X7W@Q5 zuVQ}Uu0dzN+2mSX5)KV%CsU;2FL%B6YT`10$8JR^#;jOO1x?t()Q_gI zxpQr2HI0_^@ge0hNt&MQAI`yJ1Zhd-fpR{rdNmRkEEDu7SpB)QOP4ajV;UBZZZK<6 zWds;!f+|}iP-kqWAH#1@QisJpjcg`+s80!LhAG@(eMad|zcln~oE8}9l5!K{^zf~( zd=HArZ5+Mryc$uNa`@|GSdOX=y}8GZc-%p8W@OM)uk2DfmhQXCU1E#y3XJ>|+XdW2 z)FQLeK38}u_D(5E{GV|YT^rI4qds2{-r<@@@@SG@u&4LbC z5o|KKqVM{?wk$5>2?t*I?IHdh~gljn_2m2zqZNJEEz4Mb$o&I3_UAg#$B{0u$uF4-q}{ zzs5+k@qOe08!CGLGmy3eRrcuqsgB*B>i8c3>3=T^Hv>nL{{u)jtNc6tLbL7KxfUr; z=Pp14Nz+ggjuwd~*oRJ)xWwGwdge+~b!E%c3Gzw6`vT>CCxE0t6v5Z`tw1oKCcm68A~Dbc zgbhP6bkWwSQ=#5EsX*O9Sm^}EwmQQzt2V2phrqqe2y)w8;|&t6W?lUSOTjeU%PKXC z3Kw$|>1YrfgUf6^)h(|d9SRFO_0&Cvpk<+i83DLS_}jgt~^YFwg0XWQSKW?cnBUVU}$R9F3Uo;N#%+js-gOY@`B4+9DH zYuN|s&@2{9&>eH?p1WVQcdDx&V(%-kz&oSSnvqzcXC3VsggWet1#~bRj5lBJDo#zF zSz))FHQd8>3iSw{63m`Pgy_jkkj9LTmJ&!J(V0E~&}HJ4@nXp<(miz$sb;(I<8s!7 zZyezu!-+X81r03486gAlx@n#aKx_93DREBtNcYln*8oliQ zbh0~SkAgHXX%C6}HwN(TRwaK2k_$Y}PxKId;jYt=S1Bf<8s@(IL?k3u1(f^V%TYO1 zA_jPf*V)SLEZFWS#y>M&p$LoSk+%ubs`)H%WEZf=F)RKh&x;i)uLIGJ94~A4m$(;S z;1rQC{m>--`WHFcaFA&5#7~vz|5S;{fB(7pPnG;@$D~C0pZYNEG?B8X*GB2e4{Qk; za1oop8OvHqs1Lk6B`AuYOv4`y`IgM315iTr{VUVc9WeOG;xE z%eDQgE4rb_B%vuT>N?^K zRvPnQwG%7RjO26+DY!OXWjgBu4^!)W-+ob_G&nX++))pD->QdRCo0spZN?Y*J#@-q z)fk-fJvZYz8)GSxYc^oXYIM;Pw}ftHW+a3dis#dXx^OS^m-~FlwcVr6MXv78fNI!i z51K-2t&!&IZ4(GF=mT@;qIp!&R(I@UiWPPz)%Us&(FdAAGxZ-+6^UZ7em`J-F#_3r zLkHym@VAnZFM$J~?0b@&O`l4YXyvOQ+OqalbZ0{g{qD{neY_xno1ZpXlSJWM=Mv(~ zvK{?O>AcXpbd}+hn{~*>weZwDTURX*M^9RkOO#DUfRW1;comKg1bn+mlsrNY8XDyW zgWg9~AWb_1^D8zsD4bL(1J4oinVy0Fimrh&AC}Itl;IH*p4eU_I;SWkOI!9tAbi3B zO@0=q#LHAc>z?ve8Q&hsF(sR9lgf_99_5Kvuug<^&0}Y&m)YjI?bITGIuh}AJO|>z zc*`Mly$>TA={AIT#d%JuMpXHDt($qkc*3UTf-wS$8^awqDD^|EAeA{FoeyJfWM@QX zk>vJ4L|8DU7jg_fB^3Qvz*V$QmDl*AXdw6@KSckh#qxjLCM8Nba!dTkJgr(S@~Z0a zt8%|W!a~3zG4Y&X6xbLtt^JK5;JT($B`_9bv(BjRTfG_Y`tg3k-}%sQoY@F|=}}${ zwmW%Ub6jPd)$;NA0=b7w!^2dE-qvI4)AVr`yvkabJcGwvuQ2rAoRlTjvCC^-$2BG} ziy0<6nt8;J67rymwm&wVZ8E7Krouv2Ir@-GQ%ui6PR42KHKms3MK&Z$zp{_XAVvrd znK4cbg)Ggh5k(4SlFOM9yyRUlVH1oo%|6Lu9%ZxZW28!c9Z%H5#E?B?7H7ulcUtirB<{s@jnS(-R@we z^R#{Mn$#JXd~5sw9rU&~e3fYTx!T&hY{S<~7hviG-T$<4OPcG6eA0KOHJbTz^(`i~ z_WON4ILDLdi}Ra@cWXKLqyd0nPi06vnrU-)-{)Xp&|2gV>E{Uc>Td`@f@=WYJYZ^- zw&+fjnmyeRoK-unBVvX>g>wO3!ey<+X#z@8GNc9MD}khMO>TV{4`z zx4%!9|H6k|Ue;`M{G6d!p#LL+_@6WMpWgF7jk*%$D_JB3c%D`~YmHRJD1UNDLh;Tf zYbbKcv9R(81c4yK+g+1Ril{5w#?E}+NVz>d@n48C-T-(L?9a9W`JV*{dan-sH*P3_Hnt~iRv)}ye;7$b}^4l%ixphDK`G#b!4R4qoouT@*A zZ)kQa)e94??k7N>tqoRl>h(9DFq&92=z|F!LJrh-97EoFL|Wt2v}>(zG1*#aiYA_^ zM_&%_G^g*O8x650e>m!#MDmwRub!irY>^^|L=!4^%lBr;?}mvgP3y~^mSdKSm^R~WAt7T0_ck0mA`GS)J^SYTo6^vQ|vuM7!92&@$BhtcQ^Z4h2)aN zh~EQthyjn1(eI~$FtuHH!|x(iHU{9k40k5nPBwB)X@8Lo$P6u81EeoNOGRct%a-LM_4y3Ts z7ki0PWAO^Es6c%M*SSRn)2|NAoUsKyL%))uVx7?5lkrk`njxs4q@M~x+8%jr7xV;- z|KC=g3aTZO|y|g~oHXB6b42(|J_&fP2Y`*;L07H2d>{~JP zFNGl$MYUG(Qy3dR?9Bfdg8#peGRiVP8VYn@)6T1bj*v)s6q*7<6P(ZVm4ZnTA;rOHSd>P`_5uT0+azWdV`gIvLaJ1o*DB}&W6LCgX|BycgF5qd z!)}dT#A~4*6{1=Bd5VV(Qa2h4x9m#2X711z(ZN>i&cn`BopG*5P`CD*HfYiQmXNGk zhgqcHPBrJP$Z@PLZ4}d-8^}%X^LtUDHq&;~3}lUyrxxl@|IS={GP&6-qq&Iy5gKW- zC@$}`EEZd}DOSeSD+v_x5r_tpBWfN0gDa21p(@TAIrgWQFo7NO@slI6XOAML_lN;3 zEv~}LlMbGWKu}0s$tO-vR)wD!=olGcA?}vU;lRu4+Zf z?nCD7hBmA5`U9P#W8-*0V1=OT-NI0k&_`UZ87DbpYq_=DBdyNDchZ<|V1f%dbaa7i zf~R+6Xt%G)VXlM@8REfP3u#7UPadWYOBMsQ56fHRv!0p9R6q>Rbx!n|IY0goLb%{+ zzy|5WXk+(d@ChzOWatIV1lc1F!(uEOfEmMd;v`|$Kt3X2Uws;%@OV!E86PN?CeHV& z=4#TX{J8RWaH`)!J<8AUs#Ar{6Am^8M{S( zc%K7y2YbcLUz+*eDTXdthNE)Lm^P&*e^eV zilOS9)TVKgr9_^_M!TJ^44v<YF2NO=h(oOr5jYxVTxWk0XJ8n0{F_SOH%49WMk*Sg7`g6B(=^< z*rLAW;8I5;1?;Fh{N=f;kxjLpj}u^mD|k8lih|G4#}wEG1j`HIG( z8y;BMR3cE01e?(+k8NLR|Z+)#>qR^iMZc=BkcixWSKYmkaHpIFN?s%*74kc&wxwB zrtbYBGz9%pvV6E(uli6j)5ir%#lQkjb3dvlX*rw5tLv#Z>OZm@`Bf2t{r>u^&lRCg z11*w4A;Lyb@q~I(UQMdvrmi=)$OCVYnk+t;^r>c#G8`h!o`YcqH8gU}9po>S=du9c*l_g~>doGE0IcWrED`rvE=z~Ywv@;O-##+DMmBR>lb!~_7 zR`BUxf?+5fruGkiwwu|HbWP^Jzui=9t^Pmg#NmGvp(?!d)5EY<%rIhD=9w5u)G z%IE9*4yz9o$1)VZJQuppnkY)lK!TBiW`sGyfH16#{EV>_Im$y783ui)a;-}3CPRt- zmxO@Yt$vIOrD}k_^|B2lDb2%nl2OWg6Y)59a?)gy#YtpS+gXx?_I|RZ&XPO`M!yl7 z;2IS@aT4!^l`Tped5UGWStOw5PrH#`=se%(ox%gmJUBk18PsN$*-J8S%r51Y$i!4N zQ!rW%cgj44jA~_x%%smSTU2WG_W0c&PB$A5*kl8{$|865+lSIX~uyDT`uI7qnS!BPAg1Wwrc0e)8Usf zv9^E38H&hWSp5!@K8Qinl|)9 zEB?NMaxZK^GB!PUf1TBw+`H&jFSNI=Q@v5$Ryf-y^#IuXO#vsM5R+9@qz#z0fD0GP z9|Hj#E>?<=HTcsF$`xn`je~D&3kF1Qi%dfH{sKh!~(IpgjkDGQn zQx2F9rv{*x2$(@P9v?|JZY)^b9cd+SO6_1#63n-HAY3fE&s(G031g2@Q^a@63@o?I zE_^r%aUvMhsOi=tkW;}Shom;+Nc%cdktxtkh|>BIneNRGIK{m_1`lDB*U=m|M^HGl zWF#z8NRBduQcF-G43k2-5YrD}6~rn2DKdpV0gD%Kl{02J{G3<4zSJ1GFFSXFehumq zyPvyjMp2SLpdE5dG#@%A>+R3%AhLAwyqxjvGd{I7J`Iw{?=KKPRzyrdFeU}Qj{rm{351DoP_;vx zMo*s+!Gwgn;${(LXXO(xyI@$ULPZI|uzYR%`>MmW6Hcr1y2aM5b$grFwW_(9Fzz$Q z$&8dKNdWvBkK=iYWA|0}s1B7>8J$g*Ij_+S9vC1#jy~uA8nr)yY)a+ zoJ=e>Lp`7v3^tQN<&6UpDi{c1b}F~fJ$9r=p=@U^J_7bOck$5}ncVjYB0yEjbWrhe@E`j64yN3X?=k_F3BalH$aN zV=94?wDNv=BKLB<1*xU|65Zl!%51r5sHQ?qCggCw;$2QfCZ$lN40WPL=n^{Prf^QS zjbZ&1MRGgiZ2T)}DpiluFr#q*!AZJ$1v#d10YQ{>wQ5px!y28-1hCZ7lwvQnQYN*U zOg9BpvB0A$WUzFs+KWk1qLiGTrDT-0>DUpFl??l(FqWVz_3_Xzqg9vTpagp- zZcJ!5W?|0G%W|AJVVHJ7`u6@<4yyqMGHj@kpv`P+LV<)%PM__Rz&oq~t-*vV12@NR zoEVPz<2D>O==MlNI`;l8Gmv49&|1`FR!}2`NLRCqA{@`imLz6zrjS4ui0)O;!Pu&?KPAcX)?tDPS26uKvR(ry(p{6kiXPoZbnQ!vx6dLu zZCaj~Ocr$h##KqsD;9;ZiUwhmUd%5lrwczWr1Yn6V>+IK=>51;N7JDkrm1NY-ZBes z;FxeOTb^HAyA+~P2}WvSSu_fzt_K=(m4wUp%c*^hF zEJ+1dP0{0B8bryXR+qApLz43iu?ga<5QQxTa$1gMCBq0W=4|DTv4nY4T*-^Im%>U~ z)98;hc(d7vk0zAML$WnPWsqK>=O-FZSLI3_WQKr*PCK=(i6LelZ$$}XXrD5cb~VXz zT%egX>8e;KZs@jcD>cL9VP(Q}b0r~ST$Mc%mr1cC8mqRUQc|N^9@Weu$Z|KeczK7HhSFeFV0i)MQmwrn7CBL=p`_9n?nh320m}6-MSv3L7I*<*56GR zZ`zI^1zyC7F#*zVL@M)F2+oqxydaiQz?|ODmqs|Ub8%&KXk9P3P7<4tM?X{~!;Ygw zt=h7)AYGDO9F&wV=BhCyD9exr#YM_-<;Fo~iE>IBEXK$%;JCUAEr;lR&3S_DUy_E) z#!oCYdENVE9OaaeaIrPk-odMtvdFG;ocA#`L6AifMu0og^?Oy9F|Et9q6 z8;3_|9+Io@hqYoN;58x1K&OP!9Vd#dzhTRjB2kI?%31ceHb#Q~WqJV5lw;@b>4@Rd z={z1S`d05YdWC*RLc7sR0bVGSytn-a3`JZL3|d8KC?vj_70Vi4ohP9QbU&Q4?Zjd0 zSZA?KbqLBsJg(qj>fycto3`zN-)lDe4{Ij-QfoBn@rT_tTszA+CnM~xWmE(4zfpCQ z;zPJfl3=ctrggYM!KQg;V{J;utMMF9&BfOe!<{wU0ph?-VQ%cv3B%fFiW?6xBPdf0 zD-HhEU?0C`G@7e+b-=8fj=TP3mdz&SIQ}Nd`*G#DTz9Y@b zaoDF}Gx7ZhPzpDhi^fA7WZ)EAEFv;N2*bKp0T za0t<^1|Zc#`A+?s$!$8eO4CK~PUFECC3BwNR4f)!V&-Y>$xg(%T{MtrH|CPcO(Lf> zE_meE1?6S-qlV^p2fh! zT11Ub)hHw!_mpFDMIAFB`%Yal+`1IXV>b?%!q^Ps%8nh8wtjVGlF-!5x*D29WJ4=M zZ7X(QvKe$YZNgM(HibD7+VO5Q29?@HzS?k$c|3B@JI6dlLgu5S&LbU4=4p-Yn||z@ z4p05vq*k*pbOV9QjVTMp8`c$?t@~!$8&5AP_sz@tk%a$nWHMh-Gm{WS5+q)5W6pU# za@YZXJCLTpZ}zb=$HCYbIm->?Hu6XIBz_d7)n1+3eSLzGVoNQCTHcu9qS2@({0sxc zu<-mhx@Xz_*(S1DEL|d0`YV7uNevL*Y6|DAQmvSp{4DzPL@>hqJ?`FjvIU;<&}YEKDmFUGSBYjRmK{Km-1m%-t=fFfI9kV|POH|SxvO=P+><+1JK_lt5F6fTPf8PXU+lYEJz__** z&>`4F2F8EWE+k7ZsZx9%!?A56{lsk1juYw5zN)V+g$d^Q^Gm}fnHKA6L^36=`e;p% zp{;JD$X3%}O7qINR*2<>a422}_hmc=)-A7B-1#2v85jN5K31t0DtmqON-Dim`XIR; zOo`KRv)gtn?stp*`^f>}UDnGYGnJAbl(4srd>(5fo2#oqi>#bus86EHfeItFIu$+% z;lE|3gjQA`BXHEE5JdcjCoethN`@NEc~zm6CYf@LJ|hT^1>l}gRl7oDHMnw!*5*IC z@@Mi=gO=lZSnWln`dX^4Bd{9zYG{HNIX-87A#5OM%xu*%V?7K3j3CHcN*t!zNK4N4 z!U2?a>0`8m8}UQshILC0g6-k>8~;SRIJ?vQKDj z@U{DrstWIT7ufyRYox^&*IyHYb$3wtB}V^0sS|1OyK#sDc%sh+(gy&NT9j4Aa7J0C zPe$02TylMjad&|{_oe3`zx)Cqns?6qThYue6U=~j5+l0Po4`bX*&9V@a<-O;;vCzm z(af&;e<^}?5$7&MRW$eb*P< zX|33QmDvFSDFK-qMz|RF|Eedum@~W zt~8C1@i8@LammTr)rAgKm8X_SczCg@+@LeWpcmx;VL;iLQJ;t%Z*|XbNWUnHX|o=Q z%bsXc%bw=pk~8%3aV-w(7E$co9_cHQ$!}Ep6YcoCb7~GQBWl#4D!T8A5!P*tSl4FK zK2CX0mjmosg6TSK@-E-He{dm0?9h{&v~}OX15xgF<1-w4DCypYo22%@;uRq`ZFld- z{Uqof@a@P5dW@kfF-`1B1(!R>(DHb&$UXY%Gd+6r?w8klhP&ldzG*6#l#VuM&`)ki z)f$+Rp?YYog9u==<#MC%1daG#%3EOX9A{7$`_(s#_4mV`xZaB+6YlX`H4{}vq;)TF zo~fR@do6EZIR?413A$V6o^fq&QV7P(bB(9m1969szOosyhZRYciAWXe4@u-}s(LeJpuIkSx)XvjXmvVEseG zJvWN4s|$6r;s(3F+cgeh4DMEq??h!$eb^5h#`whT5d03qfYpol8dCim)A^NG1-H}} z!b)V8DTL2Q8@R2p`y4@CeSVj9;8B5#O?jfl-j<$Quv?Ztwp*)GvQ~|W8i6?-ZV@Lf z8$04U_1m{2|AIu+rd8KW`Qk|P1w(}d%}cjG6cxsTJ3Y&*J^_@bQgXwILWY7w zx+z)v81rZv-|mi>y#p$4S7AA760X?)P&0e{iKcWq4xvv@KA@EWjPGdt8CKvh4}p}~ zdUVzuzkBlU2Z+*hTK214><61~h~9zQ3k+-{Pv~w`#4|YdjTFKc{===9Ml7EMFmE!f zH}U3O{Z`DuJrBZbz~OjSVlD6uZSEeNK8epja_LanEh8v;_$Eg9?g*9ihMoat$#qd^ z?;x?a*y3-pW#6|kF^<$w;2^~s!fc;3D~#&#WYZfK@3;bO{MvmN?>qy%_%v`BVCgfC zdwL~(H14Gr6w(1CX|R;zhZh%?*Q{hxJH`MV2)@Jg$pbqjZeL+LO7^vwgi!@3yn@NT zU91-{;BWIi8bV-j-YR|A9Qs?M?e7Ru&Onl1(Sz(kxAw?LEbd+Le%Z43rZgb2h2m|e z^rblc;4r+}?@tC(YIBB_qpQL?_kg{;zO#6JD9{;HSUgf@zIZ)}Bh4wFZIs>meSd}f z4iF~nD$KAV6CVEw+{YOPrW~~y~Y=?snG4dE3edN$~SXh`!c_F zUsQ1M;ARz&v0mIbfP}aLWZ&cBPU+DU{l+0}_>9DZGL{@}lF6QCtgAg;EWUu`D$Evm znblG}kC!}Mw)bR~U;+S}T9TVc6lXWR!LNMm)nmxr*ORkv#&UO$_WQpt0WdX{A=bjC zV^lB~(r;y!C4$Rk0fWUR|09O?KBos@aFQjUx{ODABcj}h5~ObwM_cS>5;iI^I- zPVEP9qrox2CFbG`T5r_GwQQpoI0>mVc_|$o>zdY5vbE~B%oK26jZ)m=1nu_uLEvZ< z8QI_G?ejz`;^ap+REYQzBo}7CnlSHE_DI5qrR!yVx3J1Jl;`UaLnKp2G$R__fAe;R(9%n zC)#)tvvo-9WUBL~r_=XlhpWhM=WS6B0DItw{1160xd;M(JxX_-a&i%PXO@}rnu73_ zObHBZrH%R!#~pjEp~P?qIj4MdAx@sv;E96Doi$eO-~)oUz%Z0Tr4K`-jl06Il!9{s zdjF*1r{XU?)C(%XKPm;UnpnDGD%QL3pgo0ust~+sB0pa|v37>E1dp*Odn)n=DY;5j zDzSAkU9B6F$;|##_mrDe#%hd7pC1u`{9ZKeDdtkyl&4>H=e)Fq@}$UffPt1#cjYZg zd%O%xpg4~brEr>AnKT)kF@`cdX4tMlZ#Vk!l1Xz!G970p`Gkv^lk-|>jmt0W5Wu6woGf?hNA zXO2?BG)<{`NsYAY#3|L^x*=rS7uWU~s<*UhTC8AYc#lGP-=Aw1I)@y(<` znQb^nL~$rlDbsdAc4nc#{+$_;Z4iY;Pi0i9Q;>ZB3+IjWLg_r40-Fso^xF<*_s7Tj zujFrMH{vW3PmCndjQIscnQE%`Qj|E2kidi#c&PcWIMyH+e#7!l`<$_)*pDP$!49pY6w!bN)j8~A1wV%gIakf+vA04 zV)_Q=QMPSj6$M2Ar#KhhxsbZUOq3nZHh8m0?Fr}I6N(Fk zkhXM(f57yOa8vn^97J+g9ISPa=-**6^8ZX&g=z+m&6~x<1>)MyM&tpbWhSf8#+Pcd4rVK#)NSw>1eLKHTO z44A@sc_}Ypi#ggFRbDRFV(IhOnRU&XPrQYh9`mVMo-^U$&AwsXooSRUFqJ7)XUXCK zFpt;gJ}9QTN9xy9$=3OnRkjgUuQZ`X)!}LBm~WUIEKuK-Z%}f?2?+MKucWU<3)>9G zxsz~2pHut1AmH<@66;LdCB9+dSpojE4ggrYS?%icv*Rpi?G0Q($^`(g<1&Z){O_5B$@f#;I2-+Qa1P$a@=u-vOY5vqo z|6G67X;*A|V86ZET9OpFB&02twZtc2K}~ASoQpM_p{vJ{-XvA8UmQa4Ed%fS{D@g( zr_aY0gKw*=2SIGznXXKFo$r0x3)@bq8@4od^U(L0-jvTsK@qYOWX?2G_>N+?;r{TU2{M>V0zid zB_Zu?WSnRl@k?oE*gsgv;jH@+ z-}BDGyR-ls7$dz{e( ztv7lI2|OxNkLD4zc3xGA`!d7LiSdOys4H!8aA(_c0Nm*uLjS4TW%Z3v>am1nwQ_lI zIs85Uufd;cv-(4wi(Js;QsL#|qdv)n;r_?puaK*1>zTC@d=#sK+q1YF_Q(5B%%3TtI8&bNs_e8vIb;oc|Rk`F~u?|A?jj{c={?{Env{mW#q@8 z)#WEgt4B6b&X2?o3=b`ilz;)-h$t4;hsxPDo-%5C(7m#c9tZF-U`vcx0HnVtf_X(}4Tg}4wx(=y!@T7{)4;I_p95mBhikg-|U9z35q`|!1+Zz@97 z(PFE5jCv|=t;^=(CLqYp)k90rV4ZSiFDAhD8YOCzv{}1WDuB?epORibW36);q(Aig ze27@D?lN-ZyjuB4GsebA$;+(KGiOtCe6Bfd%GKRty>dBS1GUe}MXgnu61UdgO=m1& zE(eECPF_%J-lU{;R)eQJot;;}Wch$-8Z|lxN*AAdc;bkpbD`W}F=Z}^Cy(SKyfF#+ zQSalA%JDDAu|77$M3E|kv==3vx~pFPw_<+9xgcE#oigh*>#QsA2}sTYO7uY(h@dhR zHJBi^bb-`1?<1cGFZJa8Akzs{H^$N<)5@hlXeKwt9hD5^5K&`pdHOI92p<7XhS?>| z(5h9KYctN|H+W~Xh2N4W+yjMyBm(AdewjX?PBuRU$^J zS#+U($K6rhFFzf z0q*kJ>B6xI1qAti?H@X@dxtB7_vT+Nj@PNxr?CSK#xqE6jh5S{`nH#zzvjOId=i1X zK(Yjl!7KF(73GXYLVkQA5irn|v-ArCqwi)CM8X&m!#@NQ3bqmQlfurU4qT`zl_m^C zhpk?mfVvy9L|)*+bW8&NY4lG$@0_PKfO9+~(zrbn?wECGi7472W{H&dRPZum^Qf z73C-TR6$#q>XJgYnUgV!WkbmRas;`TY#7CxPXIEGwT6VPBDKbyr#|C2M%q|7l#Ql< zuM}j=2{D+?SxT8?ZJn&Z%cRN8Gu@y(`zV(lfj1T%g44(d#-g&@O0FL5;I9=?bW>!M z%c3J&e}GThdean-<||jUh zlLP`UeKBhhrQ?HHjM3}kfO7Z=EKB%+rs*t+nuBoeuD2yk%n32SA?-s)4+DsTV7U&K zyKQO2b2*tQT}#((=#fkb%hkRkt^%tY&VK$hcs91+hld zJ%lgC!ooILC&|(Z9$zzk=Q0*%&l7wwyf%nv=`C=OcPjb|Q%@9*XkPGFrn+bxp?t^D z!_qO=e-;bnT)^0d|Ex9X&svN9S8M&R>5l*5Df2H@r2l)VfBO@LqeVw`Fz6TSwAt^I z5Wu6A>LNnF7hq4Ow=7D7LEDv3A))d5!M=lT3ConlFN`5eTQMexVVs* zH0tx-*R+-B@&Lp`0V4j6Uy=LJmLQRY_6tH4vnV{_am%kkv|{CYkF}4Wn6U+|9Xre$ zJkO;_=dtw`@aEs|^GlO-zvpp-73H;PYk}V5RrH83G4SVkRJ0YSluQa8pKejcqB4u~ z^9^lDR|?7vEo|jITtaIFI6}1;vTI6n(d0kDGQUJuk>>sqdd7#VBF;?_dM5i<+VMEq zc>habJK}_0eEsOkdwv48d43jKMnqYFMnYDU&c?vi#Fp+S)sxo1-oVJ*g!X^^K! z>z!G8?KfU{qOnLHhaEF4QRHgOpfvoo7@=FG(2ZefYJk- zZuA9ubiTTP9jw9Uzpx8FfJBFt+NNE9dTlM!$g$|lTD za4LMNxWhw8!AV(x;U`IV-(bK@iQ%#QSmq8D$YqLgt?V#|~% z;{ST}6aQbOoewMKYzZT@8|Qq z@9SNBu1UErolMjrhJW-Id&7y<0I<+Z-lr`IHMh1;M)n@g|hx_T-maO`s{Tuhax}EjC zS;1kdL*A3BW5YZXgD|0zm)g3_3vMs>5xgHUhQDl19lfQWMcfLTsw$)amgDs>bW*Oe+$UK^`ioL%F0Ua5vb%II+EGS>*I zw)AmqcWBZpWH&Aswk_FJT=J|^Gn=MfnDTIzMdnoRUB91MeW?e>+C)g3_FDN8rN$(? zL+kH!*L}rq`MK`KDt^v4nUJg3Ce-`IW0Ph0?|}Puq5WIS_a7iEO;~mGQqqo=Ey;ND zhBXA^$ZrCc#&0}dMA&@)&TCq5PMzgJPafZCg-6$R zRqJ2+_t+dGUAY@~xPzU3`od7-(8nnuMfM-4#u`Q~`l-CUGC7u*^5VwH`ot;Ck#R1% zRr%?;!NrB$w^}NW=GGR}m!3a9bh#wXrq?fF7j-IS?E_!GaD3KYzcXhCUHhjEl-6b# zCmIF#4y@HN=^#uIz zRFl8D)Ri1<(Kr~Hoi_MtXWP8^AyTKxi1)ew88bV{*Ok8w8YLXBFW0sRJ<(vU{$ym| zz)feLQbz3k;_}2_{-bW`h~t&2$ObtlbS?k2k|5Kbu?FZLDMTVW_Z6p#A)c)`3DD?a*hxHS2Zj zcIiebfsINfWvwY7Z{YOlIQ61b`j=%6{>MPs+`()Q{wq0z0?|jwRN(1IrMQsj40BHx zvBC_Xfcr;55&}MeoP_@#nz$avCh%FJfE5NNAE~fW@L7~f8Y=?Wno31128EYOK8+O! zc4Vaj-DCsB6CPH$?pQQVbb_(tg^x{$STYM_WKLtrh-_-Hq-M%Ubpt6$mCHY!B{ISD zz}grIo^bNVDw4={SA2*nDNq5`e@ZO5r4TbQpHM)~qfD9!s0h(Jf>vYd;I~j<2fD4)_>ctbwNX6S*8>i^*4 zYKI5<4}d;hM!!N|A$@eg09J|HV;!UUVIau_I~dxZp#?a3u0G)pts6GKdCNk>FKxdh_`Xu!>zO3Kv?u+W6cYJPy!@=PuY868>3|Zg} z$7galV~M`d!q(`I{;CJsq6G9>W0}H6gVY`q7S@9s8ak1r{>}*Q0JyH&f!f8(NZxhC zkn|KS64r^A1fniFel2KkxYByk%erCx9UgFLI)`yuA)X z8SU?6kj!numPNCAj}>1ipax(t{%rxU;6`(Nqt$~Z4~76TQ$9d8l`yJ}rniII%HbH= zlS_7o!qB{55at^>N!Voer%)`KMh9Yd@Z?~nc19*hs)NGN954`O9zA&&vJHbm&|D@E za(&z6A=3NfC;>I)hlI@ulP8E@W-ziGe{iCf_mHvWGldxw8{ng-hI({EtOdALnD9zG ze)fU?I(DNt)Bzdd9Cs^>!|+2!xv1SK=I zJ+y_;=Sq-zqD~GKy@{5(my&aPgFfGY&_mayR_)?dF_^Fwc-n!UAG+fQQGfjWE-1MF YM{}PByk10KD_nuQ4E7Du?}+~TKh4V)`~Uy| literal 50710 zcmbTd1CVCTmM+|7+wQV$+qP}n>auOywyU~q+qUhh+uxis_~*a##hm*_WW?9E7Pb7N%LRFiwbEGCJ0XP=%-6oeT$XZcYgtzC2~q zk(K08IQL8oTl}>>+hE5YRgXTB@fZ4TH9>7=79e`%%tw*SQUa9~$xKD5rS!;ZG@ocK zQdcH}JX?W|0_Afv?y`-NgLum62B&WSD$-w;O6G0Sm;SMX65z)l%m1e-g8Q$QTI;(Q z+x$xth4KFvH@Bs6(zn!iF#nenk^Y^ce;XIItAoCsow38eq?Y-Auh!1in#Rt-_D>H^ z=EjbclGGGa6VnaMGmMLj`x3NcwA43Jb(0gzl;RUIRAUDcR1~99l2SAPkVhoRMMtN} zXvC<tOmX83grD8GSo_Lo?%lNfhD#EBgPo z*nf@ppMC#B!T)Ae0RG$mlJWmGl7CkuU~B8-==5i;rS;8i6rJ=PoQxf446XDX9g|c> zU64ePyMlsI^V5Jq5A+BPe#e73+kpc_r1tv#B)~EZ;7^67F0*QiYfrk0uVW;Qb=NsG zN>gsuCwvb?s-KQIppEaeXtEMdc9dy6Dfduz-tMTms+i01{eD9JE&h?Kht*$eOl#&L zJdM_-vXs(V#$Ed;5wyNWJdPNh+Z$+;$|%qR(t`4W@kDhd*{(7-33BOS6L$UPDeE_53j${QfKN-0v-HG z(QfyvFNbwPK%^!eIo4ac1;b>c0vyf9}Xby@YY!lkz-UvNp zwj#Gg|4B~?n?G^{;(W;|{SNoJbHTMpQJ*Wq5b{l9c8(%?Kd^1?H1om1de0Da9M;Q=n zUfn{f87iVb^>Exl*nZ0hs(Yt>&V9$Pg`zX`AI%`+0SWQ4Zc(8lUDcTluS z5a_KerZWe}a-MF9#Cd^fi!y3%@RFmg&~YnYZ6<=L`UJ0v={zr)>$A;x#MCHZy1st7 ztT+N07NR+vOwSV2pvWuN1%lO!K#Pj0Fr>Q~R40{bwdL%u9i`DSM4RdtEH#cW)6}+I-eE< z&tZs+(Ogu(H_;$a$!7w`MH0r%h&@KM+<>gJL@O~2K2?VrSYUBbhCn#yy?P)uF3qWU z0o09mIik+kvzV6w>vEZy@&Mr)SgxPzUiDA&%07m17udz9usD82afQEps3$pe!7fUf z0eiidkJ)m3qhOjVHC_M(RYCBO%CZKZXFb8}s0-+}@CIn&EF(rRWUX2g^yZCvl0bI} zbP;1S)iXnRC&}5-Tl(hASKqdSnO?ASGJ*MIhOXIblmEudj(M|W!+I3eDc}7t`^mtg z)PKlaXe(OH+q-)qcQ8a@!llRrpGI8DsjhoKvw9T;TEH&?s=LH0w$EzI>%u;oD@x83 zJL7+ncjI9nn!TlS_KYu5vn%f*@qa5F;| zEFxY&B?g=IVlaF3XNm_03PA)=3|{n-UCgJoTr;|;1AU9|kPE_if8!Zvb}0q$5okF$ zHaJdmO&gg!9oN|M{!qGE=tb|3pVQ8PbL$}e;NgXz<6ZEggI}wO@aBP**2Wo=yN#ZC z4G$m^yaM9g=|&!^ft8jOLuzc3Psca*;7`;gnHm}tS0%f4{|VGEwu45KptfNmwxlE~ z^=r30gi@?cOm8kAz!EylA4G~7kbEiRlRIzwrb~{_2(x^$-?|#e6Bi_**(vyr_~9Of z!n>Gqf+Qwiu!xhi9f53=PM3`3tNF}pCOiPU|H4;pzjcsqbwg*{{kyrTxk<;mx~(;; z1NMrpaQ`57yn34>Jo3b|HROE(UNcQash!0p2-!Cz;{IRv#Vp5!3o$P8!%SgV~k&Hnqhp`5eLjTcy93cK!3Hm-$`@yGnaE=?;*2uSpiZTs_dDd51U%i z{|Zd9ou-;laGS_x=O}a+ zB||za<795A?_~Q=r=coQ+ZK@@ zId~hWQL<%)fI_WDIX#=(WNl!Dm$a&ROfLTd&B$vatq!M-2Jcs;N2vps$b6P1(N}=oI3<3luMTmC|0*{ zm1w8bt7vgX($!0@V0A}XIK)w!AzUn7vH=pZEp0RU0p?}ch2XC-7r#LK&vyc2=-#Q2 z^L%8)JbbcZ%g0Du;|8=q8B>X=mIQirpE=&Ox{TiuNDnOPd-FLI^KfEF729!!0x#Es z@>3ursjFSpu%C-8WL^Zw!7a0O-#cnf`HjI+AjVCFitK}GXO`ME&on|^=~Zc}^LBp9 zj=-vlN;Uc;IDjtK38l7}5xxQF&sRtfn4^TNtnzXv4M{r&ek*(eNbIu!u$>Ed%` z5x7+&)2P&4>0J`N&ZP8$vcR+@FS0126s6+Jx_{{`3ZrIMwaJo6jdrRwE$>IU_JTZ} z(||hyyQ)4Z1@wSlT94(-QKqkAatMmkT7pCycEB1U8KQbFX&?%|4$yyxCtm3=W`$4fiG0WU3yI@c zx{wfmkZAYE_5M%4{J-ygbpH|(|GD$2f$3o_Vti#&zfSGZMQ5_f3xt6~+{RX=$H8at z?GFG1Tmp}}lmm-R->ve*Iv+XJ@58p|1_jRvfEgz$XozU8#iJS})UM6VNI!3RUU!{5 zXB(+Eqd-E;cHQ>)`h0(HO_zLmzR3Tu-UGp;08YntWwMY-9i^w_u#wR?JxR2bky5j9 z3Sl-dQQU$xrO0xa&>vsiK`QN<$Yd%YXXM7*WOhnRdSFt5$aJux8QceC?lA0_if|s> ze{ad*opH_kb%M&~(~&UcX0nFGq^MqjxW?HJIP462v9XG>j(5Gat_)#SiNfahq2Mz2 zU`4uV8m$S~o9(W>mu*=h%Gs(Wz+%>h;R9Sg)jZ$q8vT1HxX3iQnh6&2rJ1u|j>^Qf`A76K%_ubL`Zu?h4`b=IyL>1!=*%!_K)=XC z6d}4R5L+sI50Q4P3upXQ3Z!~1ZXLlh!^UNcK6#QpYt-YC=^H=EPg3)z*wXo*024Q4b2sBCG4I# zlTFFY=kQ>xvR+LsuDUAk)q%5pEcqr(O_|^spjhtpb1#aC& zghXzGkGDC_XDa%t(X`E+kvKQ4zrQ*uuQoj>7@@ykWvF332)RO?%AA&Fsn&MNzmFa$ zWk&&^=NNjxLjrli_8ESU)}U|N{%j&TQmvY~lk!~Jh}*=^INA~&QB9em!in_X%Rl1&Kd~Z(u z9mra#<@vZQlOY+JYUwCrgoea4C8^(xv4ceCXcejq84TQ#sF~IU2V}LKc~Xlr_P=ry zl&Hh0exdCbVd^NPCqNNlxM3vA13EI8XvZ1H9#bT7y*U8Y{H8nwGpOR!e!!}*g;mJ#}T{ekSb}5zIPmye*If(}}_=PcuAW#yidAa^9-`<8Gr0 z)Fz=NiZ{)HAvw{Pl5uu)?)&i&Us$Cx4gE}cIJ}B4Xz~-q7)R_%owbP!z_V2=Aq%Rj z{V;7#kV1dNT9-6R+H}}(ED*_!F=~uz>&nR3gb^Ce%+0s#u|vWl<~JD3MvS0T9thdF zioIG3c#Sdsv;LdtRv3ml7%o$6LTVL>(H`^@TNg`2KPIk*8-IB}X!MT0`hN9Ddf7yN z?J=GxPL!uJ7lqwowsl?iRrh@#5C$%E&h~Z>XQcvFC*5%0RN-Opq|=IwX(dq(*sjs+ zqy99+v~m|6T#zR*e1AVxZ8djd5>eIeCi(b8sUk)OGjAsKSOg^-ugwl2WSL@d#?mdl zib0v*{u-?cq}dDGyZ%$XRY=UkQwt2oGu`zQneZh$=^! zj;!pCBWQNtvAcwcWIBM2y9!*W|8LmQy$H~5BEx)78J`4Z0(FJO2P^!YyQU{*Al+fs z){!4JvT1iLrJ8aU3k0t|P}{RN)_^v%$$r;+p0DY7N8CXzmS*HB*=?qaaF9D@#_$SN zSz{moAK<*RH->%r7xX~9gVW$l7?b|_SYI)gcjf0VAUJ%FcQP(TpBs; zg$25D!Ry_`8xpS_OJdeo$qh#7U+cepZ??TII7_%AXsT$B z=e)Bx#v%J0j``00Zk5hsvv6%T^*xGNx%KN-=pocSoqE5_R)OK%-Pbu^1MNzfds)mL zxz^F4lDKV9D&lEY;I+A)ui{TznB*CE$=9(wgE{m}`^<--OzV-5V4X2w9j(_!+jpTr zJvD*y6;39&T+==$F&tsRKM_lqa1HC}aGL0o`%c9mO=fts?36@8MGm7Vi{Y z^<7m$(EtdSr#22<(rm_(l_(`j!*Pu~Y>>xc>I9M#DJYDJNHO&4=HM%YLIp?;iR&$m z#_$ZWYLfGLt5FJZhr3jpYb`*%9S!zCG6ivNHYzNHcI%khtgHBliM^Ou}ZVD7ehU9 zS+W@AV=?Ro!=%AJ>Kcy9aU3%VX3|XM_K0A+ZaknKDyIS3S-Hw1C7&BSW5)sqj5Ye_ z4OSW7Yu-;bCyYKHFUk}<*<(@TH?YZPHr~~Iy%9@GR2Yd}J2!N9K&CN7Eq{Ka!jdu; zQNB*Y;i(7)OxZK%IHGt#Rt?z`I|A{q_BmoF!f^G}XVeTbe1Wnzh%1g>j}>DqFf;Rp zz7>xIs12@Ke0gr+4-!pmFP84vCIaTjqFNg{V`5}Rdt~xE^I;Bxp4)|cs8=f)1YwHz zqI`G~s2~qqDV+h02b`PQpUE#^^Aq8l%y2|ByQeXSADg5*qMprEAE3WFg0Q39`O+i1 z!J@iV!`Y~C$wJ!5Z+j5$i<1`+@)tBG$JL=!*uk=2k;T<@{|s1$YL079FvK%mPhyHV zP8^KGZnp`(hVMZ;s=n~3r2y;LTwcJwoBW-(ndU-$03{RD zh+Qn$ja_Z^OuMf3Ub|JTY74s&Am*(n{J3~@#OJNYuEVVJd9*H%)oFoRBkySGm`hx! zT3tG|+aAkXcx-2Apy)h^BkOyFTWQVeZ%e2@;*0DtlG9I3Et=PKaPt&K zw?WI7S;P)TWED7aSH$3hL@Qde?H#tzo^<(o_sv_2ci<7M?F$|oCFWc?7@KBj-;N$P zB;q!8@bW-WJY9do&y|6~mEruZAVe$!?{)N9rZZxD-|oltkhW9~nR8bLBGXw<632!l z*TYQn^NnUy%Ds}$f^=yQ+BM-a5X4^GHF=%PDrRfm_uqC zh{sKwIu|O0&jWb27;wzg4w5uA@TO_j(1X?8E>5Zfma|Ly7Bklq|s z9)H`zoAGY3n-+&JPrT!>u^qg9Evx4y@GI4$n-Uk_5wttU1_t?6><>}cZ-U+&+~JE) zPlDbO_j;MoxdLzMd~Ew|1o^a5q_1R*JZ=#XXMzg?6Zy!^hop}qoLQlJ{(%!KYt`MK z8umEN@Z4w!2=q_oe=;QttPCQy3Nm4F@x>@v4sz_jo{4m*0r%J(w1cSo;D_hQtJs7W z><$QrmG^+<$4{d2bgGo&3-FV}avg9zI|Rr(k{wTyl3!M1q+a zD9W{pCd%il*j&Ft z5H$nENf>>k$;SONGW`qo6`&qKs*T z2^RS)pXk9b@(_Fw1bkb)-oqK|v}r$L!W&aXA>IpcdNZ_vWE#XO8X`#Yp1+?RshVcd zknG%rPd*4ECEI0wD#@d+3NbHKxl}n^Sgkx==Iu%}HvNliOqVBqG?P2va zQ;kRJ$J6j;+wP9cS za#m;#GUT!qAV%+rdWolk+)6kkz4@Yh5LXP+LSvo9_T+MmiaP-eq6_k;)i6_@WSJ zlT@wK$zqHu<83U2V*yJ|XJU4farT#pAA&@qu)(PO^8PxEmPD4;Txpio+2)#!9 z>&=i7*#tc0`?!==vk>s7V+PL#S1;PwSY?NIXN2=Gu89x(cToFm))7L;< z+bhAbVD*bD=}iU`+PU+SBobTQ%S!=VL!>q$rfWsaaV}Smz>lO9JXT#`CcH_mRCSf4%YQAw`$^yY z3Y*^Nzk_g$xn7a_NO(2Eb*I=^;4f!Ra#Oo~LLjlcjke*k*o$~U#0ZXOQ5@HQ&T46l z7504MUgZkz2gNP1QFN8Y?nSEnEai^Rgyvl}xZfMUV6QrJcXp;jKGqB=D*tj{8(_pV zqyB*DK$2lgYGejmJUW)*s_Cv65sFf&pb(Yz8oWgDtQ0~k^0-wdF|tj}MOXaN@ydF8 zNr={U?=;&Z?wr^VC+`)S2xl}QFagy;$mG=TUs7Vi2wws5zEke4hTa2)>O0U?$WYsZ z<8bN2bB_N4AWd%+kncgknZ&}bM~eDtj#C5uRkp21hWW5gxWvc6b*4+dn<{c?w9Rmf zIVZKsPl{W2vQAlYO3yh}-{Os=YBnL8?uN5(RqfQ=-1cOiUnJu>KcLA*tQK3FU`_bM zM^T28w;nAj5EdAXFi&Kk1Nnl2)D!M{@+D-}bIEe+Lc4{s;YJc-{F#``iS2uk;2!Zp zF9#myUmO!wCeJIoi^A+T^e~20c+c2C}XltaR!|U-HfDA=^xF97ev}$l6#oY z&-&T{egB)&aV$3_aVA51XGiU07$s9vubh_kQG?F$FycvS6|IO!6q zq^>9|3U^*!X_C~SxX&pqUkUjz%!j=VlXDo$!2VLH!rKj@61mDpSr~7B2yy{>X~_nc zRI+7g2V&k zd**H++P9dg!-AOs3;GM`(g<+GRV$+&DdMVpUxY9I1@uK28$az=6oaa+PutlO9?6#? zf-OsgT>^@8KK>ggkUQRPPgC7zjKFR5spqQb3ojCHzj^(UH~v+!y*`Smv)VpVoPwa6 zWG18WJaPKMi*F6Zdk*kU^`i~NNTfn3BkJniC`yN98L-Awd)Z&mY? zprBW$!qL-OL7h@O#kvYnLsfff@kDIegt~?{-*5A7JrA;#TmTe?jICJqhub-G@e??D zqiV#g{)M!kW1-4SDel7TO{;@*h2=_76g3NUD@|c*WO#>MfYq6_YVUP+&8e4|%4T`w zXzhmVNziAHazWO2qXcaOu@R1MrPP{t)`N)}-1&~mq=ZH=w=;-E$IOk=y$dOls{6sRR`I5>|X zpq~XYW4sd;J^6OwOf**J>a7u$S>WTFPRkjY;BfVgQst)u4aMLR1|6%)CB^18XCz+r ztkYQ}G43j~Q&1em(_EkMv0|WEiKu;z2zhb(L%$F&xWwzOmk;VLBYAZ8lOCziNoPw1 zv2BOyXA`A8z^WH!nXhKXM`t0;6D*-uGds3TYGrm8SPnJJOQ^fJU#}@aIy@MYWz**H zvkp?7I5PE{$$|~{-ZaFxr6ZolP^nL##mHOErB^AqJqn^hFA=)HWj!m3WDaHW$C)i^ z9@6G$SzB=>jbe>4kqr#sF7#K}W*Cg-5y6kun3u&0L7BpXF9=#7IN8FOjWrWwUBZiU zT_se3ih-GBKx+Uw0N|CwP3D@-C=5(9T#BH@M`F2!Goiqx+Js5xC92|Sy0%WWWp={$(am!#l~f^W_oz78HX<0X#7 zp)p1u~M*o9W@O8P{0Qkg@Wa# z2{Heb&oX^CQSZWSFBXKOfE|tsAm#^U-WkDnU;IowZ`Ok4!mwHwH=s|AqZ^YD4!5!@ zPxJj+Bd-q6w_YG`z_+r;S86zwXb+EO&qogOq8h-Ect5(M2+>(O7n7)^dP*ws_3U6v zVsh)sk^@*c>)3EML|0<-YROho{lz@Nd4;R9gL{9|64xVL`n!m$-Jjrx?-Bacp!=^5 z1^T^eB{_)Y<9)y{-4Rz@9_>;_7h;5D+@QcbF4Wv7hu)s0&==&6u)33 zHRj+&Woq-vDvjwJCYES@$C4{$?f$Ibi4G()UeN11rgjF+^;YE^5nYprYoJNoudNj= zm1pXSeG64dcWHObUetodRn1Fw|1nI$D9z}dVEYT0lQnsf_E1x2vBLql7NrHH!n&Sq z6lc*mvU=WS6=v9Lrl}&zRiu_6u;6g%_DU{9b+R z#YHqX7`m9eydf?KlKu6Sb%j$%_jmydig`B*TN`cZL-g!R)iE?+Q5oOqBFKhx z%MW>BC^(F_JuG(ayE(MT{S3eI{cKiwOtPwLc0XO*{*|(JOx;uQOfq@lp_^cZo=FZj z4#}@e@dJ>Bn%2`2_WPeSN7si^{U#H=7N4o%Dq3NdGybrZgEU$oSm$hC)uNDC_M9xc zGzwh5Sg?mpBIE8lT2XsqTt3j3?We8}3bzLBTQd639vyg^$0#1epq8snlDJP2(BF)K zSx30RM+{f+b$g{9usIL8H!hCO117Xgv}ttPJm9wVRjPk;ePH@zxv%j9k5`TzdXLeT zFgFX`V7cYIcBls5WN0Pf6SMBN+;CrQ(|EsFd*xtwr#$R{Z9FP`OWtyNsq#mCgZ7+P z^Yn$haBJ)r96{ZJd8vlMl?IBxrgh=fdq_NF!1{jARCVz>jNdC)H^wfy?R94#MPdUjcYX>#wEx+LB#P-#4S-%YH>t-j+w zOFTI8gX$ard6fAh&g=u&56%3^-6E2tpk*wx3HSCQ+t7+*iOs zPk5ysqE}i*cQocFvA68xHfL|iX(C4h*67@3|5Qwle(8wT&!&{8*{f%0(5gH+m>$tq zp;AqrP7?XTEooYG1Dzfxc>W%*CyL16q|fQ0_jp%%Bk^k!i#Nbi(N9&T>#M{gez_Ws zYK=l}adalV(nH}I_!hNeb;tQFk3BHX7N}}R8%pek^E`X}%ou=cx8InPU1EE0|Hen- zyw8MoJqB5=)Z%JXlrdTXAE)eqLAdVE-=>wGHrkRet}>3Yu^lt$Kzu%$3#(ioY}@Gu zjk3BZuQH&~7H+C*uX^4}F*|P89JX;Hg2U!pt>rDi(n(Qe-c}tzb0#6_ItoR0->LSt zR~UT<-|@TO%O`M+_e_J4wx7^)5_%%u+J=yF_S#2Xd?C;Ss3N7KY^#-vx+|;bJX&8r zD?|MetfhdC;^2WG`7MCgs>TKKN=^=!x&Q~BzmQio_^l~LboTNT=I zC5pme^P@ER``p$2md9>4!K#vV-Fc1an7pl>_|&>aqP}+zqR?+~Z;f2^`a+-!Te%V? z;H2SbF>jP^GE(R1@%C==XQ@J=G9lKX+Z<@5}PO(EYkJh=GCv#)Nj{DkWJM2}F&oAZ6xu8&g7pn1ps2U5srwQ7CAK zN&*~@t{`31lUf`O;2w^)M3B@o)_mbRu{-`PrfNpF!R^q>yTR&ETS7^-b2*{-tZAZz zw@q5x9B5V8Qd7dZ!Ai$9hk%Q!wqbE1F1c96&zwBBaRW}(^axoPpN^4Aw}&a5dMe+*Gomky_l^54*rzXro$ z>LL)U5Ry>~FJi=*{JDc)_**c)-&faPz`6v`YU3HQa}pLtb5K)u%K+BOqXP0)rj5Au$zB zW1?vr?mDv7Fsxtsr+S6ucp2l#(4dnr9sD*v+@*>g#M4b|U?~s93>Pg{{a5|rm2xfI z`>E}?9S@|IoUX{Q1zjm5YJT|3S>&09D}|2~BiMo=z4YEjXlWh)V&qs;*C{`UMxp$9 zX)QB?G$fPD6z5_pNs>Jeh{^&U^)Wbr?2D6-q?)`*1k@!UvwQgl8eG$r+)NnFoT)L6 zg7lEh+E6J17krfYJCSjWzm67hEth24pomhz71|Qodn#oAILN)*Vwu2qpJirG)4Wnv}9GWOFrQg%Je+gNrPl8mw7ykE8{ z=|B4+uwC&bpp%eFcRU6{mxRV32VeH8XxX>v$du<$(DfinaaWxP<+Y97Z#n#U~V zVEu-GoPD=9$}P;xv+S~Ob#mmi$JQmE;Iz4(){y*9pFyW-jjgdk#oG$fl4o9E8bo|L zWjo4l%n51@Kz-n%zeSCD`uB?T%FVk+KBI}=ve zvlcS#wt`U6wrJo}6I6Rwb=1GzZfwE=I&Ne@p7*pH84XShXYJRgvK)UjQL%R9Zbm(m zxzTQsLTON$WO7vM)*vl%Pc0JH7WhP;$z@j=y#avW4X8iqy6mEYr@-}PW?H)xfP6fQ z&tI$F{NNct4rRMSHhaelo<5kTYq+(?pY)Ieh8*sa83EQfMrFupMM@nfEV@EmdHUv9 z35uzIrIuo4#WnF^_jcpC@uNNaYTQ~uZWOE6P@LFT^1@$o&q+9Qr8YR+ObBkpP9=F+$s5+B!mX2~T zAuQ6RenX?O{IlLMl1%)OK{S7oL}X%;!XUxU~xJN8xk z`xywS*naF(J#?vOpB(K=o~lE;m$zhgPWDB@=p#dQIW>xe_p1OLoWInJRKbEuoncf; zmS1!u-ycc1qWnDg5Nk2D)BY%jmOwCLC+Ny>`f&UxFowIsHnOXfR^S;&F(KXd{ODlm z$6#1ccqt-HIH9)|@fHnrKudu!6B$_R{fbCIkSIb#aUN|3RM>zuO>dpMbROZ`^hvS@ z$FU-;e4W}!ubzKrU@R*dW*($tFZ>}dd*4_mv)#O>X{U@zSzQt*83l9mI zI$8O<5AIDx`wo0}f2fsPC_l>ONx_`E7kdXu{YIZbp1$(^oBAH({T~&oQ&1{X951QW zmhHUxd)t%GQ9#ak5fTjk-cahWC;>^Rg7(`TVlvy0W@Y!Jc%QL3Ozu# zDPIqBCy&T2PWBj+d-JA-pxZlM=9ja2ce|3B(^VCF+a*MMp`(rH>Rt6W1$;r{n1(VK zLs>UtkT43LR2G$AOYHVailiqk7naz2yZGLo*xQs!T9VN5Q>eE(w zw$4&)&6xIV$IO^>1N-jrEUg>O8G4^@y+-hQv6@OmF@gy^nL_n1P1-Rtyy$Bl;|VcV zF=p*&41-qI5gG9UhKmmnjs932!6hceXa#-qfK;3d*a{)BrwNFeKU|ge?N!;zk+kB! zMD_uHJR#%b54c2tr~uGPLTRLg$`fupo}cRJeTwK;~}A>(Acy4k-Xk&Aa1&eWYS1ULWUj@fhBiWY$pdfy+F z@G{OG{*v*mYtH3OdUjwEr6%_ZPZ3P{@rfbNPQG!BZ7lRyC^xlMpWH`@YRar`tr}d> z#wz87t?#2FsH-jM6m{U=gp6WPrZ%*w0bFm(T#7m#v^;f%Z!kCeB5oiF`W33W5Srdt zdU?YeOdPG@98H7NpI{(uN{FJdu14r(URPH^F6tOpXuhU7T9a{3G3_#Ldfx_nT(Hec zo<1dyhsVsTw;ZkVcJ_0-h-T3G1W@q)_Q30LNv)W?FbMH+XJ* zy=$@39Op|kZv`Rt>X`zg&at(?PO^I=X8d9&myFEx#S`dYTg1W+iE?vt#b47QwoHI9 zNP+|3WjtXo{u}VG(lLUaW0&@yD|O?4TS4dfJI`HC-^q;M(b3r2;7|FONXphw-%7~* z&;2!X17|05+kZOpQ3~3!Nb>O94b&ZSs%p)TK)n3m=4eiblVtSx@KNFgBY_xV6ts;NF;GcGxMP8OKV^h6LmSb2E#Qnw ze!6Mnz7>lE9u{AgQ~8u2zM8CYD5US8dMDX-5iMlgpE9m*s+Lh~A#P1er*rF}GHV3h z=`STo?kIXw8I<`W0^*@mB1$}pj60R{aJ7>C2m=oghKyxMbFNq#EVLgP0cH3q7H z%0?L93-z6|+jiN|@v>ix?tRBU(v-4RV`}cQH*fp|)vd3)8i9hJ3hkuh^8dz{F5-~_ zUUr1T3cP%cCaTooM8dj|4*M=e6flH0&8ve32Q)0dyisl))XkZ7Wg~N}6y`+Qi2l+e zUd#F!nJp{#KIjbQdI`%oZ`?h=5G^kZ_uN`<(`3;a!~EMsWV|j-o>c?x#;zR2ktiB! z);5rrHl?GPtr6-o!tYd|uK;Vbsp4P{v_4??=^a>>U4_aUXPWQ$FPLE4PK$T^3Gkf$ zHo&9$U&G`d(Os6xt1r?sg14n)G8HNyWa^q8#nf0lbr4A-Fi;q6t-`pAx1T*$eKM*$ z|CX|gDrk#&1}>5H+`EjV$9Bm)Njw&7-ZR{1!CJTaXuP!$Pcg69`{w5BRHysB$(tWUes@@6aM69kb|Lx$%BRY^-o6bjH#0!7b;5~{6J+jKxU!Kmi# zndh@+?}WKSRY2gZ?Q`{(Uj|kb1%VWmRryOH0T)f3cKtG4oIF=F7RaRnH0Rc_&372={_3lRNsr95%ZO{IX{p@YJ^EI%+gvvKes5cY+PE@unghjdY5#9A!G z70u6}?zmd?v+{`vCu-53_v5@z)X{oPC@P)iA3jK$`r zSA2a7&!^zmUiZ82R2=1cumBQwOJUPz5Ay`RLfY(EiwKkrx%@YN^^XuET;tE zmr-6~I7j!R!KrHu5CWGSChO6deaLWa*9LLJbcAJsFd%Dy>a!>J`N)Z&oiU4OEP-!Ti^_!p}O?7`}i7Lsf$-gBkuY*`Zb z7=!nTT;5z$_5$=J=Ko+Cp|Q0J=%oFr>hBgnL3!tvFoLNhf#D0O=X^h+x08iB;@8pXdRHxX}6R4k@i6%vmsQwu^5z zk1ip`#^N)^#Lg#HOW3sPI33xqFB4#bOPVnY%d6prwxf;Y-w9{ky4{O6&94Ra8VN@K zb-lY;&`HtxW@sF!doT5T$2&lIvJpbKGMuDAFM#!QPXW87>}=Q4J3JeXlwHys?!1^#37q_k?N@+u&Ns20pEoBeZC*np;i;M{2C0Z4_br2gsh6eL z#8`#sn41+$iD?^GL%5?cbRcaa-Nx0vE(D=*WY%rXy3B%gNz0l?#noGJGP728RMY#q z=2&aJf@DcR?QbMmN)ItUe+VM_U!ryqA@1VVt$^*xYt~-qvW!J4Tp<-3>jT=7Zow5M z8mSKp0v4b%a8bxFr>3MwZHSWD73D@+$5?nZAqGM#>H@`)mIeC#->B)P8T$zh-Pxnc z8)~Zx?TWF4(YfKuF3WN_ckpCe5;x4V4AA3(i$pm|78{%!q?|~*eH0f=?j6i)n~Hso zmTo>vqEtB)`%hP55INf7HM@taH)v`Fw40Ayc*R!T?O{ziUpYmP)AH`euTK!zg9*6Z z!>M=$3pd0!&TzU=hc_@@^Yd3eUQpX4-33}b{?~5t5lgW=ldJ@dUAH%`l5US1y_`40 zs(X`Qk}vvMDYYq+@Rm+~IyCX;iD~pMgq^KY)T*aBz@DYEB={PxA>)mI6tM*sx-DmGQHEaHwRrAmNjO!ZLHO4b;;5mf@zzlPhkP($JeZGE7 z?^XN}Gf_feGoG~BjUgVa*)O`>lX=$BSR2)uD<9 z>o^|nb1^oVDhQbfW>>!;8-7<}nL6L^V*4pB=>wwW+RXAeRvKED(n1;R`A6v$6gy0I(;Vf?!4;&sgn7F%LpM}6PQ?0%2Z@b{It<(G1CZ|>913E0nR2r^Pa*Bp z@tFGi*CQ~@Yc-?{cwu1 zsilf=k^+Qs>&WZG(3WDixisHpR>`+ihiRwkL(3T|=xsoNP*@XX3BU8hr57l3k;pni zI``=3Nl4xh4oDj<%>Q1zYXHr%Xg_xrK3Nq?vKX3|^Hb(Bj+lONTz>4yhU-UdXt2>j z<>S4NB&!iE+ao{0Tx^N*^|EZU;0kJkx@zh}S^P{ieQjGl468CbC`SWnwLRYYiStXm zOxt~Rb3D{dz=nHMcY)#r^kF8|q8KZHVb9FCX2m^X*(|L9FZg!5a7((!J8%MjT$#Fs)M1Pb zq6hBGp%O1A+&%2>l0mpaIzbo&jc^!oN^3zxap3V2dNj3x<=TwZ&0eKX5PIso9j1;e zwUg+C&}FJ`k(M|%%}p=6RPUq4sT3-Y;k-<68ciZ~_j|bt>&9ZLHNVrp#+pk}XvM{8 z`?k}o-!if>hVlCP9j%&WI2V`5SW)BCeR5>MQhF)po=p~AYN%cNa_BbV6EEh_kk^@a zD>4&>uCGCUmyA-c)%DIcF4R6!>?6T~Mj_m{Hpq`*(wj>foHL;;%;?(((YOxGt)Bhx zuS+K{{CUsaC++%}S6~CJ=|vr(iIs-je)e9uJEU8ZJAz)w166q)R^2XI?@E2vUQ!R% zn@dxS!JcOimXkWJBz8Y?2JKQr>`~SmE2F2SL38$SyR1^yqj8_mkBp)o$@+3BQ~Mid z9U$XVqxX3P=XCKj0*W>}L0~Em`(vG<>srF8+*kPrw z20{z(=^w+ybdGe~Oo_i|hYJ@kZl*(9sHw#Chi&OIc?w`nBODp?ia$uF%Hs(X>xm?j zqZQ`Ybf@g#wli`!-al~3GWiE$K+LCe=Ndi!#CVjzUZ z!sD2O*;d28zkl))m)YN7HDi^z5IuNo3^w(zy8 zszJG#mp#Cj)Q@E@r-=NP2FVxxEAeOI2e=|KshybNB6HgE^(r>HD{*}S}mO>LuRGJT{*tfTzw_#+er-0${}%YPe@CMJ1Ng#j#)i)SnY@ss3gL;g zg2D~#Kpdfu#G;q1qz_TwSz1VJT(b3zby$Vk&;Y#1(A)|xj`_?i5YQ;TR%jice5E;0 zYHg;`zS5{S*9xI6o^j>rE8Ua*XhIw{_-*&@(R|C(am8__>+Ws&Q^ymy*X4~hR2b5r zm^p3sw}yv=tdyncy_Ui7{BQS732et~Z_@{-IhHDXAV`(Wlay<#hb>%H%WDi+K$862nA@BDtM#UCKMu+kM`!JHyWSi?&)A7_ z3{cyNG%a~nnH_!+;g&JxEMAmh-Z}rC!o7>OVzW&PoMyTA_g{hqXG)SLraA^OP**<7 zjWbr7z!o2n3hnx7A=2O=WL;`@9N{vQIM@&|G-ljrPvIuJHYtss0Er0fT5cMXNUf1B z7FAwBDixt0X7C3S)mPe5g`YtME23wAnbU)+AtV}z+e8G;0BP=bI;?(#|Ep!vVfDbK zvx+|CKF>yt0hWQ3drchU#XBU+HiuG*V^snFAPUp-5<#R&BUAzoB!aZ+e*KIxa26V}s6?nBK(U-7REa573wg-jqCg>H8~>O{ z*C0JL-?X-k_y%hpUFL?I>0WV{oV`Nb)nZbJG01R~AG>flIJf)3O*oB2i8~;!P?Wo_ z0|QEB*fifiL6E6%>tlAYHm2cjTFE@*<);#>689Z6S#BySQ@VTMhf9vYQyLeDg1*F} zjq>i1*x>5|CGKN{l9br3kB0EHY|k4{%^t7-uhjd#NVipUZa=EUuE5kS1_~qYX?>hJ z$}!jc9$O$>J&wnu0SgfYods^z?J4X;X7c77Me0kS-dO_VUQ39T(Kv(Y#s}Qqz-0AH z^?WRL(4RzpkD+T5FG_0NyPq-a-B7A5LHOCqwObRJi&oRi(<;OuIN7SV5PeHU$<@Zh zPozEV`dYmu0Z&Tqd>t>8JVde9#Pt+l95iHe$4Xwfy1AhI zDM4XJ;bBTTvRFtW>E+GzkN)9k!hA5z;xUOL2 zq4}zn-DP{qc^i|Y%rvi|^5k-*8;JZ~9a;>-+q_EOX+p1Wz;>i7c}M6Nv`^NY&{J-> z`(mzDJDM}QPu5i44**2Qbo(XzZ-ZDu%6vm8w@DUarqXj41VqP~ zs&4Y8F^Waik3y1fQo`bVUH;b=!^QrWb)3Gl=QVKr+6sxc=ygauUG|cm?|X=;Q)kQ8 zM(xrICifa2p``I7>g2R~?a{hmw@{!NS5`VhH8+;cV(F>B94M*S;5#O`YzZH1Z%yD? zZ61w(M`#aS-*~Fj;x|J!KM|^o;MI#Xkh0ULJcA?o4u~f%Z^16ViA27FxU5GM*rKq( z7cS~MrZ=f>_OWx8j#-Q3%!aEU2hVuTu(7`TQk-Bi6*!<}0WQi;_FpO;fhpL4`DcWp zGOw9vx0N~6#}lz(r+dxIGZM3ah-8qrqMmeRh%{z@dbUD2w15*_4P?I~UZr^anP}DB zU9CCrNiy9I3~d#&!$DX9e?A});BjBtQ7oGAyoI$8YQrkLBIH@2;lt4E^)|d6Jwj}z z&2_E}Y;H#6I4<10d_&P0{4|EUacwFHauvrjAnAm6yeR#}f}Rk27CN)vhgRqEyPMMS7zvunj2?`f;%?alsJ+-K+IzjJx>h8 zu~m_y$!J5RWAh|C<6+uiCNsOKu)E72M3xKK(a9Okw3e_*O&}7llNV!=P87VM2DkAk zci!YXS2&=P0}Hx|wwSc9JP%m8dMJA*q&VFB0yMI@5vWoAGraygwn){R+Cj6B1a2Px z5)u(K5{+;z2n*_XD!+Auv#LJEM)(~Hx{$Yb^ldQmcYF2zNH1V30*)CN_|1$v2|`LnFUT$%-tO0Eg|c5$BB~yDfzS zcOXJ$wpzVK0MfTjBJ0b$r#_OvAJ3WRt+YOLlJPYMx~qp>^$$$h#bc|`g0pF-Ao43? z>*A+8lx>}L{p(Tni2Vvk)dtzg$hUKjSjXRagj)$h#8=KV>5s)J4vGtRn5kP|AXIz! zPgbbVxW{2o4s-UM;c#We8P&mPN|DW7_uLF!a|^0S=wr6Esx9Z$2|c1?GaupU6$tb| zY_KU`(_29O_%k(;>^|6*pZURH3`@%EuKS;Ns z1lujmf;r{qAN&Q0&m{wJSZ8MeE7RM5+Sq;ul_ z`+ADrd_Um+G37js6tKsArNB}n{p*zTUxQr>3@wA;{EUbjNjlNd6$Mx zg0|MyU)v`sa~tEY5$en7^PkC=S<2@!nEdG6L=h(vT__0F=S8Y&eM=hal#7eM(o^Lu z2?^;05&|CNliYrq6gUv;|i!(W{0N)LWd*@{2q*u)}u*> z7MQgk6t9OqqXMln?zoMAJcc zMKaof_Up})q#DzdF?w^%tTI7STI^@8=Wk#enR*)&%8yje>+tKvUYbW8UAPg55xb70 zEn5&Ba~NmOJlgI#iS8W3-@N%>V!#z-ZRwfPO1)dQdQkaHsiqG|~we2ALqG7Ruup(DqSOft2RFg_X%3w?6VqvV1uzX_@F(diNVp z4{I|}35=11u$;?|JFBEE*gb;T`dy+8gWJ9~pNsecrO`t#V9jW-6mnfO@ff9od}b(3s4>p0i30gbGIv~1@a^F2kl7YO;DxmF3? zWi-RoXhzRJV0&XE@ACc?+@6?)LQ2XNm4KfalMtsc%4!Fn0rl zpHTrHwR>t>7W?t!Yc{*-^xN%9P0cs0kr=`?bQ5T*oOo&VRRu+1chM!qj%2I!@+1XF z4GWJ=7ix9;Wa@xoZ0RP`NCWw0*8247Y4jIZ>GEW7zuoCFXl6xIvz$ezsWgKdVMBH> z{o!A7f;R-@eK9Vj7R40xx)T<2$?F2E<>Jy3F;;=Yt}WE59J!1WN367 zA^6pu_zLoZIf*x031CcwotS{L8bJE(<_F%j_KJ2P_IusaZXwN$&^t716W{M6X2r_~ zaiMwdISX7Y&Qi&Uh0upS3TyEIXNDICQlT5fHXC`aji-c{U(J@qh-mWl-uMN|T&435 z5)a1dvB|oe%b2mefc=Vpm0C%IUYYh7HI*;3UdgNIz}R##(#{(_>82|zB0L*1i4B5j-xi9O4x10rs_J6*gdRBX=@VJ+==sWb&_Qc6tSOowM{BX@(zawtjl zdU!F4OYw2@Tk1L^%~JCwb|e#3CC>srRHQ*(N%!7$Mu_sKh@|*XtR>)BmWw!;8-mq7 zBBnbjwx8Kyv|hd*`5}84flTHR1Y@@uqjG`UG+jN_YK&RYTt7DVwfEDXDW4U+iO{>K zw1hr{_XE*S*K9TzzUlJH2rh^hUm2v7_XjwTuYap|>zeEDY$HOq3X4Tz^X}E9z)x4F zs+T?Ed+Hj<#jY-`Va~fT2C$=qFT-5q$@p9~0{G&eeL~tiIAHXA!f6C(rAlS^)&k<- zXU|ZVs}XQ>s5iONo~t!XXZgtaP$Iau;JT%h)>}v54yut~pykaNye4axEK#5@?TSsQ zE;Jvf9I$GVb|S`7$pG)4vgo9NXsKr?u=F!GnA%VS2z$@Z(!MR9?EPcAqi5ft)Iz6sNl`%kj+_H-X`R<>BFrBW=fSlD|{`D%@Rcbu2?%>t7i34k?Ujb)2@J-`j#4 zLK<69qcUuniIan-$A1+fR=?@+thwDIXtF1Tks@Br-xY zfB+zblrR(ke`U;6U~-;p1Kg8Lh6v~LjW@9l2P6s+?$2!ZRPX`(ZkRGe7~q(4&gEi<$ch`5kQ?*1=GSqkeV z{SA1EaW_A!t{@^UY2D^YO0(H@+kFVzZaAh0_`A`f(}G~EP~?B|%gtxu&g%^x{EYSz zk+T;_c@d;+n@$<>V%P=nk36?L!}?*=vK4>nJSm+1%a}9UlmTJTrfX4{Lb7smNQn@T zw9p2%(Zjl^bWGo1;DuMHN(djsEm)P8mEC2sL@KyPjwD@d%QnZ$ zMJ3cnn!_!iP{MzWk%PI&D?m?C(y2d|2VChluN^yHya(b`h>~GkI1y;}O_E57zOs!{ zt2C@M$^PR2U#(dZmA-sNreB@z-yb0Bf7j*yONhZG=onhx>t4)RB`r6&TP$n zgmN*)eCqvgriBO-abHQ8ECN0bw?z5Bxpx z=jF@?zFdVn?@gD5egM4o$m`}lV(CWrOKKq(sv*`mNcHcvw&Xryfw<{ch{O&qc#WCTXX6=#{MV@q#iHYba!OUY+MGeNTjP%Fj!WgM&`&RlI^=AWTOqy-o zHo9YFt!gQ*p7{Fl86>#-JLZo(b^O`LdFK~OsZBRR@6P?ad^Ujbqm_j^XycM4ZHFyg ziUbIFW#2tj`65~#2V!4z7DM8Z;fG0|APaQ{a2VNYpNotB7eZ5kp+tPDz&Lqs0j%Y4tA*URpcfi z_M(FD=fRGdqf430j}1z`O0I=;tLu81bwJXdYiN7_&a-?ly|-j*+=--XGvCq#32Gh(=|qj5F?kmihk{%M&$}udW5)DHK zF_>}5R8&&API}o0osZJRL3n~>76nUZ&L&iy^s>PMnNcYZ|9*1$v-bzbT3rpWsJ+y{ zPrg>5Zlery96Um?lc6L|)}&{992{_$J&=4%nRp9BAC6!IB=A&=tF>r8S*O-=!G(_( zwXbX_rGZgeiK*&n5E;f=k{ktyA1(;x_kiMEt0*gpp_4&(twlS2e5C?NoD{n>X2AT# zY@Zp?#!b1zNq96MQqeO*M1MMBin5v#RH52&Xd~DO6-BZLnA6xO1$sou(YJ1Dlc{WF zVa%2DyYm`V#81jP@70IJ;DX@y*iUt$MLm)ByAD$eUuji|5{ptFYq(q)mE(5bOpxjM z^Q`AHWq44SG3`_LxC9fwR)XRVIp=B%<(-lOC3jI#bb@dK(*vjom!=t|#<@dZql%>O z15y^{4tQoeW9Lu%G&V$90x6F)xN6y_oIn;!Q zs)8jT$;&;u%Y>=T3hg34A-+Y*na=|glcStr5D;&5*t5*DmD~x;zQAV5{}Ya`?RRGa zT*t9@$a~!co;pD^!J5bo?lDOWFx%)Y=-fJ+PDGc0>;=q=s?P4aHForSB+)v0WY2JH z?*`O;RHum6j%#LG)Vu#ciO#+jRC3!>T(9fr+XE7T2B7Z|0nR5jw@WG)kDDzTJ=o4~ zUpeyt7}_nd`t}j9BKqryOha{34erm)RmST)_9Aw)@ zHbiyg5n&E{_CQR@h<}34d7WM{s{%5wdty1l+KX8*?+-YkNK2Be*6&jc>@{Fd;Ps|| z26LqdI3#9le?;}risDq$K5G3yoqK}C^@-8z^wj%tdgw-6@F#Ju{Sg7+y)L?)U$ez> zoOaP$UFZ?y5BiFycir*pnaAaY+|%1%8&|(@VB)zweR%?IidwJyK5J!STzw&2RFx zZV@qeaCB01Hu#U9|1#=Msc8Pgz5P*4Lrp!Q+~(G!OiNR{qa7|r^H?FC6gVhkk3y7=uW#Sh;&>78bZ}aK*C#NH$9rX@M3f{nckYI+5QG?Aj1DM)@~z_ zw!UAD@gedTlePB*%4+55naJ8ak_;))#S;4ji!LOqY5VRI){GMwHR~}6t4g>5C_#U# ztYC!tjKjrKvRy=GAsJVK++~$|+s!w9z3H4G^mACv=EErXNSmH7qN}%PKcN|8%9=i)qS5+$L zu&ya~HW%RMVJi4T^pv?>mw*Gf<)-7gf#Qj|e#w2|v4#t!%Jk{&xlf;$_?jW*n!Pyx zkG$<18kiLOAUPuFfyu-EfWX%4jYnjBYc~~*9JEz6oa)_R|8wjZA|RNrAp%}14L7fW zi7A5Wym*K+V8pkqqO-X#3ft{0qs?KVt^)?kS>AicmeO&q+~J~ zp0YJ_P~_a8j= zsAs~G=8F=M{4GZL{|B__UorX@MRNQLn?*_gym4aW(~+i13knnk1P=khoC-ViMZk+x zLW(l}oAg1H`dU+Fv**;qw|ANDSRs>cGqL!Yw^`; zv;{E&8CNJcc)GHzTYM}f&NPw<6j{C3gaeelU#y!M)w-utYEHOCCJo|Vgp7K6C_$14 zqIrLUB0bsgz^D%V%fbo2f9#yb#CntTX?55Xy|Kps&Xek*4_r=KDZ z+`TQuv|$l}MWLzA5Ay6Cvsa^7xvwXpy?`w(6vx4XJ zWuf1bVSb#U8{xlY4+wlZ$9jjPk)X_;NFMqdgq>m&W=!KtP+6NL57`AMljW+es zzqjUjgz;V*kktJI?!NOg^s_)ph45>4UDA!Vo0hn>KZ+h-3=?Y3*R=#!fOX zP$Y~+14$f66ix?UWB_6r#fMcC^~X4R-<&OD1CSDNuX~y^YwJ>sW0j`T<2+3F9>cLo z#!j57$ll2K9(%$4>eA7(>FJX5e)pR5&EZK!IMQzOfik#FU*o*LGz~7u(8}XzIQRy- z!U7AlMTIe|DgQFmc%cHy_9^{o`eD%ja_L>ckU6$O4*U**o5uR7`FzqkU8k4gxtI=o z^P^oGFPm5jwZMI{;nH}$?p@uV8FT4r=|#GziKXK07bHJLtK}X%I0TON$uj(iJ`SY^ zc$b2CoxCQ>7LH@nxcdW&_C#fMYBtTxcg46dL{vf%EFCZ~eErMvZq&Z%Lhumnkn^4A zsx$ay(FnN7kYah}tZ@0?-0Niroa~13`?hVi6`ndno`G+E8;$<6^gsE-K3)TxyoJ4M zb6pj5=I8^FD5H@`^V#Qb2^0cx7wUz&cruA5g>6>qR5)O^t1(-qqP&1g=qvY#s&{bx zq8Hc%LsbK1*%n|Y=FfojpE;w~)G0-X4i*K3{o|J7`krhIOd*c*$y{WIKz2n2*EXEH zT{oml3Th5k*vkswuFXdGDlcLj15Nec5pFfZ*0?XHaF_lVuiB%Pv&p7z)%38}%$Gup zVTa~C8=cw%6BKn_|4E?bPNW4PT7}jZQLhDJhvf4z;~L)506IE0 zX!tWXX(QOQPRj-p80QG79t8T2^az4Zp2hOHziQlvT!|H)jv{Ixodabzv6lBj)6WRB z{)Kg@$~~(7$-az?lw$4@L%I&DI0Lo)PEJJziWP33a3azb?jyXt1v0N>2kxwA6b%l> zZqRpAo)Npi&loWbjFWtEV)783BbeIAhqyuc+~>i7aQ8shIXt)bjCWT6$~ro^>99G} z2XfmT0(|l!)XJb^E!#3z4oEGIsL(xd; zYX1`1I(cG|u#4R4T&C|m*9KB1`UzKvho5R@1eYtUL9B72{i(ir&ls8g!pD ztR|25xGaF!4z5M+U@@lQf(12?xGy`!|3E}7pI$k`jOIFjiDr{tqf0va&3pOn6Pu)% z@xtG2zjYuJXrV)DUrIF*y<1O1<$#54kZ#2;=X51J^F#0nZ0(;S$OZDt_U2bx{RZ=Q zMMdd$fH|!s{ zXq#l;{`xfV`gp&C>A`WrQU?d{!Ey5(1u*VLJt>i27aZ-^&2IIk=zP5p+{$q(K?2(b z8?9h)kvj9SF!Dr zoyF}?V|9;6abHxWk2cEvGs$-}Pg}D+ZzgkaN&$Snp%;5m%zh1E#?Wac-}x?BYlGN#U#Mek*}kek#I9XaHt?mz3*fDrRTQ#&#~xyeqJk1QJ~E$7qsw6 z?sV;|?*=-{M<1+hXoj?@-$y+(^BJ1H~wQ9G8C0#^aEAyhDduNX@haoa=PuPp zYsGv8UBfQaRHgBgLjmP^eh>fLMeh{8ic)?xz?#3kX-D#Z{;W#cd_`9OMFIaJg-=t`_3*!YDgtNQ2+QUEAJB9M{~AvT$H`E)IKmCR21H532+ata8_i_MR@ z2Xj<3w<`isF~Ah$W{|9;51ub*f4#9ziKrOR&jM{x7I_7()O@`F*5o$KtZ?fxU~g`t zUovNEVKYn$U~VX8eR)qb`7;D8pn*Pp$(otYTqL)5KH$lUS-jf}PGBjy$weoceAcPp z&5ZYB$r&P$MN{0H0AxCe4Qmd3T%M*5d4i%#!nmBCN-WU-4m4Tjxn-%j3HagwTxCZ9 z)j5vO-C7%s%D!&UfO>bi2oXiCw<-w{vVTK^rVbv#W=WjdADJy8$khnU!`ZWCIU`># zyjc^1W~pcu>@lDZ{zr6gv%)2X4n27~Ve+cQqcND%0?IFSP4sH#yIaXXYAq^z3|cg` z`I3$m%jra>e2W-=DiD@84T!cb%||k)nPmEE09NC%@PS_OLhkrX*U!cgD*;;&gIaA(DyVT4QD+q_xu z>r`tg{hiGY&DvD-)B*h+YEd+Zn)WylQl}<4>(_NlsKXCRV;a)Rcw!wtelM2_rWX`j zTh5A|i6=2BA(iMCnj_fob@*eA;V?oa4Z1kRBGaU07O70fb6-qmA$Hg$ps@^ka1=RO zTbE_2#)1bndC3VuK@e!Sftxq4=Uux}fDxXE#Q5_x=E1h>T5`DPHz zbH<_OjWx$wy7=%0!mo*qH*7N4tySm+R0~(rbus`7;+wGh;C0O%x~fEMkt!eV>U$`i z5>Q(o z=t$gPjgGh0&I7KY#k50V7DJRX<%^X z>6+ebc9efB3@eE2Tr){;?_w`vhgF>`-GDY(YkR{9RH(MiCnyRtd!LxXJ75z+?2 zGi@m^+2hKJ5sB1@Xi@s_@p_Kwbc<*LQ_`mr^Y%j}(sV_$`J(?_FWP)4NW*BIL~sR>t6 zM;qTJZ~GoY36&{h-Pf}L#y2UtR}>ZaI%A6VkU>vG4~}9^i$5WP2Tj?Cc}5oQxe2=q z8BeLa$hwCg_psjZyC2+?yX4*hJ58Wu^w9}}7X*+i5Rjqu5^@GzXiw#SUir1G1`jY% zOL=GE_ENYxhcyUrEt9XlMNP6kx6h&%6^u3@zB8KUCAa18T(R2J`%JjWZ z!{7cXaEW+Qu*iJPu+m>QqW}Lo$4Z+!I)0JNzZ&_M%=|B1yejFRM04bGAvu{=lNPd+ zJRI^DRQ(?FcVUD+bgEcAi@o(msqys9RTCG#)TjI!9~3-dc`>gW;HSJuQvH~d`MQs86R$|SKXHh zqS9Qy)u;T`>>a!$LuaE2keJV%;8g)tr&Nnc;EkvA-RanHXsy)D@XN0a>h}z2j81R; zsUNJf&g&rKpuD0WD@=dDrPHdBoK42WoBU|nMo17o(5^;M|dB4?|FsAGVrSyWcI`+FVw^vTVC`y}f(BwJl zrw3Sp151^9=}B})6@H*i4-dIN_o^br+BkcLa^H56|^2XsT0dESw2 zMX>(KqNl=x2K5=zIKg}2JpGAZu{I_IO}0$EQ5P{4zol**PCt3F4`GX}2@vr8#Y)~J zKb)gJeHcFnR@4SSh%b;c%J`l=W*40UPjF#q{<}ywv-=vHRFmDjv)NtmC zQx9qm)d%0zH&qG7AFa3VAU1S^(n8VFTC~Hb+HjYMjX8r#&_0MzlNR*mnLH5hi}`@{ zK$8qiDDvS_(L9_2vHgzEQ${DYSE;DqB!g*jhJghE&=LTnbgl&Xepo<*uRtV{2wDHN z)l;Kg$TA>Y|K8Lc&LjWGj<+bp4Hiye_@BfU(y#nF{fpR&|Ltbye?e^j0}8JC4#xi% zv29ZR%8%hk=3ZDvO-@1u8KmQ@6p%E|dlHuy#H1&MiC<*$YdLkHmR#F3ae;bKd;@*i z2_VfELG=B}JMLCO-6UQy^>RDE%K4b>c%9ki`f~Z2Qu8hO7C#t%Aeg8E%+}6P7Twtg z-)dj(w}_zFK&86KR@q9MHicUAucLVshUdmz_2@32(V`y3`&Kf8Q2I)+!n0mR=rrDU zXvv^$ho;yh*kNqJ#r1}b0|i|xRUF6;lhx$M*uG3SNLUTC@|htC z-=fsw^F%$qqz4%QdjBrS+ov}Qv!z00E+JWas>p?z@=t!WWU3K*?Z(0meTuTOC7OTx zU|kFLE0bLZ+WGcL$u4E}5dB0g`h|uwv3=H6f+{5z9oLv-=Q45+n~V4WwgO=CabjM% zBAN+RjM65(-}>Q2V#i1Na@a0`08g&y;W#@sBiX6Tpy8r}*+{RnyGUT`?XeHSqo#|J z^ww~c;ou|iyzpErDtlVU=`8N7JSu>4M z_pr9=tX0edVn9B}YFO2y(88j#S{w%E8vVOpAboK*27a7e4Ekjt0)hIX99*1oE;vex z7#%jhY=bPijA=Ce@9rRO(Vl_vnd00!^TAc<+wVvRM9{;hP*rqEL_(RzfK$er_^SN; z)1a8vo8~Dr5?;0X0J62Cusw$A*c^Sx1)dom`-)Pl7hsW4i(r*^Mw`z5K>!2ixB_mu z*Ddqjh}zceRFdmuX1akM1$3>G=#~|y?eYv(e-`Qy?bRHIq=fMaN~fB zUa6I8Rt=)jnplP>yuS+P&PxeWpJ#1$F`iqRl|jF$WL_aZFZl@kLo&d$VJtu&w?Q0O zzuXK>6gmygq(yXJy0C1SL}T8AplK|AGNUOhzlGeK_oo|haD@)5PxF}rV+5`-w{Aag zus45t=FU*{LguJ11Sr-28EZkq;!mJO7AQGih1L4rEyUmp>B!%X0YemsrV3QFvlgt* z5kwlPzaiJ+kZ^PMd-RRbl(Y?F*m`4*UIhIuf#8q>H_M=fM*L_Op-<_r zBZagV=4B|EW+KTja?srADTZXCd3Yv%^Chfpi)cg{ED${SI>InNpRj5!euKv?=Xn92 zsS&FH(*w`qLIy$doc>RE&A5R?u zzkl1sxX|{*fLpXvIW>9d<$ePROttn3oc6R!sN{&Y+>Jr@yeQN$sFR z;w6A<2-0%UA?c8Qf;sX7>>uKRBv3Ni)E9pI{uVzX|6Bb0U)`lhLE3hK58ivfRs1}d zNjlGK0hdq0qjV@q1qI%ZFMLgcpWSY~mB^LK)4GZ^h_@H+3?dAe_a~k*;9P_d7%NEFP6+ zgV(oGr*?W(ql?6SQ~`lUsjLb%MbfC4V$)1E0Y_b|OIYxz4?O|!kRb?BGrgiH5+(>s zoqM}v*;OBfg-D1l`M6T6{K`LG+0dJ1)!??G5g(2*vlNkm%Q(MPABT$r13q?|+kL4- zf)Mi5r$sn;u41aK(K#!m+goyd$c!KPl~-&-({j#D4^7hQkV3W|&>l_b!}!z?4($OA z5IrkfuT#F&S1(`?modY&I40%gtroig{YMvF{K{>5u^I51k8RriGd${z)=5k2tG zM|&Bp5kDTfb#vfuTTd?)a=>bX=lokw^y9+2LS?kwHQIWI~pYgy7 zb?A-RKVm_vM5!9?C%qYdfRAw& zAU7`up~%g=p@}pg#b7E)BFYx3g%(J36Nw(Dij!b>cMl@CSNbrW!DBDbTD4OXk!G4x zi}JBKc8HBYx$J~31PXH+4^x|UxK~(<@I;^3pWN$E=sYma@JP|8YL`L(zI6Y#c%Q{6 z*APf`DU$S4pr#_!60BH$FGViP14iJmbrzSrOkR;f3YZa{#E7Wpd@^4E-zH8EgPc-# zKWFPvh%WbqU_%ZEt`=Q?odKHc7@SUmY{GK`?40VuL~o)bS|is$Hn=<=KGHOsEC5tB zFb|q}gGlL97NUf$G$>^1b^3E18PZ~Pm9kX%*ftnolljiEt@2#F2R5ah$zbXd%V_Ev zyDd{1o_uuoBga$fB@Fw!V5F3jIr=a-ykqrK?WWZ#a(bglI_-8pq74RK*KfQ z0~Dzus7_l;pMJYf>Bk`)`S8gF!To-BdMnVw5M-pyu+aCiC5dwNH|6fgRsIKZcF&)g zr}1|?VOp}I3)IR@m1&HX1~#wsS!4iYqES zK}4J{Ei>;e3>LB#Oly>EZkW14^@YmpbgxCDi#0RgdM${&wxR+LiX}B+iRioOB0(pDKpVEI;ND?wNx>%e|m{RsqR_{(nmQ z3ZS}@t!p4a(BKx_-CYwrcyJ5u1TO9bcXti$8sy>xcLKqKCc#~UOZYD{llKTSFEjJ~ zyNWt>tLU}*>^`TvPxtP%F`ZJQw@W0^>x;!^@?k_)9#bF$j0)S3;mH-IR5y82l|%=F z2lR8zhP?XNP-ucZZ6A+o$xOyF!w;RaLHGh57GZ|TCXhJqY~GCh)aXEV$1O&$c}La1 zjuJxkY9SM4av^Hb;i7efiYaMwI%jGy`3NdY)+mcJhF(3XEiSlU3c|jMBi|;m-c?~T z+x0_@;SxcoY=(6xNgO$bBt~Pj8`-<1S|;Bsjrzw3@zSjt^JC3X3*$HI79i~!$RmTz zsblZsLYs7L$|=1CB$8qS!tXrWs!F@BVuh?kN(PvE5Av-*r^iYu+L^j^m9JG^#=m>@ z=1soa)H*w6KzoR$B8mBCXoU;f5^bVuwQ3~2LKg!yxomG1#XPmn(?YH@E~_ED+W6mxs%x{%Z<$pW`~ON1~2XjP5v(0{C{+6Dm$00tsd3w=f=ZENy zOgb-=f}|Hb*LQ$YdWg<(u7x3`PKF)B7ZfZ6;1FrNM63 z?O6tE%EiU@6%rVuwIQjvGtOofZBGZT1Sh(xLIYt9c4VI8`!=UJd2BfLjdRI#SbVAX ziT(f*RI^T!IL5Ac>ql7uduF#nuCRJ1)2bdvAyMxp-5^Ww5p#X{rb5)(X|fEhDHHW{ zw(Lfc$g;+Q`B0AiPGtmK%*aWfQQ$d!*U<|-@n2HZvCWSiw^I>#vh+LyC;aaVWGbmkENr z&kl*8o^_FW$T?rDYLO1Pyi%>@&kJKQoH2E0F`HjcN}Zlnx1ddoDA>G4Xu_jyp6vuT zPvC}pT&Owx+qB`zUeR|4G;OH(<<^_bzkjln0k40t`PQxc$7h(T8Ya~X+9gDc8Z9{Z z&y0RAU}#_kQGrM;__MK9vwIwK^aoqFhk~dK!ARf1zJqHMxF2?7-8|~yoO@_~Ed;_wvT%Vs{9RK$6uUQ|&@#6vyBsFK9eZW1Ft#D2)VpQRwpR(;x^ zdoTgMqfF9iBl%{`QDv7B0~8{8`8k`C4@cbZAXBu00v#kYl!#_Wug{)2PwD5cNp?K^ z9+|d-4z|gZ!L{57>!Ogfbzchm>J1)Y%?NThxIS8frAw@z>Zb9v%3_3~F@<=LG%r*U zaTov}{{^z~SeX!qgSYow`_5)ij*QtGp4lvF`aIGQ>@3ZTkDmsl#@^5*NGjOuu82}o zzLF~Q9SW+mP=>88%eSA1W4_W7-Q>rdq^?t=m6}^tDPaBRGFLg%ak93W!kOp#EO{6& zP%}Iff5HZQ9VW$~+9r=|Quj#z*=YwcnssS~9|ub2>v|u1JXP47vZ1&L1O%Z1DsOrDfSIMHU{VT>&>H=9}G3i@2rP+rx@eU@uE8rJNec zij~#FmuEBj03F1~ct@C@$>y)zB+tVyjV3*n`mtAhIM0$58vM9jOQC}JJOem|EpwqeMuYPxu3sv}oMS?S#o6GGK@8PN59)m&K4Dc&X% z(;XL_kKeYkafzS3Wn5DD>Yiw{LACy_#jY4op(>9q>>-*9@C0M+=b#bknAWZ37^(Ij zq>H%<@>o4a#6NydoF{_M4i4zB_KG)#PSye9bk0Ou8h%1Dtl7Q_y#7*n%g)?m>xF~( zjqvOwC;*qvN_3(*a+w2|ao0D?@okOvg8JskUw(l7n`0fncglavwKd?~l_ryKJ^Ky! zKCHkIC-o7%fFvPa$)YNh022lakMar^dgL=t#@XLyNHHw!b?%WlM)R@^!)I!smZL@k zBi=6wE5)2v&!UNV(&)oOYW(6Qa!nUjDKKBf-~Da=#^HE4(@mWk)LPvhyN3i4goB$3K8iV7uh zsv+a?#c4&NWeK(3AH;ETrMOIFgu{_@%XRwCZ;L=^8Ts)hix4Pf3yJRQ<8xb^CkdmC z?c_gB)XmRsk`9ch#tx4*hO=#qS7={~Vb4*tTf<5P%*-XMfUUYkI9T1cEF;ObfxxI-yNuA=I$dCtz3ey znVkctYD*`fUuZ(57+^B*R=Q}~{1z#2!ca?)+YsRQb+lt^LmEvZt_`=j^wqig+wz@n@ z`LIMQJT3bxMzuKg8EGBU+Q-6cs5(@5W?N>JpZL{$9VF)veF`L5%DSYTNQEypW%6$u zm_~}T{HeHj1bAlKl8ii92l9~$dm=UM21kLemA&b$;^!wB7#IKWGnF$TVq!!lBlG4 z{?Rjz?P(uvid+|i$VH?`-C&Gcb3{(~Vpg`w+O);Wk1|Mrjxrht0GfRUnZqz2MhrXa zqgVC9nemD5)H$to=~hp)c=l9?#~Z_7i~=U-`FZxb-|TR9@YCxx;Zjo-WpMNOn2)z) zFPGGVl%3N$f`gp$gPnWC+f4(rmts%fidpo^BJx72zAd7|*Xi{2VXmbOm)1`w^tm9% znM=0Fg4bDxH5PxPEm{P3#A(mxqlM7SIARP?|2&+c7qmU8kP&iApzL|F>Dz)Ixp_`O zP%xrP1M6@oYhgo$ZWwrAsYLa4 z|I;DAvJxno9HkQrhLPQk-8}=De{9U3U%)dJ$955?_AOms!9gia%)0E$Mp}$+0er@< zq7J&_SzvShM?e%V?_zUu{niL@gt5UFOjFJUJ}L?$f%eU%jUSoujr{^O=?=^{19`ON zlRIy8Uo_nqcPa6@yyz`CM?pMJ^^SN^Fqtt`GQ8Q#W4kE7`V9^LT}j#pMChl!j#g#J zr-=CCaV%xyFeQ9SK+mG(cTwW*)xa(eK;_Z(jy)woZp~> zA(4}-&VH+TEeLzPTqw&FOoK(ZjD~m{KW05fiGLe@E3Z2`rLukIDahE*`u!ubU)9`o zn^-lyht#E#-dt~S>}4y$-mSbR8{T@}22cn^refuQ08NjLOv?JiEWjyOnzk<^R5%gO zhUH_B{oz~u#IYwVnUg8?3P*#DqD8#X;%q%HY**=I>>-S|!X*-!x1{^l#OnR56O>iD zc;i;KS+t$koh)E3)w0OjWJl_aW2;xF=9D9Kr>)(5}4FqUbk# zI#$N8o0w;IChL49m9CJTzoC!|u{Ljd%ECgBOf$}&jA^$(V#P#~)`&g`H8E{uv52pp zwto`xUL-L&WTAVREEm$0g_gYPL(^vHq(*t1WCH_6alhkeW&GCZ3hL)|{O-jiFOBrF z!EW=Jej|dqQitT6!B-7&io2K)WIm~Q)v@yq%U|VpV+I?{y0@Yd%n8~-NuuM*pM~KA z85YB};IS~M(c<}4Hxx>qRK0cdl&e?t253N%vefkgds>Ubn8X}j6Vpgs>a#nFq$osY z1ZRwLqFv=+BTb=i%D2Wv>_yE0z}+niZ4?rE|*a3d7^kndWGwnFqt+iZ(7+aln<}jzbAQ(#Z2SS}3S$%Bd}^ zc9ghB%O)Z_mTZMRC&H#)I#fiLuIkGa^`4e~9oM5zKPx?zjkC&Xy0~r{;S?FS%c7w< zWbMpzc(xSw?9tGxG~_l}Acq}zjt5ClaB7-!vzqnlrX;}$#+PyQ9oU)_DfePh2E1<7 ztok6g6K^k^DuHR*iJ?jw?bs_whk|bx`dxu^nC6#e{1*m~z1eq7m}Cf$*^Eua(oi_I zAL+3opNhJteu&mWQ@kQWPucmiP)4|nFG`b2tpC;h{-PI@`+h?9v=9mn|0R-n8#t=+Z*FD(c5 zjj79Jxkgck*DV=wpFgRZuwr%}KTm+dx?RT@aUHJdaX-ODh~gByS?WGx&czAkvkg;x zrf92l8$Or_zOwJVwh>5rB`Q5_5}ef6DjS*$x30nZbuO3dijS*wvNEqTY5p1_A0gWr znH<(Qvb!os14|R)n2Ost>jS2;d1zyLHu`Svm|&dZD+PpP{Bh>U&`Md;gRl64q;>{8MJJM$?UNUd`aC>BiLe>*{ zJY15->yW+<3rLgYeTruFDtk1ovU<$(_y7#HgUq>)r0{^}Xbth}V#6?%5jeFYt;SG^ z3qF)=uWRU;Jj)Q}cpY8-H+l_n$2$6{ZR?&*IGr{>ek!69ZH0ZoJ*Ji+ezzlJ^%qL3 zO5a`6gwFw(moEzqxh=yJ9M1FTn!eo&qD#y5AZXErHs%22?A+JmS&GIolml!)rZTnUDM3YgzYfT#;OXn)`PWv3Ta z!-i|-Wojv*k&bC}_JJDjiAK(Ba|YZgUI{f}TdEOFT2+}nPmttytw7j%@bQZDV1vvj z^rp{gRkCDmYJHGrE1~e~AE!-&6B6`7UxVQuvRrfdFkGX8H~SNP_X4EodVd;lXd^>eV1jN+Tt4}Rsn)R0LxBz0c=NXU|pUe!MQQFkGBWbR3&(jLm z%RSLc#p}5_dO{GD=DEFr=Fc% z85CBF>*t!6ugI?soX(*JNxBp+-DdZ4X0LldiK}+WWGvXV(C(Ht|!3$psR=&c*HIM=BmX;pRIpz@Ale{9dhGe(U2|Giv;# zOc|;?p67J=Q(kamB*aus=|XP|m{jN^6@V*Bpm?ye56Njh#vyJqE=DweC;?Rv7faX~ zde03n^I~0B2vUmr;w^X37tVxUK?4}ifsSH5_kpKZIzpYu0;Kv}SBGfI2AKNp+VN#z`nI{UNDRbo-wqa4NEls zICRJpu)??cj^*WcZ^MAv+;bDbh~gpN$1Cor<{Y2oyIDws^JsfW^5AL$azE(T0p&pP z1Mv~6Q44R&RHoH95&OuGx2srIr<@zYJTOMKiVs;Bx3py89I87LOb@%mr`0)#;7_~Z zzcZj8?w=)>%5@HoCHE_&hnu(n_yQ-L(~VjpjjkbT7e)Dk5??fApg(d>vwLRJ-x{um z*Nt?DqTSxh_MIyogY!vf1mU1`Gld-&L)*43f6dilz`Q@HEz;+>MDDYv9u!s;WXeao zUq=TaL$P*IFgJzrGc>j1dDOd zed+=ZBo?w4mr$2)Ya}?vedDopomhW1`#P<%YOJ_j=WwClX0xJH-f@s?^tmzs_j7t!k zK@j^zS0Q|mM4tVP5Ram$VbS6|YDY&y?Q1r1joe9dj08#CM{RSMTU}(RCh`hp_Rkl- zGd|Cv~G@F{DLhCizAm9AN!^{rNs8hu!G@8RpnGx7e`-+K$ffN<0qjR zGq^$dj_Tv!n*?zOSyk5skI7JVKJ)3jysnjIu-@VSzQiP8r6MzudCU=~?v-U8yzo^7 zGf~SUTvEp+S*!X9uX!sq=o}lH;r{pzk~M*VA(uyQ`3C8!{C;)&6)95fv(cK!%Cuz$ z_Zal57H6kPN>25KNiI6z6F)jzEkh#%OqU#-__Xzy)KyH};81#N6OfX$$IXWzOn`Q& z4f$Z1t>)8&8PcYfEwY5UadU1yg+U*(1m2ZlHoC-!2?gB!!fLhmTl))D@dhvkx#+Yj z1O=LV{(T%{^IeCuFK>%QR!VZ4GnO5tK8a+thWE zg4VytZrwcS?7^ zuZfhYnB8dwd%VLO?DK7pV5Wi<(`~DYqOXn8#jUIL^)12*Dbhk4GmL_E2`WX&iT16o zk(t|hok(Y|v-wzn?4x34T)|+SfZP>fiq!><*%vnxGN~ypST-FtC+@TPv*vYv@iU!_ z@2gf|PrgQ?Ktf*9^CnJ(x*CtZVB8!OBfg0%!wL;Z8(tYYre0vcnPGlyCc$V(Ipl*P z_(J!a=o@vp^%Efme!K74(Ke7A>Y}|sxV+JL^aYa{~m%5#$$+R1? zGaQhZTTX!#s#=Xtpegqero$RNt&`4xn3g$)=y*;=N=Qai)}~`xtxI_N*#MMCIq#HFifT zz(-*m;pVH&+4bixL&Bbg)W5FN^bH87pAHp)zPkWNMfTFqS=l~AC$3FX3kQUSh_C?-ZftyClgM)o_D7cX$RGlEYblux0jv5 zTr|i-I3@ZPCGheCl~BGhImF)K4!9@?pC(gi3ozX=a!|r1)LFxy_8c&wY0<^{2cm|P zv6Y`QktY*;I)IUd5y3ne1CqpVanlY45z8hf4&$EUBnucDj16pDa4&GI&TArYhf*xh zdj>*%APH8(h~c>o@l#%T>R$e>rwVx_WUB|~V`p^JHsg*y12lzj&zF}w6W09HwB2yb z%Q~`es&(;7#*DUC_w-Dmt7|$*?TA_m;zB+-u{2;Bg{O}nV7G_@7~<)Bv8fH^G$XG8$(&{A zwXJK5LRK%M34(t$&NI~MHT{UQ9qN-V_yn|%PqC81EIiSzmMM=2zb`mIwiP_b)x+2M z7Gd`83h79j#SItpQ}luuf2uOU`my_rY5T{6P#BNlb%h%<#MZb=m@y5aW;#o1^2Z)SWo+b`y0gV^iRcZtz5!-05vF z7wNo=hc6h4hc&s@uL^jqRvD6thVYtbErDK9k!;+a0xoE0WL7zLixjn5;$fXvT=O3I zT6jI&^A7k6R{&5#lVjz#8%_RiAa2{di{`kx79K+j72$H(!ass|B%@l%KeeKchYLe_ z>!(JC2fxsv>XVen+Y42GeYPxMWqm`6F$(E<6^s|g(slNk!lL*6v^W2>f6hh^mE$s= z3D$)}{V5(Qm&A6bp%2Q}*GZ5Qrf}n7*Hr51?bJOyA-?B4vg6y_EX<*-e20h{=0Mxs zbuQGZ$fLyO5v$nQ&^kuH+mNq9O#MWSfThtH|0q1i!NrWj^S}_P;Q1OkYLW6U^?_7G zx2wg?CULj7))QU(n{$0JE%1t2dWrMi2g-Os{v|8^wK{@qlj%+1b^?NI z$}l2tjp0g>K3O+p%yK<9!XqmQ?E9>z&(|^Pi~aSRwI5x$jaA62GFz9%fmO3t3a>cq zK8Xbv=5Ps~4mKN5+Eqw12(!PEyedFXv~VLxMB~HwT1Vfo51pQ#D8e$e4pFZ{&RC2P z5gTIzl{3!&(tor^BwZfR8j4k{7Rq#`riKXP2O-Bh66#WWK2w=z;iD9GLl+3 zpHIaI4#lQ&S-xBK8PiQ%dwOh?%BO~DCo06pN7<^dnZCN@NzY{_Z1>rrB0U|nC&+!2 z2y!oBcTd2;@lzyk(B=TkyZ)zy0deK05*Q0zk+o$@nun`VI1Er7pjq>8V zNmlW{p7S^Btgb(TA}jL(uR>`0w8gHP^T~Sh5Tkip^spk4SBAhC{TZU}_Z)UJw-}zm zPq{KBm!k)?P{`-(9?LFt&YN4s%SIZ-9lJ!Ws~B%exHOeVFk3~}HewnnH(d)qkLQ_d z6h>O)pEE{vbOVw}E+jdYC^wM+AAhaI(YAibUc@B#_mDss0Ji&BK{WG`4 zOk>vSNq(Bq2IB@s>>Rxm6Wv?h;ZXkpb1l8u|+_qXWdC*jjcPCixq;!%BVPSp#hP zqo`%cNf&YoQXHC$D=D45RiT|5ngPlh?0T~?lUf*O)){K@*Kbh?3RW1j9-T?%lDk@y z4+~?wKI%Y!-=O|_IuKz|=)F;V7ps=5@g)RrE;;tvM$gUhG>jHcw2Hr@fS+k^Zr~>G z^JvPrZc}_&d_kEsqAEMTMJw!!CBw)u&ZVzmq+ZworuaE&TT>$pYsd9|g9O^0orAe8 z221?Va!l1|Y5X1Y?{G7rt1sX#qFA^?RLG^VjoxPf63;AS=_mVDfGJKg73L zsGdnTUD40y(>S##2l|W2Cy!H(@@5KBa(#gs`vlz}Y~$ot5VsqPQ{{YtjYFvIumZzt zA{CcxZLJR|4#{j7k~Tu*jkwz8QA|5G1$Cl895R`Zyp;irp1{KN){kB30O8P1W5;@bG znvX74roeMmQlUi=v9Y%(wl$ZC#9tKNFpvi3!C}f1m6Ct|l2g%psc{TJp)@yu)*e2> z((p0Fg*8gJ!|3WZke9;Z{8}&NRkv7iP=#_y-F}x^y?2m%-D_aj^)f04%mneyjo_;) z6qc_Zu$q37d~X``*eP~Q>I2gg%rrV8v=kDfpp$=%Vj}hF)^dsSWygoN(A$g*E=Do6FX?&(@F#7pbiJ`;c0c@Ul zDqW_90Wm#5f2L<(Lf3)3TeXtI7nhYwRm(F;*r_G6K@OPW4H(Y3O5SjUzBC}u3d|eQ8*8d@?;zUPE+i#QNMn=r(ap?2SH@vo*m z3HJ%XuG_S6;QbWy-l%qU;8x;>z>4pMW7>R}J%QLf%@1BY(4f_1iixd-6GlO7Vp*yU zp{VU^3?s?90i=!#>H`lxT!q8rk>W_$2~kbpz7eV{3wR|8E=8**5?qn8#n`*(bt1xRQrdGxyx2y%B$qmw#>ZV$c7%cO#%JM1lY$Y0q?Yuo> ze9KdJoiM)RH*SB%^;TAdX-zEjA7@%y=!0=Zg%iWK7jVI9b&Dk}0$Af&08KHo+ zOwDhFvA(E|ER%a^cdh@^wLUlmIv6?_3=BvX8jKk92L=Y}7Jf5OGMfh` zBdR1wFCi-i5@`9km{isRb0O%TX+f~)KNaEz{rXQa89`YIF;EN&gN)cigu6mNh>?Cm zAO&Im2flv6D{jwm+y<%WsPe4!89n~KN|7}Cb{Z;XweER73r}Qp2 zz}WP4j}U0&(uD&9yGy6`!+_v-S(yG*iytsTR#x_Rc>=6u^vnRDnf1gP{#2>`ffrAC% zTZ5WQ@hAK;P;>kX{D)mIXe4%a5p=LO1xXH@8T?mz7Q@d)$3pL{{B!2{-v70L*o1AO+|n5beiw~ zk@(>m?T3{2k2c;NWc^`4@P&Z?BjxXJ@;x1qhn)9Mn*IFdt_J-dIqx5#d`NfyfX~m( zIS~5)MfZ2Uy?_4W`47i}u0ZgPh<{D|w_d#;D}Q&U$Q-G}xM1A@1f{#%A$jh6Qp&0hQ<0bPOM z-{1Wm&p%%#eb_?x7i;bol EfAhh=DF6Tf diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index a9f1ef87bb2..8c79a83ae43 100755 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,2 +1,18 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 +# +# http://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. +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar diff --git a/mvnw b/mvnw index 41c0f0c23db..5643201c7d8 100755 --- a/mvnw +++ b/mvnw @@ -36,6 +36,10 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + if [ -f /etc/mavenrc ] ; then . /etc/mavenrc fi @@ -145,7 +149,7 @@ if [ -z "$JAVACMD" ] ; then JAVACMD="$JAVA_HOME/bin/java" fi else - JAVACMD="`which java`" + JAVACMD="`\\unset -f command; \\command -v java`" fi fi @@ -212,9 +216,9 @@ else echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." fi if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" fi while IFS="=" read key value; do case "$key" in (wrapperUrl) jarUrl="$value"; break ;; @@ -233,9 +237,9 @@ else echo "Found wget ... using wget" fi if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" fi elif command -v curl > /dev/null; then if [ "$MVNW_VERBOSE" = true ]; then @@ -305,6 +309,8 @@ WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain exec "$JAVACMD" \ $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd old mode 100755 new mode 100644 index 86115719e53..8a15b7f311f --- a/mvnw.cmd +++ b/mvnw.cmd @@ -46,8 +46,8 @@ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre @REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* :skipRcPre @setlocal @@ -120,9 +120,9 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B ) @@ -134,7 +134,7 @@ if exist %WRAPPER_JAR% ( ) ) else ( if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" ) if "%MVNW_VERBOSE%" == "true" ( echo Couldn't find %WRAPPER_JAR%, downloading it ... @@ -158,7 +158,13 @@ if exist %WRAPPER_JAR% ( @REM work with both Windows and non-Windows executions. set MAVEN_CMD_LINE_ARGS=%* -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end @@ -168,15 +174,15 @@ set ERROR_CODE=1 :end @endlocal & set ERROR_CODE=%ERROR_CODE% -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost @REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" :skipRcPost @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause +if "%MAVEN_BATCH_PAUSE%"=="on" pause -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% -exit /B %ERROR_CODE% +cmd /C exit /B %ERROR_CODE% From d91a2e4221003e0f9f95ca8830d24a68ebede3bc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 24 Jan 2022 17:10:24 +0800 Subject: [PATCH 084/113] replace tabs with spaces --- .../languages/PythonLegacyClientCodegen.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java index bdaa9a06ef3..15aa8d7246f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java @@ -311,13 +311,13 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements * The OpenAPI pattern spec follows the Perl convention and style of modifiers. Python * does not support this in as natural a way so it needs to convert it. See * https://docs.python.org/2/howto/regex.html#compilation-flags for details. - * - * @param pattern (the String pattern to convert from python to Perl convention) - * @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/) - * @return void - * @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention - * - * Includes fix for issue #6675 + * + * @param pattern (the String pattern to convert from python to Perl convention) + * @param vendorExtensions (list of custom x-* properties for extra functionality-see https://swagger.io/docs/specification/openapi-extensions/) + * @return void + * @throws IllegalArgumentException if pattern does not follow the Perl /pattern/modifiers convention + * + * Includes fix for issue #6675 */ public void postProcessPattern(String pattern, Map vendorExtensions) { if (pattern != null) { @@ -328,9 +328,9 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements throw new IllegalArgumentException("Pattern must follow the Perl " + "/pattern/modifiers convention. " + pattern + " is not valid."); } - - //check for instances of extra backslash that could cause compile issues and remove - int firstBackslash = pattern.indexOf("\\"); + + //check for instances of extra backslash that could cause compile issues and remove + int firstBackslash = pattern.indexOf("\\"); int bracket = pattern.indexOf("["); if (firstBackslash == 0 || firstBackslash == 1 || firstBackslash == bracket+1) { pattern = pattern.substring(0,firstBackslash)+pattern.substring(firstBackslash+1); From 6ac8d9b1231686f841c50c1b6b299675cc2790dd Mon Sep 17 00:00:00 2001 From: Tim Quinn Date: Mon, 24 Jan 2022 03:22:50 -0600 Subject: [PATCH 085/113] Change Helidon MP release in generated project from 1.x to 2.x (#11076) * Support Helidon MP server using Helidon 2.4.1 Signed-off-by: tim.quinn@oracle.com * Add unrelated changed sample file(s) after rebase * Updated generated samples file after rebasing again * Remove incorrectly 'git add'ed generated file --- .../languages/JavaJAXRSSpecServerCodegen.java | 3 +- .../spec/libraries/helidon/README.mustache | 4 +- .../helidon/logging.properties.mustache | 21 +- .../microprofile-config.properties.mustache | 9 +- .../spec/libraries/helidon/pom.mustache | 278 +++++++++++++----- 5 files changed, 221 insertions(+), 94 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java index 8b50933247a..23c82cc2edd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -213,11 +213,12 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { supportingFiles.add(new SupportingFile("ibm-web-ext.xml.mustache", "src/main/webapp/WEB-INF", "ibm-web-ext.xml") .doNotOverwrite()); } else if(HELIDON_LIBRARY.equals(library)) { + additionalProperties.computeIfAbsent("helidonVersion", key -> "2.4.1"); supportingFiles.add(new SupportingFile("logging.properties.mustache", "src/main/resources", "logging.properties") .doNotOverwrite()); supportingFiles.add(new SupportingFile("microprofile-config.properties.mustache", "src/main/resources/META-INF", "microprofile-config.properties") .doNotOverwrite()); - supportingFiles.add(new SupportingFile("beans.xml.mustache", "src/main/webapp/META-INF", "beans.xml") + supportingFiles.add(new SupportingFile("beans.xml.mustache", "src/main/resources/META-INF", "beans.xml") .doNotOverwrite()); } else if(KUMULUZEE_LIBRARY.equals(library)) { supportingFiles.add(new SupportingFile("config.yaml.mustache", "src/main/resources", "config.yaml")); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache index d7982e6e6a6..d2d0ddaa1e5 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache @@ -16,7 +16,7 @@ The jar can be used in combination with an other project providing the implement {{/interfaceOnly}} {{^interfaceOnly}} -To build the server, run this maven command: +To build the server, run this maven command (with JDK 11+): ```bash mvn package @@ -25,7 +25,7 @@ mvn package To run the server, run this maven command: ```bash -mvn exec:java +java -jar target/{{artifactId}}.jar ``` You can then call your server endpoints under: diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/logging.properties.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/logging.properties.mustache index fea543d4c33..3e909fb7d90 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/logging.properties.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/logging.properties.mustache @@ -1,19 +1,20 @@ # Example Logging Configuration File # For more information see $JAVA_HOME/jre/lib/logging.properties -# Send messages to the console -handlers=java.util.logging.ConsoleHandler - -# Global default logging level. Can be overridden by specific handlers and loggers +## Send messages to the console +handlers=io.helidon.common.HelidonConsoleHandler +# +## HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n +# +## Global logging level. Can be overridden by specific loggers .level=INFO -# Helidon Web Server has a custom log formatter that extends SimpleFormatter. -# It replaces "!thread!" with the current thread name -java.util.logging.ConsoleHandler.level=INFO -java.util.logging.ConsoleHandler.formatter=io.helidon.webserver.WebServerLogFormatter -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n +# Quiet Weld +org.jboss.level=WARNING -#Component specific log levels +# +# Component specific log levels #io.helidon.webserver.level=INFO #io.helidon.config.level=INFO #io.helidon.security.level=INFO diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/microprofile-config.properties.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/microprofile-config.properties.mustache index 1780a159b0a..38988f20e5e 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/microprofile-config.properties.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/microprofile-config.properties.mustache @@ -1,6 +1,11 @@ +# Microprofile server properties + +# Application properties. This is the default greeting +app.greeting=Hello + # Microprofile server properties server.port=8080 server.host=0.0.0.0 -# Microprofile OpenAPI properties -mp.openapi.scan.disable=true \ No newline at end of file +# Enable the optional MicroProfile Metrics REST.request metrics +metrics.rest-request.enabled=true diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/pom.mustache index e72b2b5d440..91c575960dc 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/pom.mustache @@ -16,103 +16,223 @@ {{/parentOverridden}} - io.helidon.microprofile.server.Main - 1.2.0 + + {{helidonVersion}} + io.helidon.microprofile.cdi.Main + + 11 + ${maven.compiler.source} + true + UTF-8 + UTF-8 + + 3.8.1 + 3.0.0 + 2.7.5.1 1.6.0 + 3.0.0-M5 + 2.3.0 + 2.3.0 1.0.6 3.0.2 - 1.1.2 - 2.29 - 1.2.2 - 5.1.0 + 1.5.0.Final + 0.5.1 + 2.7 + 3.0.0-M5 - - - - org.jboss.jandex - jandex-maven-plugin - ${version.plugin.jandex} - - - make-index - - jandex - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${version.plugin.jar} - - - - true - ${mainClass} - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${version.plugin.compiler} - - 1.8 - 1.8 - - -Xlint:unchecked - - - - - org.codehaus.mojo - exec-maven-plugin - ${version.plugin.exec} - - ${mainClass} - - - - + + + + io.helidon + helidon-dependencies + ${helidon.version} + pom + import + + + io.helidon.microprofile.bundles - helidon-microprofile-2.2 - ${version.lib.helidon} + helidon-microprofile - org.eclipse.microprofile.openapi - microprofile-openapi-api - ${version.lib.microprofile-openapi-api} - - - org.glassfish.jersey.media - jersey-media-json-binding - ${version.lib.jersey} - runtime - - - jakarta.activation - jakarta.activation-api - ${version.lib.activation-api} + org.jboss + jandex runtime + true org.junit.jupiter junit-jupiter-api - ${version.lib.junit} - test - - - org.junit.jupiter - junit-jupiter-engine - ${version.lib.junit} test + + + ${project.artifactId} + + + + org.apache.maven.plugins + maven-compiler-plugin + ${version.plugin.compiler} + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.plugin.surefire} + + false + + ${project.build.outputDirectory}/logging.properties + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.plugin.failsafe} + + false + true + + + + org.apache.maven.plugins + maven-dependency-plugin + ${version.plugin.dependency} + + + org.apache.maven.plugins + maven-resources-plugin + ${version.plugin.resources} + + + org.apache.maven.plugins + maven-jar-plugin + ${version.plugin.jar} + + + + true + libs + ${mainClass} + false + + + + + + org.jboss.jandex + jandex-maven-plugin + ${version.plugin.jandex} + + + org.codehaus.mojo + exec-maven-plugin + ${version.plugin.exec} + + ${mainClass} + + + + io.helidon.build-tools + helidon-maven-plugin + ${version.plugin.helidon} + + + io.helidon.build-tools + helidon-cli-maven-plugin + ${version.plugin.helidon-cli} + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + false + false + true + true + runtime + test + + + + + + org.jboss.jandex + jandex-maven-plugin + + + make-index + + jandex + + process-classes + + + + + + + + + native-image + + + + io.helidon.build-tools + helidon-maven-plugin + + + native-image + + native-image + + + + + + + + + io.helidon.integrations.graal + helidon-mp-graal-native-image-extension + + + + + jlink-image + + + + io.helidon.build-tools + helidon-maven-plugin + + + + jlink-image + + + + + + + + From 42f3258faade63d7c2083906d3ba44b7e4cf4196 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 24 Jan 2022 15:44:38 -0800 Subject: [PATCH 086/113] Turns on python-experimental CI tests (#11390) * Installs python3.9 in node3 * Moves python clients into separate node so they can use a docker image * Installs java and maven into docker * Switches off some python tests --- .circleci/config.yml | 284 ++++++++++++------ CI/circle_parallel.sh | 19 +- .../python-experimental/tox.handlebars | 2 +- pom.xml | 16 +- .../petstore/python-experimental/pom.xml | 46 +++ .../petstore/python-experimental/tox.ini | 2 +- 6 files changed, 273 insertions(+), 96 deletions(-) create mode 100644 samples/openapi3/client/petstore/python-experimental/pom.xml diff --git a/.circleci/config.yml b/.circleci/config.yml index b610ceeb2bb..4efc24c7ba1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,16 +1,135 @@ -version: 2 +version: 2.1 +commands: # a reusable command with parameters + command_build_and_test: + parameters: + nodeNo: + default: "0" + type: string + steps: + # Restore the dependency cache + - restore_cache: + keys: + # Default branch if not + - source-v2-{{ .Branch }}-{{ .Revision }} + - source-v2-{{ .Branch }}- + - source-v2- + # Machine Setup + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. + - checkout + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. + # In many cases you can simplify this from what is generated here. + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + # This is based on your 1.0 configuration file or project settings + - run: + command: sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV + - run: + command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' + - run: + command: |- + printf '127.0.0.1 petstore.swagger.io + ' | sudo tee -a /etc/hosts + # - run: docker pull openapitools/openapi-petstore + # - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore + - run: docker pull swaggerapi/petstore + - run: docker run --name petstore.swagger -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore + - run: docker ps -a + - run: sleep 30 + - run: cat /etc/hosts + # Test + - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - run: + name: "Setup custom environment variables" + command: echo 'export CIRCLE_NODE_INDEX="<>"' >> $BASH_ENV + - run: ./CI/circle_parallel.sh + # Save dependency cache + - save_cache: + key: source-v2-{{ .Branch }}-{{ .Revision }} + paths: + # This is a broad list of cache paths to include many possible development environments + # You can probably delete some of these entries + - vendor/bundle + - ~/virtualenvs + - ~/.m2 + - ~/.ivy2 + - ~/.sbt + - ~/.bundle + - ~/.go_workspace + - ~/.gradle + - ~/.cache/bower + - ".git" + - ~/.stack + - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work + - ~/R + # save "default" cache using the key "source-v2-" + - save_cache: + key: source-v2- + paths: + # This is a broad list of cache paths to include many possible development environments + # You can probably delete some of these entries + - vendor/bundle + - ~/virtualenvs + - ~/.m2 + - ~/.ivy2 + - ~/.sbt + - ~/.bundle + - ~/.go_workspace + - ~/.gradle + - ~/.cache/bower + - ".git" + - ~/.stack + - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work + - ~/R + # Teardown + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # Save test results + - store_test_results: + path: /tmp/circleci-test-results + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: /tmp/circleci-test-results + command_docker_build_and_test: + parameters: + nodeNo: + default: "0" + type: string + steps: + # Machine Setup + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. + - checkout + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. + # In many cases you can simplify this from what is generated here. + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + # This is based on your 1.0 configuration file or project settings + # - run: + # command: sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV + # - run: + # Test + # - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - run: + name: "Setup custom environment variables" + command: echo 'export CIRCLE_NODE_INDEX="<>"' >> $BASH_ENV + - run: ./CI/circle_parallel.sh + # Teardown + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # Save test results + - store_test_results: + path: /tmp/circleci-test-results + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: /tmp/circleci-test-results jobs: - build: - # docker: - # #- image: openapitools/openapi-generator - # - image: swaggerapi/petstore - # environment: - # SWAGGER_HOST=http://petstore.swagger.io - # SWAGGER_BASE_PATH=/v2 + node0: machine: image: circleci/classic:latest working_directory: ~/OpenAPITools/openapi-generator - parallelism: 4 shell: /bin/bash --login environment: CIRCLE_ARTIFACTS: /tmp/circleci-artifacts @@ -18,85 +137,68 @@ jobs: DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli steps: - # Restore the dependency cache - - restore_cache: - keys: - # Default branch if not - - source-v2-{{ .Branch }}-{{ .Revision }} - - source-v2-{{ .Branch }}- - - source-v2- - # Machine Setup - # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each - # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. - - checkout - # Prepare for artifact and test results collection equivalent to how it was done on 1.0. - # In many cases you can simplify this from what is generated here. - # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' - - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # This is based on your 1.0 configuration file or project settings - - run: - command: sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV - - run: - command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - - run: - command: |- - printf '127.0.0.1 petstore.swagger.io - ' | sudo tee -a /etc/hosts -# - run: docker pull openapitools/openapi-petstore -# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore - - run: docker pull swaggerapi/petstore - - run: docker run --name petstore.swagger -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - run: docker ps -a - - run: sleep 30 - - run: cat /etc/hosts - # Test - - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - run: ./CI/circle_parallel.sh - # Save dependency cache - - save_cache: - key: source-v2-{{ .Branch }}-{{ .Revision }} - paths: - # This is a broad list of cache paths to include many possible development environments - # You can probably delete some of these entries - - vendor/bundle - - ~/virtualenvs - - ~/.m2 - - ~/.ivy2 - - ~/.sbt - - ~/.bundle - - ~/.go_workspace - - ~/.gradle - - ~/.cache/bower - - ".git" - - ~/.stack - - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work - - ~/R - # save "default" cache using the key "source-v2-" - - save_cache: - key: source-v2- - paths: - # This is a broad list of cache paths to include many possible development environments - # You can probably delete some of these entries - - vendor/bundle - - ~/virtualenvs - - ~/.m2 - - ~/.ivy2 - - ~/.sbt - - ~/.bundle - - ~/.go_workspace - - ~/.gradle - - ~/.cache/bower - - ".git" - - ~/.stack - - /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work - - ~/R - # Teardown - # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each - # Save test results - - store_test_results: - path: /tmp/circleci-test-results - # Save artifacts - - store_artifacts: - path: /tmp/circleci-artifacts - - store_artifacts: - path: /tmp/circleci-test-results + - command_build_and_test: + nodeNo: "0" + node1: + machine: + image: circleci/classic:latest + working_directory: ~/OpenAPITools/openapi-generator + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli + steps: + - command_build_and_test: + nodeNo: "1" + node2: + machine: + image: circleci/classic:latest + working_directory: ~/OpenAPITools/openapi-generator + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli + steps: + - command_build_and_test: + nodeNo: "2" + node3: + machine: + image: circleci/classic:latest + working_directory: ~/OpenAPITools/openapi-generator + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli + steps: + - checkout + - command_build_and_test: + nodeNo: "3" + node4: + docker: + - image: fkrull/multi-python + working_directory: ~/OpenAPITools/openapi-generator + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli + steps: + - checkout + - command_docker_build_and_test: + nodeNo: "4" +workflows: + version: 2 + build: + jobs: + - node0 + - node1 + - node2 + - node3 + - node4 \ No newline at end of file diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 74e5f018f1b..b6e2691121a 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -11,7 +11,9 @@ export NODE_ENV=test function cleanup { # Show logs of 'petstore.swagger' container to troubleshoot Unit Test failures, if any. - docker logs petstore.swagger # container name specified in circle.yml + if [ "$NODE_INDEX" != "4" ]; then + docker logs petstore.swagger # container name specified in circle.yml + fi } trap cleanup EXIT @@ -61,7 +63,6 @@ elif [ "$NODE_INDEX" = "3" ]; then pyenv install 3.6.3 pyenv install 2.7.14 pyenv global 3.6.3 - python3 --version # Install node@stable (for angular 6) set +e @@ -80,6 +81,20 @@ elif [ "$NODE_INDEX" = "3" ]; then mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node3 -Dorg.slf4j.simpleLogger.defaultLogLevel=error +elif [ "$NODE_INDEX" = "4" ]; then + + echo "Running node $NODE_INDEX to test 'samples.circleci.node4' defined in pom.xml ..." + + # install maven and java so we can use them to run our tests + apt-get update && apt-get install -y default-jdk maven sudo + java -version + export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") + echo $JAVA_HOME + # show os version + uname -a + + mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error + else echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..." #sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 diff --git a/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars b/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars index 5af8eb6f831..d1b68916df4 100644 --- a/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars +++ b/modules/openapi-generator/src/main/resources/python-experimental/tox.handlebars @@ -1,5 +1,5 @@ [tox] -envlist = py3 +envlist = py39 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/pom.xml b/pom.xml index 0dd62e012c4..06f87b9cb43 100644 --- a/pom.xml +++ b/pom.xml @@ -1285,7 +1285,6 @@ samples/client/petstore/python samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent - samples/openapi3/client/petstore/python @@ -1316,6 +1315,21 @@ samples/client/petstore/javascript-promise-es6 + + + samples.circleci.node4 + + + env + samples.circleci.node4 + + + + + samples/openapi3/client/petstore/python + samples/openapi3/client/petstore/python-experimental + + samples.circleci.others diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-experimental/pom.xml new file mode 100644 index 00000000000..7e737c36111 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonExperimentalOAS3PetstoreTests + pom + 1.0-SNAPSHOT + Python Experimental OpenAPI3 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + test + integration-test + + exec + + + make + + test + + + + + + + + \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini index 8989fc3c4d9..ef7cec358ca 100644 --- a/samples/openapi3/client/petstore/python-experimental/tox.ini +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3 +envlist = py39 [testenv] deps=-r{toxinidir}/requirements.txt From 5d2a3698e2ac96f8168e0aff887762c50a86a9b9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 25 Jan 2022 17:04:32 +0800 Subject: [PATCH 087/113] [java][okttp-gson-nextgen] update docstring in ApiClient, RetryingOAuth (#11395) * update docstring in apiclient, retryingoauth (java client) * update samples --- .../okhttp-gson-nextgen/ApiClient.mustache | 1 + .../auth/RetryingOAuth.mustache | 43 ++++++++++++++++--- .../org/openapitools/client/ApiClient.java | 1 + .../client/auth/RetryingOAuth.java | 43 ++++++++++++++++--- 4 files changed, 74 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache index 732551cec58..de8ac2527be 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache @@ -1481,6 +1481,7 @@ public class ApiClient { * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache index 137e266b5a2..43d58ce8804 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache @@ -29,22 +29,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -63,6 +72,11 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { case accessCode: @@ -148,8 +162,12 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -166,10 +184,21 @@ public class RetryingOAuth extends OAuth implements Interceptor { return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + * @throws java.io.IOException If fail to update the access token + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java index 7e3cf65e18c..98b640ae6e9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java @@ -1367,6 +1367,7 @@ public class ApiClient { * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index 911df8d3a37..91dac45f9e0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -28,22 +28,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -62,6 +71,11 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { case accessCode: @@ -147,8 +161,12 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -165,10 +183,21 @@ public class RetryingOAuth extends OAuth implements Interceptor { return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + * @throws java.io.IOException If fail to update the access token + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } From 8b3cad0692b6c58f827c0a9b35f1ad733547504b Mon Sep 17 00:00:00 2001 From: jiangyuan Date: Wed, 26 Jan 2022 01:50:59 +0800 Subject: [PATCH 088/113] [Python] fix model to dict (#11234) * fix model to dict * add unit test * add unit test * update sample files --- .../resources/python/model_utils.mustache | 10 +- ...odels-for-testing-with-http-signature.yaml | 11 +- .../python/petstore_api/model_utils.py | 10 +- .../petstore_api/model_utils.py | 10 +- .../python/x_auth_id_alias/model_utils.py | 10 +- .../python/dynamic_servers/model_utils.py | 10 +- .../petstore/python/.openapi-generator/FILES | 2 + .../openapi3/client/petstore/python/README.md | 1 + .../client/petstore/python/docs/FooObject.md | 13 + .../python/petstore_api/model/foo_object.py | 259 ++++++++++++++++++ .../python/petstore_api/model_utils.py | 10 +- .../python/petstore_api/models/__init__.py | 1 + .../petstore/python/test/test_foo_object.py | 35 +++ .../tests_manual/test_api_validation.py | 11 + 14 files changed, 374 insertions(+), 19 deletions(-) create mode 100644 samples/openapi3/client/petstore/python/docs/FooObject.md create mode 100644 samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py create mode 100644 samples/openapi3/client/petstore/python/test/test_foo_object.py diff --git a/modules/openapi-generator/src/main/resources/python/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/model_utils.mustache index 24dd544ce05..0e8ad8be5db 100644 --- a/modules/openapi-generator/src/main/resources/python/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_utils.mustache @@ -1340,6 +1340,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1369,14 +1370,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index ccb4451c6a4..758c546fe91 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2494,4 +2494,13 @@ components: BooleanEnum: type: boolean enum: - - true \ No newline at end of file + - true + FooObject: + type: object + properties: + prop1: + type: array + items: + type: object + prop2: + type: object \ No newline at end of file diff --git a/samples/client/petstore/python/petstore_api/model_utils.py b/samples/client/petstore/python/petstore_api/model_utils.py index c723626fc49..6414688b772 100644 --- a/samples/client/petstore/python/petstore_api/model_utils.py +++ b/samples/client/petstore/python/petstore_api/model_utils.py @@ -1657,6 +1657,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1686,14 +1687,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py index c723626fc49..6414688b772 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py @@ -1657,6 +1657,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1686,14 +1687,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py index 023d770fe6a..38a28ca2089 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py @@ -1657,6 +1657,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1686,14 +1687,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py index f4b73e17079..d76884daf88 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py @@ -1657,6 +1657,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1686,14 +1687,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index 4b9b1323443..68c32cfe706 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -45,6 +45,7 @@ docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md docs/File.md docs/FileSchemaTestClass.md docs/Foo.md +docs/FooObject.md docs/FormatTest.md docs/Fruit.md docs/FruitReq.md @@ -158,6 +159,7 @@ petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py petstore_api/model/file.py petstore_api/model/file_schema_test_class.py petstore_api/model/foo.py +petstore_api/model/foo_object.py petstore_api/model/format_test.py petstore_api/model/fruit.py petstore_api/model/fruit_req.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 2d83d666f8e..4eaa47c54ee 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -174,6 +174,7 @@ Class | Method | HTTP request | Description - [File](docs/File.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Foo](docs/Foo.md) + - [FooObject](docs/FooObject.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) - [FruitReq](docs/FruitReq.md) diff --git a/samples/openapi3/client/petstore/python/docs/FooObject.md b/samples/openapi3/client/petstore/python/docs/FooObject.md new file mode 100644 index 00000000000..55a7fc671ef --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/FooObject.md @@ -0,0 +1,13 @@ +# FooObject + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prop1** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]** | | [optional] +**prop2** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py new file mode 100644 index 00000000000..5c2113edd1c --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py @@ -0,0 +1,259 @@ +""" + 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 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from petstore_api.exceptions import ApiAttributeError + + + +class FooObject(ModelNormal): + """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 = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'prop1': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}],), # noqa: E501 + 'prop2': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'prop1': 'prop1', # noqa: E501 + 'prop2': 'prop2', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FooObject - a model defined in OpenAPI + + 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 + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (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. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prop1 ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): [optional] # noqa: E501 + prop2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """FooObject - a model defined in OpenAPI + + 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 + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (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. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prop1 ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): [optional] # noqa: E501 + prop2 ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py index c723626fc49..6414688b772 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py @@ -1657,6 +1657,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1686,14 +1687,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index 5e9f7f3bfaa..170e786575f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -48,6 +48,7 @@ from petstore_api.model.fake_post_inline_additional_properties_payload_array_dat 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.foo_object import FooObject from petstore_api.model.format_test import FormatTest from petstore_api.model.fruit import Fruit from petstore_api.model.fruit_req import FruitReq diff --git a/samples/openapi3/client/petstore/python/test/test_foo_object.py b/samples/openapi3/client/petstore/python/test/test_foo_object.py new file mode 100644 index 00000000000..9e04e6ddf7a --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_foo_object.py @@ -0,0 +1,35 @@ +""" + 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 +""" + + +import sys +import unittest + +import petstore_api +from petstore_api.model.foo_object import FooObject + + +class TestFooObject(unittest.TestCase): + """FooObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFooObject(self): + """Test FooObject""" + # FIXME: construct object with mandatory attributes with example values + # model = FooObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py b/samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py index 696b05e548b..c04427530e1 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_api_validation.py @@ -163,3 +163,14 @@ class ApiClientTests(unittest.TestCase): } response = MockResponse(data=json.dumps(data)) deserialized = api_client.deserialize(response, (format_test.FormatTest,), True) + + def test_sanitize_for_serialization(self): + data = { + "prop1": [{"key1": "val1"}], + "prop2": {"key2": "val2"} + } + from petstore_api.model.foo_object import FooObject + # the property named prop1 of this model is a list of dict + foo_object = FooObject(prop1=data["prop1"], prop2=data["prop2"]) + result = self.api_client.sanitize_for_serialization(foo_object) + self.assertEqual(data, result) From cdf1943a81c489efa1166637baee6c62583ebd49 Mon Sep 17 00:00:00 2001 From: Hex052 Date: Tue, 25 Jan 2022 17:50:16 -0900 Subject: [PATCH 089/113] Fix typo in script name (#11402) --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index bc74ea62e78..35d8d105221 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -108,7 +108,7 @@ export PATH=${JAVA_HOME}/bin:$PATH > **Platform(s)**: Linux, macOS, Windows (variable) -One downside to manual JAR downloads is that you don't keep up-to-date with the latest released version. We have a Bash launcher script at [bin/utils/openapi-generator.cli.sh](https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh) which solves this problem. +One downside to manual JAR downloads is that you don't keep up-to-date with the latest released version. We have a Bash launcher script at [bin/utils/openapi-generator-cli.sh](https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh) which solves this problem. To install the launcher script, copy the contents of the script to a location on your path and make the script executable. From 066883be58a34a6db50ed3f526db94c547b570d7 Mon Sep 17 00:00:00 2001 From: Jason Finch Date: Wed, 26 Jan 2022 15:39:22 +1000 Subject: [PATCH 090/113] tidy: [csharp-netcore] Remove redundant useWebRequest tag from templates. (#11398) --- .../main/resources/csharp-netcore-functions/ApiClient.mustache | 3 --- .../libraries/httpclient/ApiClient.mustache | 3 --- .../src/main/resources/csharp-netcore/ApiClient.mustache | 3 --- .../csharp-netcore/libraries/httpclient/ApiClient.mustache | 3 --- 4 files changed, 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache index 65cbf8d76bc..72cbbf86b7e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache @@ -23,9 +23,6 @@ using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; using RestSharp; using RestSharp.Deserializers; using RestSharpMethod = RestSharp.Method; -{{#useWebRequest}} -using System.Net.Http; -{{/useWebRequest}} {{#supportsRetry}} using Polly; {{/supportsRetry}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache index e9c39ea9f6d..ca187c688d9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache @@ -20,9 +20,6 @@ using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; -{{#useWebRequest}} -using System.Net.Http; -{{/useWebRequest}} using System.Net.Http; using System.Net.Http.Headers; {{#supportsRetry}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index e42b50fbd8b..13d3b8c5f49 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -23,9 +23,6 @@ using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; using RestSharp; using RestSharp.Deserializers; using RestSharpMethod = RestSharp.Method; -{{#useWebRequest}} -using System.Net.Http; -{{/useWebRequest}} {{#supportsRetry}} using Polly; {{/supportsRetry}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index f62f0e9423f..f24c317a702 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -20,9 +20,6 @@ using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; -{{#useWebRequest}} -using System.Net.Http; -{{/useWebRequest}} using System.Net.Http; using System.Net.Http.Headers; {{#supportsRetry}} From a0dd025c828510bce57064aaaede3b5b4971a549 Mon Sep 17 00:00:00 2001 From: Andriy Dmytruk <80816836+andriy-dmytruk@users.noreply.github.com> Date: Wed, 26 Jan 2022 00:51:19 -0500 Subject: [PATCH 091/113] Add Micronaut server generator (#10270) * Add micronaut server implementation * Add micronaut server tests and imporovements * Generate samples, docs and verify that tests pass * Update micronaut docs and samples after merging with master * Update micronaut dev server samples * Add micronuat server docs * Update micronaut version * Minor changes to micronaut server and client * Fix documentation generation in samples Co-authored-by: Andriy Dmytruk --- bin/configs/java-micronaut-client.yaml | 1 + bin/configs/java-micronaut-server.yaml | 10 + docs/generators.md | 1 + docs/generators/java-micronaut-client.md | 5 +- docs/generators/java-micronaut-server.md | 314 +++ .../JavaMicronautAbstractCodegen.java | 511 +++++ .../languages/JavaMicronautClientCodegen.java | 292 +-- .../languages/JavaMicronautServerCodegen.java | 178 ++ .../org.openapitools.codegen.CodegenConfig | 1 + .../java-micronaut-client/api.mustache | 70 - .../gradle/gradle.properties.mustache | 1 - .../doc/model_doc.mustache | 4 - .../model/beanValidation.mustache | 52 - .../model/jackson_annotations.mustache | 26 - .../model/modelEnum.mustache | 61 - .../java-micronaut-client/model/pojo.mustache | 332 ---- .../params/bodyParams.mustache | 1 - .../params/cookieParams.mustache | 1 - .../params/formParams.mustache | 1 - .../params/headerParams.mustache | 1 - .../params/pathParams.mustache | 1 - .../params/queryParams.mustache | 1 - .../query/QueryParam.mustache | 78 - .../query/QueryParamBinder.mustache | 164 -- .../java-micronaut/client/api.mustache | 71 + .../client}/auth/Authorization.mustache | 4 +- .../client}/auth/AuthorizationBinder.mustache | 4 +- .../client}/auth/AuthorizationFilter.mustache | 4 +- .../client}/auth/Authorizations.mustache | 4 +- .../ApiKeyAuthConfiguration.mustache | 4 +- .../ConfigurableAuthorization.mustache | 4 +- .../HttpBasicAuthConfiguration.mustache | 4 +- .../client}/doc/README.mustache | 0 .../client}/doc/api_doc.mustache | 0 .../client}/doc/auth.mustache | 0 .../client/params/bodyParams.mustache | 1 + .../client/params/cookieParams.mustache | 1 + .../client/params/formParams.mustache | 1 + .../client/params/headerParams.mustache | 1 + .../client/params/pathParams.mustache | 1 + .../client/params/queryParams.mustache | 1 + .../client}/params/type.mustache | 0 .../client/test}/api_test.groovy.mustache | 2 +- .../client/test}/api_test.mustache | 2 +- .../client/test}/model_test.groovy.mustache | 0 .../client/test}/model_test.mustache | 0 .../configuration/Application.mustache | 0 .../configuration/application.yml.mustache | 19 +- .../configuration/git/git_push.sh.mustache | 0 .../configuration/git/gitignore.mustache | 0 .../gradle/build.gradle.mustache | 10 +- .../gradle/gradle.properties.mustache | 1 + .../gradle/settings.gradle.mustache | 0 .../configuration/gradlew/gradle-wrapper.jar | 0 .../gradle-wrapper.properties.mustache | 0 .../gradlew/gradlew.bat.mustache | 0 .../configuration/gradlew/gradlew.mustache | 0 .../common/configuration/logback.xml.mustache | 15 + .../MavenWrapperDownloader.java.mustache | 0 .../mavenw/maven-wrapper.jar.mustache | Bin .../mavenw/maven-wrapper.properties.mustache | 0 .../configuration/mavenw/mvnw.bat.mustache | 0 .../configuration/mavenw/mvnw.mustache | 0 .../common}/configuration/pom.xml.mustache | 8 +- .../common}/doc/enum_outer_doc.mustache | 2 + .../common/doc/model_doc.mustache | 4 + .../common}/doc/pojo_doc.mustache | 33 +- .../common}/generatedAnnotation.mustache | 0 .../common}/licenseInfo.mustache | 0 .../common/model/beanValidation.mustache | 52 + .../common/model/jackson_annotations.mustache | 26 + .../common}/model/model.mustache | 8 +- .../common/model/modelEnum.mustache} | 43 +- .../common/model/modelInnerEnum.mustache | 60 + .../common}/model/oneof_interface.mustache | 2 +- .../java-micronaut/common/model/pojo.mustache | 342 ++++ .../common}/model/typeInfoAnnotation.mustache | 0 .../common}/model/xmlAnnotation.mustache | 0 .../common}/params/beanValidation.mustache | 11 +- .../common/test/model_test.groovy.mustache | 46 + .../common/test/model_test.mustache | 49 + .../java-micronaut/server/controller.mustache | 129 ++ .../server/controllerImplementation.mustache | 34 + .../server/controllerOperationBody.mustache | 17 + .../java-micronaut/server/doc/README.mustache | 27 + .../server/doc/controller_doc.mustache | 63 + .../server/params/bodyParams.mustache | 7 + .../server/params/cookieParams.mustache | 1 + .../server/params/formParams.mustache | 1 + .../server/params/headerParams.mustache | 1 + .../server/params/pathParams.mustache | 1 + .../server/params/queryParams.mustache | 1 + .../server/params/type.mustache | 7 + .../test/controller_test.groovy.mustache | 185 ++ .../server/test/controller_test.mustache | 185 ++ .../AbstractMicronautCodegenTest.java | 125 ++ .../micronaut/MicronautClientCodegenTest.java | 158 +- .../micronaut/MicronautServerCodegenTest.java | 195 ++ pom.xml | 12 + .../.openapi-generator/FILES | 113 +- .../petstore/java-micronaut-client/README.md | 12 +- .../java-micronaut-client/build.gradle | 6 +- .../docs/{ => apis}/AnotherFakeApi.md | 0 .../docs/{ => apis}/FakeApi.md | 8 +- .../{ => apis}/FakeClassnameTags123Api.md | 0 .../docs/{ => apis}/PetApi.md | 0 .../docs/{ => apis}/StoreApi.md | 0 .../docs/{ => apis}/UserApi.md | 0 .../docs/{ => apis}/auth.md | 0 .../AdditionalPropertiesAnyType.md | 4 +- .../{ => models}/AdditionalPropertiesArray.md | 4 +- .../AdditionalPropertiesBoolean.md | 4 +- .../{ => models}/AdditionalPropertiesClass.md | 8 + .../AdditionalPropertiesInteger.md | 4 +- .../AdditionalPropertiesNumber.md | 4 +- .../AdditionalPropertiesObject.md | 4 +- .../AdditionalPropertiesString.md | 4 +- .../docs/{ => models}/Animal.md | 3 +- .../{ => models}/ArrayOfArrayOfNumberOnly.md | 4 +- .../docs/{ => models}/ArrayOfNumberOnly.md | 4 +- .../docs/{ => models}/ArrayTest.md | 2 +- .../docs/{ => models}/BigCat.md | 16 +- .../docs/{ => models}/BigCatAllOf.md | 16 +- .../docs/{ => models}/Capitalization.md | 3 + .../docs/{ => models}/Cat.md | 4 +- .../docs/{ => models}/CatAllOf.md | 4 +- .../docs/{ => models}/Category.md | 3 +- .../docs/{ => models}/ClassModel.md | 5 +- .../docs/{ => models}/Dog.md | 4 +- .../docs/{ => models}/DogAllOf.md | 4 +- .../docs/{ => models}/EnumArrays.md | 19 +- .../docs/{ => models}/EnumClass.md | 2 + .../docs/{ => models}/EnumTest.md | 28 +- .../docs/{ => models}/FileSchemaTestClass.md | 3 +- .../docs/{ => models}/FormatTest.md | 11 + .../docs/{ => models}/HasOnlyReadOnly.md | 3 +- .../docs/{ => models}/MapTest.md | 9 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../docs/{ => models}/Model200Response.md | 4 +- .../docs/{ => models}/ModelApiResponse.md | 2 +- .../docs/{ => models}/ModelClient.md | 4 +- .../docs/{ => models}/ModelFile.md | 5 +- .../docs/{ => models}/ModelList.md | 4 +- .../docs/{ => models}/ModelReturn.md | 5 +- .../docs/{ => models}/Name.md | 2 + .../docs/{ => models}/NumberOnly.md | 4 +- .../docs/{ => models}/Order.md | 13 +- .../docs/{ => models}/OuterComposite.md | 2 +- .../docs/{ => models}/OuterEnum.md | 2 + .../docs/{ => models}/Pet.md | 15 +- .../docs/{ => models}/ReadOnlyFirst.md | 3 +- .../docs/{ => models}/SpecialModelName.md | 4 +- .../docs/{ => models}/Tag.md | 3 +- .../docs/{ => models}/TypeHolderDefault.md | 2 + .../docs/{ => models}/TypeHolderExample.md | 3 + .../docs/{ => models}/User.md | 5 + .../docs/{ => models}/XmlItem.md | 26 + .../java-micronaut-client/gradle.properties | 2 +- .../petstore/java-micronaut-client/pom.xml | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 26 +- .../java/org/openapitools/api/FakeApi.java | 419 ++-- .../api/FakeClassnameTags123Api.java | 26 +- .../java/org/openapitools/api/PetApi.java | 214 +- .../java/org/openapitools/api/StoreApi.java | 83 +- .../java/org/openapitools/api/UserApi.java | 165 +- .../model/AdditionalPropertiesAnyType.java | 121 +- .../model/AdditionalPropertiesArray.java | 121 +- .../model/AdditionalPropertiesBoolean.java | 121 +- .../model/AdditionalPropertiesClass.java | 746 +++---- .../model/AdditionalPropertiesInteger.java | 121 +- .../model/AdditionalPropertiesNumber.java | 121 +- .../model/AdditionalPropertiesObject.java | 121 +- .../model/AdditionalPropertiesString.java | 121 +- .../java/org/openapitools/model/Animal.java | 170 +- .../model/ArrayOfArrayOfNumberOnly.java | 130 +- .../openapitools/model/ArrayOfNumberOnly.java | 130 +- .../org/openapitools/model/ArrayTest.java | 262 +-- .../java/org/openapitools/model/BigCat.java | 177 +- .../org/openapitools/model/BigCatAllOf.java | 172 +- .../openapitools/model/Capitalization.java | 386 ++-- .../main/java/org/openapitools/model/Cat.java | 121 +- .../java/org/openapitools/model/CatAllOf.java | 116 +- .../java/org/openapitools/model/Category.java | 170 +- .../org/openapitools/model/ClassModel.java | 116 +- .../main/java/org/openapitools/model/Dog.java | 121 +- .../java/org/openapitools/model/DogAllOf.java | 116 +- .../org/openapitools/model/EnumArrays.java | 306 +-- .../org/openapitools/model/EnumClass.java | 52 +- .../java/org/openapitools/model/EnumTest.java | 594 +++--- .../model/FileSchemaTestClass.java | 186 +- .../org/openapitools/model/FormatTest.java | 870 +++++---- .../openapitools/model/HasOnlyReadOnly.java | 126 +- .../java/org/openapitools/model/MapTest.java | 398 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 240 +-- .../openapitools/model/Model200Response.java | 170 +- .../openapitools/model/ModelApiResponse.java | 224 +-- .../org/openapitools/model/ModelClient.java | 116 +- .../org/openapitools/model/ModelFile.java | 116 +- .../org/openapitools/model/ModelList.java | 116 +- .../org/openapitools/model/ModelReturn.java | 116 +- .../java/org/openapitools/model/Name.java | 234 +-- .../org/openapitools/model/NumberOnly.java | 116 +- .../java/org/openapitools/model/Order.java | 446 ++--- .../openapitools/model/OuterComposite.java | 224 +-- .../org/openapitools/model/OuterEnum.java | 52 +- .../main/java/org/openapitools/model/Pet.java | 471 ++--- .../org/openapitools/model/ReadOnlyFirst.java | 148 +- .../openapitools/model/SpecialModelName.java | 116 +- .../main/java/org/openapitools/model/Tag.java | 170 +- .../openapitools/model/TypeHolderDefault.java | 342 ++-- .../openapitools/model/TypeHolderExample.java | 396 ++-- .../java/org/openapitools/model/User.java | 494 ++--- .../java/org/openapitools/model/XmlItem.java | 1738 +++++++++-------- .../src/main/resources/application.yml | 4 +- .../src/main/resources/logback.xml | 15 + .../petstore/java-micronaut-server/.gitignore | 21 + .../.mvn/wrapper/MavenWrapperDownloader.java | 124 ++ .../.mvn/wrapper/maren-wrapper.properties | 2 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 36 + .../.openapi-generator/VERSION | 1 + .../petstore/java-micronaut-server/README.md | 27 + .../java-micronaut-server/build.gradle | 43 + .../docs/controllers/PetController.md | 208 ++ .../docs/controllers/StoreController.md | 99 + .../docs/controllers/UserController.md | 189 ++ .../docs/models/Category.md | 18 + .../docs/models/ModelApiResponse.md | 20 + .../docs/models/Order.md | 33 + .../java-micronaut-server/docs/models/Pet.md | 33 + .../java-micronaut-server/docs/models/Tag.md | 18 + .../java-micronaut-server/docs/models/User.md | 30 + .../java-micronaut-server/gradle.properties | 1 + .../gradle/wrapper/gradle-wrapper.jar | 0 .../gradle/wrapper/gradle-wrapper.properties | 5 + .../petstore/java-micronaut-server/gradlew | 185 ++ .../java-micronaut-server/gradlew.bat | 89 + .../petstore/java-micronaut-server/mvnw | 310 +++ .../petstore/java-micronaut-server/mvnw.bat | 182 ++ .../petstore/java-micronaut-server/pom.xml | 159 ++ .../java-micronaut-server/settings.gradle | 1 + .../java/org/openapitools/Application.java | 9 + .../controller/PetController.java | 286 +++ .../controller/StoreController.java | 136 ++ .../controller/UserController.java | 240 +++ .../java/org/openapitools/model/Category.java | 133 ++ .../openapitools/model/ModelApiResponse.java | 161 ++ .../java/org/openapitools/model/Order.java | 285 +++ .../main/java/org/openapitools/model/Pet.java | 302 +++ .../main/java/org/openapitools/model/Tag.java | 132 ++ .../java/org/openapitools/model/User.java | 306 +++ .../src/main/resources/application.yml | 18 + .../src/main/resources/logback.xml | 15 + .../controller/PetControllerSpec.groovy | 398 ++++ .../controller/StoreControllerSpec.groovy | 210 ++ .../controller/UserControllerSpec.groovy | 381 ++++ .../openapitools/model/CategorySpec.groovy | 37 + .../model/ModelApiResponseSpec.groovy | 44 + .../org/openapitools/model/OrderSpec.groovy | 66 + .../org/openapitools/model/PetSpec.groovy | 69 + .../org/openapitools/model/TagSpec.groovy | 37 + .../org/openapitools/model/UserSpec.groovy | 79 + 262 files changed, 14987 insertions(+), 8057 deletions(-) create mode 100644 bin/configs/java-micronaut-server.yaml create mode 100644 docs/generators/java-micronaut-server.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache delete mode 100644 modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/Authorization.mustache (94%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/AuthorizationBinder.mustache (97%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/AuthorizationFilter.mustache (99%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/Authorizations.mustache (89%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/configuration/ApiKeyAuthConfiguration.mustache (97%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/configuration/ConfigurableAuthorization.mustache (84%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/auth/configuration/HttpBasicAuthConfiguration.mustache (96%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/doc/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/doc/api_doc.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/doc/auth.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client}/params/type.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client/test}/api_test.groovy.mustache (88%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client/test}/api_test.mustache (88%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client/test}/model_test.groovy.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/client/test}/model_test.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/Application.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/application.yml.mustache (87%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/git/git_push.sh.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/git/gitignore.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/gradle/build.gradle.mustache (85%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/gradle/settings.gradle.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/gradlew/gradle-wrapper.jar (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/gradlew/gradle-wrapper.properties.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/gradlew/gradlew.bat.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/gradlew/gradlew.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/mavenw/MavenWrapperDownloader.java.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/mavenw/maven-wrapper.jar.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/mavenw/maven-wrapper.properties.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/mavenw/mvnw.bat.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/mavenw/mvnw.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/configuration/pom.xml.mustache (97%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/doc/enum_outer_doc.mustache (58%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/doc/pojo_doc.mustache (76%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/generatedAnnotation.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/licenseInfo.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/model/model.mustache (91%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client/model/modelInnerEnum.mustache => java-micronaut/common/model/modelEnum.mustache} (52%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/model/oneof_interface.mustache (77%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/model/typeInfoAnnotation.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/model/xmlAnnotation.mustache (100%) rename modules/openapi-generator/src/main/resources/{java-micronaut-client => java-micronaut/common}/params/beanValidation.mustache (82%) create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/AnotherFakeApi.md (100%) rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/FakeApi.md (99%) rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/FakeClassnameTags123Api.md (100%) rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/PetApi.md (100%) rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/StoreApi.md (100%) rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/UserApi.md (100%) rename samples/client/petstore/java-micronaut-client/docs/{ => apis}/auth.md (100%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesAnyType.md (57%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesArray.md (58%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesBoolean.md (57%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesClass.md (86%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesInteger.md (57%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesNumber.md (58%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesObject.md (58%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/AdditionalPropertiesString.md (58%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Animal.md (67%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ArrayOfArrayOfNumberOnly.md (63%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ArrayOfNumberOnly.md (63%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ArrayTest.md (78%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/BigCat.md (52%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/BigCatAllOf.md (52%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Capitalization.md (80%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Cat.md (65%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/CatAllOf.md (63%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Category.md (65%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ClassModel.md (68%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Dog.md (64%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/DogAllOf.md (63%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/EnumArrays.md (61%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/EnumClass.md (51%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/EnumTest.md (71%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/FileSchemaTestClass.md (69%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/FormatTest.md (86%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/HasOnlyReadOnly.md (69%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/MapTest.md (75%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/MixedPropertiesAndAdditionalPropertiesClass.md (66%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Model200Response.md (71%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ModelApiResponse.md (70%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ModelClient.md (62%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ModelFile.md (68%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ModelList.md (63%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ModelReturn.md (66%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Name.md (80%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/NumberOnly.md (63%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Order.md (72%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/OuterComposite.md (71%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/OuterEnum.md (55%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Pet.md (74%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/ReadOnlyFirst.md (68%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/SpecialModelName.md (62%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/Tag.md (69%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/TypeHolderDefault.md (72%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/TypeHolderExample.md (73%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/User.md (84%) rename samples/client/petstore/java-micronaut-client/docs/{ => models}/XmlItem.md (93%) create mode 100644 samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml create mode 100644 samples/server/petstore/java-micronaut-server/.gitignore create mode 100644 samples/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java create mode 100644 samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties create mode 100644 samples/server/petstore/java-micronaut-server/.openapi-generator-ignore create mode 100644 samples/server/petstore/java-micronaut-server/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION create mode 100644 samples/server/petstore/java-micronaut-server/README.md create mode 100644 samples/server/petstore/java-micronaut-server/build.gradle create mode 100644 samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/models/Category.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/models/Order.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/models/Pet.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/models/Tag.md create mode 100644 samples/server/petstore/java-micronaut-server/docs/models/User.md create mode 100644 samples/server/petstore/java-micronaut-server/gradle.properties create mode 100644 samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/server/petstore/java-micronaut-server/gradlew create mode 100644 samples/server/petstore/java-micronaut-server/gradlew.bat create mode 100644 samples/server/petstore/java-micronaut-server/mvnw create mode 100644 samples/server/petstore/java-micronaut-server/mvnw.bat create mode 100644 samples/server/petstore/java-micronaut-server/pom.xml create mode 100644 samples/server/petstore/java-micronaut-server/settings.gradle create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java create mode 100644 samples/server/petstore/java-micronaut-server/src/main/resources/application.yml create mode 100644 samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy create mode 100644 samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy diff --git a/bin/configs/java-micronaut-client.yaml b/bin/configs/java-micronaut-client.yaml index 31722943924..bf0720a6913 100644 --- a/bin/configs/java-micronaut-client.yaml +++ b/bin/configs/java-micronaut-client.yaml @@ -7,3 +7,4 @@ additionalProperties: configureAuth: "false" build: "all" test: "spock" + requiredPropertiesInConstructor: "false" diff --git a/bin/configs/java-micronaut-server.yaml b/bin/configs/java-micronaut-server.yaml new file mode 100644 index 00000000000..d0c4df9ac5e --- /dev/null +++ b/bin/configs/java-micronaut-server.yaml @@ -0,0 +1,10 @@ +generatorName: java-micronaut-server +outputDir: samples/server/petstore/java-micronaut-server/ +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + artifactId: petstore-micronaut-server + hideGenerationTimestamp: "true" + build: "all" + test: "spock" + requiredPropertiesInConstructor: "true" + useAuth: "false" diff --git a/docs/generators.md b/docs/generators.md index dc04b6f7452..afd41cba7e3 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -99,6 +99,7 @@ The following generators are available: * [haskell-yesod (beta)](generators/haskell-yesod.md) * [java-camel](generators/java-camel.md) * [java-inflector](generators/java-inflector.md) +* [java-micronaut-server (beta)](generators/java-micronaut-server.md) * [java-msf4j](generators/java-msf4j.md) * [java-pkmst](generators/java-pkmst.md) * [java-play-framework](generators/java-play-framework.md) diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 00bb283b8c7..c1ba0089f6b 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -29,7 +29,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| |build|Specify for which build tool to generate files|
**gradle**
Gradle configuration is generated for the project
**all**
Both Gradle and Maven configurations are generated
**maven**
Maven configuration is generated for the project
|all| -|configPackage|Configuration package for generated code| |org.openapitools.configuration| |configureAuth|Configure all the authorization methods as specified in the file| |false| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| @@ -49,12 +48,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| +|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.2.6| |modelPackage|package for generated models| |org.openapitools.model| |openApiNullable|Enable OpenAPI Jackson Nullable library| |true| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|requiredPropertiesInConstructor|Allow only to create models with all the required properties provided in constructor| |true| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| @@ -64,7 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |test|Specify which test tool to generate files for|
**junit**
Use JUnit as test tool
**spock**
Use Spock as test tool
|junit| -|title|Client service name| |OpenAPI Micronaut Client| +|title|Client service name| |null| |useBeanValidation|Use BeanValidation API annotations| |true| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md new file mode 100644 index 00000000000..b99834e7c64 --- /dev/null +++ b/docs/generators/java-micronaut-server.md @@ -0,0 +1,314 @@ +--- +title: Documentation for the java-micronaut-server Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-micronaut-server | pass this to the generate command after -g | +| generator stability | BETA | | +| generator type | SERVER | | +| generator language | Java | | +| helpTxt | Generates a Java Micronaut Server. | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-micronaut| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|build|Specify for which build tool to generate files|
**gradle**
Gradle configuration is generated for the project
**all**
Both Gradle and Maven configurations are generated
**maven**
Maven configuration is generated for the project
|all| +|controllerPackage|The package in which controllers will be generated| |org.openapitools.api| +|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generateControllerAsAbstract|Generate an abstract class for controller to be extended. (apiPackage is then used for the abstract class, and controllerPackage is used for implementation that extends it.)| |false| +|generateControllerFromExamples|Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|invokerPackage|root package for generated code| |org.openapitools| +|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.2.6| +|modelPackage|package for generated models| |org.openapitools.model| +|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|requiredPropertiesInConstructor|Allow only to create models with all the required properties provided in constructor| |true| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/main/java| +|test|Specify which test tool to generate files for|
**junit**
Use JUnit as test tool
**spock**
Use Spock as test tool
|junit| +|title|Client service name| |null| +|useAuth|Whether to import authorization and to annotate controller methods accordingly| |true| +|useBeanValidation|Use BeanValidation API annotations| |true| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|BigDecimal|java.math.BigDecimal| +|CompletedFileUpload|io.micronaut.http.multipart.CompletedFileUpload| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ArrayList| +|map|HashMap| +|set|LinkedHashSet| + + +## LANGUAGE PRIMITIVES + +
    +
  • Boolean
  • +
  • Double
  • +
  • Float
  • +
  • Integer
  • +
  • Long
  • +
  • Object
  • +
  • String
  • +
  • boolean
  • +
  • byte[]
  • +
+ +## RESERVED WORDS + +
    +
  • abstract
  • +
  • apiclient
  • +
  • apiexception
  • +
  • apiresponse
  • +
  • application
  • +
  • assert
  • +
  • authorization
  • +
  • body
  • +
  • boolean
  • +
  • break
  • +
  • byte
  • +
  • case
  • +
  • catch
  • +
  • char
  • +
  • class
  • +
  • client
  • +
  • configuration
  • +
  • const
  • +
  • continue
  • +
  • cookie
  • +
  • default
  • +
  • do
  • +
  • double
  • +
  • else
  • +
  • enum
  • +
  • extends
  • +
  • file
  • +
  • final
  • +
  • finally
  • +
  • float
  • +
  • for
  • +
  • format
  • +
  • goto
  • +
  • header
  • +
  • if
  • +
  • implements
  • +
  • import
  • +
  • instanceof
  • +
  • int
  • +
  • interface
  • +
  • list
  • +
  • localreturntype
  • +
  • localvaraccept
  • +
  • localvaraccepts
  • +
  • localvarauthnames
  • +
  • localvarcollectionqueryparams
  • +
  • localvarcontenttype
  • +
  • localvarcontenttypes
  • +
  • localvarcookieparams
  • +
  • localvarformparams
  • +
  • localvarheaderparams
  • +
  • localvarpath
  • +
  • localvarpostbody
  • +
  • localvarqueryparams
  • +
  • long
  • +
  • native
  • +
  • new
  • +
  • null
  • +
  • object
  • +
  • package
  • +
  • pathvariable
  • +
  • private
  • +
  • protected
  • +
  • public
  • +
  • queryparam
  • +
  • queryvalue
  • +
  • return
  • +
  • short
  • +
  • static
  • +
  • strictfp
  • +
  • stringutil
  • +
  • super
  • +
  • switch
  • +
  • synchronized
  • +
  • this
  • +
  • throw
  • +
  • throws
  • +
  • transient
  • +
  • try
  • +
  • void
  • +
  • volatile
  • +
  • while
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✓|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java new file mode 100644 index 00000000000..b8b8506e8f4 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java @@ -0,0 +1,511 @@ +package org.openapitools.codegen.languages; + +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; + +import java.util.*; +import java.util.stream.Collectors; + +import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE; + +public abstract class JavaMicronautAbstractCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { + public static final String OPT_TITLE = "title"; + public static final String OPT_BUILD = "build"; + public static final String OPT_BUILD_GRADLE = "gradle"; + public static final String OPT_BUILD_MAVEN = "maven"; + public static final String OPT_BUILD_ALL = "all"; + public static final String OPT_TEST = "test"; + public static final String OPT_TEST_JUNIT = "junit"; + public static final String OPT_TEST_SPOCK = "spock"; + public static final String OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR = "requiredPropertiesInConstructor"; + public static final String OPT_MICRONAUT_VERSION = "micronautVersion"; + public static final String OPT_USE_AUTH = "useAuth"; + + protected String title; + protected boolean useBeanValidation; + protected String buildTool; + protected String testTool; + protected boolean requiredPropertiesInConstructor = true; + protected String micronautVersion = "3.2.6"; + + public static final String CONTENT_TYPE_APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"; + public static final String CONTENT_TYPE_APPLICATION_JSON = "application/json"; + public static final String CONTENT_TYPE_MULTIPART_FORM_DATA = "multipart/form-data"; + public static final String CONTENT_TYPE_ANY = "*/*"; + + public JavaMicronautAbstractCodegen() { + super(); + + // Set all the fields + useBeanValidation = true; + buildTool = OPT_BUILD_ALL; + testTool = OPT_TEST_JUNIT; + outputFolder = "generated-code/java-micronaut-client"; + templateDir = "java-micronaut/client"; + apiPackage = "org.openapitools.api"; + modelPackage = "org.openapitools.model"; + invokerPackage = "org.openapitools"; + artifactId = "openapi-micronaut"; + embeddedTemplateDir = templateDir = "java-micronaut"; + apiDocPath = "docs/apis"; + modelDocPath = "docs/models"; + + // Set implemented features for user information + modifyFeatureSet(features -> features + .includeDocumentationFeatures( + DocumentationFeature.Readme + ) + .securityFeatures(EnumSet.of( + SecurityFeature.ApiKey, + SecurityFeature.BasicAuth, + SecurityFeature.OAuth2_Implicit, + SecurityFeature.OAuth2_AuthorizationCode, + SecurityFeature.OAuth2_ClientCredentials, + SecurityFeature.OAuth2_Password, + SecurityFeature.OpenIDConnect + )) + ); + + // Set additional properties + additionalProperties.put("jackson", "true"); + additionalProperties.put("openbrace", "{"); + additionalProperties.put("closebrace", "}"); + + // Set client options that will be presented to user + updateOption(INVOKER_PACKAGE, this.getInvokerPackage()); + updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); + updateOption(CodegenConstants.API_PACKAGE, apiPackage); + updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); + + cliOptions.add(new CliOption(OPT_TITLE, "Client service name").defaultValue(title)); + cliOptions.add(new CliOption(OPT_MICRONAUT_VERSION, "Micronaut version, only >=3.0.0 versions are supported").defaultValue(micronautVersion)); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation)); + cliOptions.add(CliOption.newBoolean(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "Allow only to create models with all the required properties provided in constructor", requiredPropertiesInConstructor)); + + CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool); + buildToolOption.setEnum(new HashMap() {{ + put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project"); + put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project"); + put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated"); + }}); + cliOptions.add(buildToolOption); + + CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool); + testToolOption.setEnum(new HashMap() {{ + put(OPT_TEST_JUNIT, "Use JUnit as test tool"); + put(OPT_TEST_SPOCK, "Use Spock as test tool"); + }}); + cliOptions.add(testToolOption); + + // Remove the date library option + cliOptions.stream().filter(o -> o.getOpt().equals("dateLibrary")).findFirst() + .ifPresent(v -> cliOptions.remove(v)); + + // Add reserved words + String[] reservedWordsArray = { + "client", "format", "queryvalue", "queryparam", "pathvariable", "header", "cookie", + "authorization", "body", "application" + }; + reservedWords.addAll(Arrays.asList(reservedWordsArray)); + } + + @Override + public void processOpts() { + super.processOpts(); + + // Get properties + if (additionalProperties.containsKey(OPT_TITLE)) { + this.title = (String) additionalProperties.get(OPT_TITLE); + } + + if (additionalProperties.containsKey(INVOKER_PACKAGE)) { + invokerPackage = (String) additionalProperties.get(INVOKER_PACKAGE); + } else { + additionalProperties.put(INVOKER_PACKAGE, invokerPackage); + } + + if (additionalProperties.containsKey(OPT_MICRONAUT_VERSION)) { + micronautVersion = (String) additionalProperties.get(OPT_MICRONAUT_VERSION); + } else { + additionalProperties.put(OPT_MICRONAUT_VERSION, micronautVersion); + } + + // Get boolean properties + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + + if (additionalProperties.containsKey(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR)) { + this.requiredPropertiesInConstructor = convertPropertyToBoolean(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR); + } + writePropertyBack(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, requiredPropertiesInConstructor); + + // Get enum properties + if (additionalProperties.containsKey(OPT_BUILD)) { + switch ((String) additionalProperties.get(OPT_BUILD)) { + case OPT_BUILD_GRADLE: + case OPT_BUILD_MAVEN: + case OPT_BUILD_ALL: + this.buildTool = (String) additionalProperties.get(OPT_BUILD); + break; + default: + throw new RuntimeException("Build tool \"" + additionalProperties.get(OPT_BUILD) + "\" is not supported or misspelled."); + } + } + additionalProperties.put(OPT_BUILD, buildTool); + + if (additionalProperties.containsKey(OPT_TEST)) { + switch ((String) additionalProperties.get(OPT_TEST)) { + case OPT_TEST_JUNIT: + case OPT_TEST_SPOCK: + this.testTool = (String) additionalProperties.get(OPT_TEST); + break; + default: + throw new RuntimeException("Test tool \"" + additionalProperties.get(OPT_TEST) + "\" is not supported or misspelled."); + } + } + additionalProperties.put(OPT_TEST, testTool); + if (testTool.equals(OPT_TEST_JUNIT)) { + additionalProperties.put("isTestJunit", true); + } else if (testTool.equals(OPT_TEST_SPOCK)) { + additionalProperties.put("isTestSpock", true); + } + + // Add all the supporting files + String resourceFolder = projectFolder + "/resources"; + supportingFiles.add(new SupportingFile("common/configuration/application.yml.mustache", resourceFolder, "application.yml").doNotOverwrite()); + supportingFiles.add(new SupportingFile("common/configuration/logback.xml.mustache", resourceFolder, "logback.xml").doNotOverwrite()); + + if (buildTool.equals(OPT_BUILD_GRADLE) || buildTool.equals(OPT_BUILD_ALL)) { + // Gradle files + supportingFiles.add(new SupportingFile("common/configuration/gradle/build.gradle.mustache", "", "build.gradle").doNotOverwrite()); + supportingFiles.add(new SupportingFile("common/configuration/gradle/settings.gradle.mustache", "", "settings.gradle").doNotOverwrite()); + supportingFiles.add(new SupportingFile("common/configuration/gradle/gradle.properties.mustache", "", "gradle.properties").doNotOverwrite()); + + // Gradlew files + final String gradleWrapperFolder = "gradle/wrapper"; + supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradlew.mustache", "", "gradlew")); + supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradlew.bat.mustache", "", "gradlew.bat")); + supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradle-wrapper.properties.mustache", gradleWrapperFolder, "gradle-wrapper.properties")); + supportingFiles.add(new SupportingFile("common/configuration/gradlew/gradle-wrapper.jar", gradleWrapperFolder, "gradle-wrapper.jar")); + } + + if (buildTool.equals(OPT_BUILD_MAVEN) || buildTool.equals(OPT_BUILD_ALL)) { + // Maven files + supportingFiles.add(new SupportingFile("common/configuration/pom.xml.mustache", "", "pom.xml").doNotOverwrite()); + + // Maven wrapper files + supportingFiles.add(new SupportingFile("common/configuration/mavenw/mvnw.mustache", "", "mvnw")); + supportingFiles.add(new SupportingFile("common/configuration/mavenw/mvnw.bat.mustache", "", "mvnw.bat")); + supportingFiles.add(new SupportingFile("common/configuration/mavenw/MavenWrapperDownloader.java.mustache", ".mvn/wrapper", "MavenWrapperDownloader.java")); + supportingFiles.add(new SupportingFile("common/configuration/mavenw/maven-wrapper.jar.mustache", ".mvn/wrapper", "maven-wrapper.jar")); + supportingFiles.add(new SupportingFile("common/configuration/mavenw/maven-wrapper.properties.mustache", ".mvn/wrapper", "maren-wrapper.properties")); + } + + // Git files + supportingFiles.add(new SupportingFile("common/configuration/git/gitignore.mustache", "", ".gitignore").doNotOverwrite()); + + // Use the default java LocalDate + typeMapping.put("date", "LocalDate"); + typeMapping.put("DateTime", "LocalDateTime"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + + // Add documentation files + modelDocTemplateFiles.clear(); + modelDocTemplateFiles.put("common/doc/model_doc.mustache", ".md"); + + // Add model files + modelTemplateFiles.clear(); + modelTemplateFiles.put("common/model/model.mustache", ".java"); + + // Add test files + modelTestTemplateFiles.clear(); + if (testTool.equals(OPT_TEST_JUNIT)) { + modelTestTemplateFiles.put("common/test/model_test.mustache", ".java"); + } else if (testTool.equals(OPT_TEST_SPOCK)) { + modelTestTemplateFiles.put("common/test/model_test.groovy.mustache", ".groovy"); + } + + // Set properties for documentation + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); + final String apiFolder = (sourceFolder + '/' + apiPackage()).replace('.', '/'); + final String modelFolder = (sourceFolder + '/' + modelPackage()).replace('.', '/'); + additionalProperties.put("invokerFolder", invokerFolder); + additionalProperties.put("resourceFolder", resourceFolder); + additionalProperties.put("apiFolder", apiFolder); + additionalProperties.put("modelFolder", modelFolder); + } + + @Override + public String apiTestFileFolder() { + if (testTool.equals(OPT_TEST_SPOCK)) { + return getOutputDir() + "/src/test/groovy/" + apiPackage().replaceAll("\\.", "/"); + } + return getOutputDir() + "/src/test/java/" + apiPackage().replaceAll("\\.", "/"); + } + + @Override + public String modelTestFileFolder() { + if (testTool.equals(OPT_TEST_SPOCK)) { + return getOutputDir() + "/src/test/groovy/" + modelPackage().replaceAll("\\.", "/"); + } + return getOutputDir() + "/src/test/java/" + modelPackage().replaceAll("\\.", "/"); + } + + @Override + public String toApiTestFilename(String name) { + if (testTool.equals(OPT_TEST_SPOCK)) { + return toApiName(name) + "Spec"; + } + return toApiName(name) + "Test"; + } + + @Override + public String toModelTestFilename(String name) { + if (testTool.equals(OPT_TEST_SPOCK)) { + return toModelName(name) + "Spec"; + } + return toModelName(name) + "Test"; + } + + @Override + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + @Override + public String toApiVarName(String name) { + String apiVarName = super.toApiVarName(name); + if (reservedWords.contains(apiVarName)) { + apiVarName = escapeReservedWord(apiVarName); + } + return apiVarName; + } + + public boolean isUseBeanValidation() { + return useBeanValidation; + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + objs = super.postProcessOperationsWithModels(objs, allModels); + + Map models = allModels.stream() + .map(v -> ((Map) v).get("model")) + .collect(Collectors.toMap(v -> v.classname, v -> v)); + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + + for (CodegenOperation op : operationList) { + // Set whether body is supported in request + op.vendorExtensions.put("methodAllowsBody", + op.httpMethod.equals("PUT") || op.httpMethod.equals("POST") || op.httpMethod.equals("PATCH")); + + // Set response example + if (op.returnType != null) { + String example; + String groovyExample; + if (models.containsKey(op.returnType)) { + CodegenModel m = models.get(op.returnType); + List allowableValues = null; + if (m.allowableValues != null && m.allowableValues.containsKey("values")) { + allowableValues = (List) m.allowableValues.get("values"); + } + example = getExampleValue(m.defaultValue, null, m.classname, true, + allowableValues, null, null, m.requiredVars, false); + groovyExample = getExampleValue(m.defaultValue, null, m.classname, true, + allowableValues, null, null, m.requiredVars, true); + } else { + example = getExampleValue(null, null, op.returnType, false, null, + op.returnBaseType, null, null, false); + groovyExample = getExampleValue(null, null, op.returnType, false, null, + op.returnBaseType, null, null, true); + } + op.vendorExtensions.put("example", example); + op.vendorExtensions.put("groovyExample", groovyExample); + } + + // Remove the "*/*" contentType from operations as it is ambiguous + if (CONTENT_TYPE_ANY.equals(op.vendorExtensions.get("x-contentType"))) { + op.vendorExtensions.put("x-contentType", CONTENT_TYPE_APPLICATION_JSON); + } + op.consumes = op.consumes == null ? null : op.consumes.stream() + .filter(contentType -> !CONTENT_TYPE_ANY.equals(contentType.get("mediaType"))) + .collect(Collectors.toList()); + op.produces = op.produces == null ? null : op.produces.stream() + .filter(contentType -> !CONTENT_TYPE_ANY.equals(contentType.get("mediaType"))) + .collect(Collectors.toList()); + + // Force form parameters are only set if the content-type is according + // formParams correspond to urlencoded type + // bodyParams correspond to multipart body + if (CONTENT_TYPE_APPLICATION_FORM_URLENCODED.equals(op.vendorExtensions.get("x-contentType"))) { + op.formParams.addAll(op.bodyParams); + op.bodyParams.forEach(p -> { + p.isBodyParam = false; + p.isFormParam = true; + }); + op.bodyParams.clear(); + } else if (CONTENT_TYPE_MULTIPART_FORM_DATA.equals(op.vendorExtensions.get("x-contentType"))) { + op.bodyParams.addAll(op.formParams); + op.formParams.forEach(p -> { + p.isBodyParam = true; + p.isFormParam = false; + }); + op.formParams.clear(); + } + } + + return objs; + } + + @Override + public Map postProcessAllModels(Map objs) { + objs = super.postProcessAllModels(objs); + + for (String modelName: objs.keySet()) { + CodegenModel model = ((Map>>) objs.get(modelName)) + .get("models").get(0).get("model"); + if (model.getParentModel() != null) { + model.vendorExtensions.put("requiredParentVars", model.getParentModel().requiredVars); + } + + List requiredVars = model.vars.stream().filter(v -> v.required).collect(Collectors.toList()); + model.vendorExtensions.put("requiredVars", requiredVars); + } + + return objs; + } + + @Override + public void setParameterExampleValue(CodegenParameter p) { + p.vendorExtensions.put("groovyExample", getParameterExampleValue(p, true)); + p.example = getParameterExampleValue(p, false); + } + + protected String getParameterExampleValue(CodegenParameter p, boolean groovy) { + List allowableValues = p.allowableValues == null ? null : (List) p.allowableValues.get("values"); + + return getExampleValue(p.defaultValue, p.example, p.dataType, p.isModel, allowableValues, + p.items == null ? null : p.items.dataType, + p.items == null ? null : p.items.defaultValue, + p.requiredVars, groovy); + } + + protected String getPropertyExampleValue(CodegenProperty p, boolean groovy) { + List allowableValues = p.allowableValues == null ? null : (List) p.allowableValues.get("values"); + + return getExampleValue(p.defaultValue, p.example, p.dataType, p.isModel, allowableValues, + p.items == null ? null : p.items.dataType, + p.items == null ? null : p.items.defaultValue, + null, groovy); + } + + public String getExampleValue( + String defaultValue, String example, String dataType, Boolean isModel, List allowableValues, + String itemsType, String itemsExample, List requiredVars, boolean groovy + ) { + example = defaultValue != null ? defaultValue : example; + String containerType = dataType == null ? null : dataType.split("<")[0]; + + if ("String".equals(dataType)) { + if (groovy) { + example = example != null ? "'" + escapeTextGroovy(example) + "'" : "'example'"; + } else { + example = example != null ? "\"" + escapeText(example) + "\"" : "\"example\""; + } + } else if ("Integer".equals(dataType) || "Short".equals(dataType)) { + example = example != null ? example : "56"; + } else if ("Long".equals(dataType)) { + example = StringUtils.appendIfMissingIgnoreCase(example != null ? example : "56", "L"); + } else if ("Float".equals(dataType)) { + example = StringUtils.appendIfMissingIgnoreCase(example != null ? example : "3.4", "F"); + } else if ("Double".equals(dataType)) { + example = StringUtils.appendIfMissingIgnoreCase(example != null ? example : "3.4", "D"); + } else if ("Boolean".equals(dataType)) { + example = example != null ? example : "false"; + } else if ("File".equals(dataType)) { + example = null; + } else if ("LocalDate".equals(dataType)) { + example = "LocalDate.of(2001, 2, 3)"; + } else if ("LocalDateTime".equals(dataType)) { + example = "LocalDateTime.of(2001, 2, 3, 4, 5)"; + } else if ("BigDecimal".equals(dataType)) { + example = "new BigDecimal(78)"; + } else if (allowableValues != null && !allowableValues.isEmpty()) { + // This is an enum + Object value = example; + if (value == null || !allowableValues.contains(value)) { + value = allowableValues.get(0); + } + example = dataType + ".fromValue(\"" + value + "\")"; + } else if ((isModel != null && isModel) || (isModel == null && !languageSpecificPrimitives.contains(dataType))) { + if (requiredVars == null) { + example = null; + } else { + if (requiredPropertiesInConstructor) { + StringBuilder builder = new StringBuilder(); + builder.append("new ").append(dataType).append("("); + for (int i = 0; i < requiredVars.size(); ++i) { + if (i != 0) { + builder.append(", "); + } + builder.append(getPropertyExampleValue(requiredVars.get(i), groovy)); + } + builder.append(")"); + example = builder.toString(); + } else { + example = "new " + dataType + "()"; + } + } + } + + if ("List".equals(containerType)) { + String innerExample; + if ("String".equals(itemsType)) { + itemsExample = itemsExample != null ? itemsExample : "example"; + if (groovy) { + innerExample = "'" + escapeTextGroovy(itemsExample) + "'"; + } else { + innerExample = "\"" + escapeText(itemsExample) + "\""; + } + } else { + innerExample = itemsExample != null ? itemsExample : ""; + } + + if (groovy) { + example = "[" + innerExample + "]"; + } else { + example = "Arrays.asList(" + innerExample + ")"; + } + } else if ("Set".equals(containerType)) { + if (groovy) { + example = "[].asSet()"; + } else { + example = "new HashSet<>()"; + } + } else if ("Map".equals(containerType)) { + if (groovy) { + example = "[:]"; + } else { + example = "new HashMap<>()"; + } + } else if (example == null) { + example = "null"; + } + + return example; + } + + public String escapeTextGroovy(String text) { + if (text == null) { + return null; + } + return escapeText(text).replaceAll("'", "\\'"); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java index f3d398c8e76..997ecf31723 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java @@ -1,127 +1,36 @@ package org.openapitools.codegen.languages; import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.DocumentationFeature; -import org.openapitools.codegen.meta.features.SecurityFeature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; -import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE; - - -public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { +public class JavaMicronautClientCodegen extends JavaMicronautAbstractCodegen { private final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); - public static final String OPT_TITLE = "title"; - public static final String OPT_CONFIG_PACKAGE = "configPackage"; public static final String OPT_CONFIGURE_AUTH = "configureAuth"; - public static final String OPT_BUILD = "build"; - public static final String OPT_BUILD_GRADLE = "gradle"; - public static final String OPT_BUILD_MAVEN = "maven"; - public static final String OPT_BUILD_ALL = "all"; - public static final String OPT_TEST = "test"; - public static final String OPT_TEST_JUNIT = "junit"; - public static final String OPT_TEST_SPOCK = "spock"; public static final String NAME = "java-micronaut-client"; - protected String title; - protected String configPackage; - protected boolean useBeanValidation; protected boolean configureAuthorization; - protected String buildTool; - protected String testTool; public JavaMicronautClientCodegen() { super(); title = "OpenAPI Micronaut Client"; - invokerPackage = "org.openapitools"; - configPackage = "org.openapitools.configuration"; - useBeanValidation = true; configureAuthorization = false; - buildTool = OPT_BUILD_ALL; - testTool = OPT_TEST_JUNIT; - - modifyFeatureSet(features -> features - .includeDocumentationFeatures( - DocumentationFeature.Readme - ) - .securityFeatures(EnumSet.of( - SecurityFeature.ApiKey, - SecurityFeature.BasicAuth, - SecurityFeature.OAuth2_Implicit, - SecurityFeature.OAuth2_AuthorizationCode, - SecurityFeature.OAuth2_ClientCredentials, - SecurityFeature.OAuth2_Password, - SecurityFeature.OpenIDConnect - )) - ); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) .build(); + additionalProperties.put("client", "true"); - outputFolder = "generated-code/java-micronaut-client"; - embeddedTemplateDir = templateDir = "java-micronaut-client"; - apiPackage = "org.openapitools.api"; - modelPackage = "org.openapitools.model"; - invokerPackage = "org.openapitools"; - artifactId = "openapi-micronaut"; - - updateOption(INVOKER_PACKAGE, this.getInvokerPackage()); - updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); - updateOption(CodegenConstants.API_PACKAGE, apiPackage); - updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); - - apiTestTemplateFiles.clear(); - - additionalProperties.put("jackson", "true"); - additionalProperties.put("openbrace", "{"); - additionalProperties.put("closebrace", "}"); - - cliOptions.add(new CliOption(OPT_TITLE, "Client service name").defaultValue(title)); - cliOptions.add(new CliOption(OPT_CONFIG_PACKAGE, "Configuration package for generated code").defaultValue(configPackage)); cliOptions.add(CliOption.newBoolean(OPT_CONFIGURE_AUTH, "Configure all the authorization methods as specified in the file", configureAuthorization)); - cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation)); - - CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool); - Map buildToolOptionMap = new HashMap(); - buildToolOptionMap.put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project"); - buildToolOptionMap.put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project"); - buildToolOptionMap.put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated"); - buildToolOption.setEnum(buildToolOptionMap); - cliOptions.add(buildToolOption); - - CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool); - Map testToolOptionMap = new HashMap(); - testToolOptionMap.put(OPT_TEST_JUNIT, "Use JUnit as test tool"); - testToolOptionMap.put(OPT_TEST_SPOCK, "Use Spock as test tool"); - testToolOption.setEnum(testToolOptionMap); - cliOptions.add(testToolOption); - - // Remove the date library option - cliOptions.stream().filter(o -> o.getOpt().equals("dateLibrary")).findFirst() - .ifPresent(v -> cliOptions.remove(v)); - - // Add reserved words - String[] reservedWordsArray = { - "client", "format", "queryvalue", "queryparam", "pathvariable", "header", "cookie", - "authorization", "body", "application" - }; - reservedWords.addAll(Arrays.asList(reservedWordsArray)); } @Override @@ -139,202 +48,53 @@ public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements B return "Generates a Java Micronaut Client."; } + public boolean isConfigureAuthorization() { + return configureAuthorization; + } + @Override public void processOpts() { super.processOpts(); - // Get properties - if (additionalProperties.containsKey(OPT_TITLE)) { - this.title = (String) additionalProperties.get(OPT_TITLE); - } - - if (additionalProperties.containsKey(OPT_CONFIG_PACKAGE)) { - configPackage = (String) additionalProperties.get(OPT_CONFIG_PACKAGE); - } else { - additionalProperties.put(OPT_CONFIG_PACKAGE, configPackage); - } - - if (additionalProperties.containsKey(INVOKER_PACKAGE)) { - invokerPackage = (String) additionalProperties.get(INVOKER_PACKAGE); - } else { - additionalProperties.put(INVOKER_PACKAGE, invokerPackage); - } - - // Get boolean properties - if (additionalProperties.containsKey(USE_BEANVALIDATION)) { - this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); - } - writePropertyBack(USE_BEANVALIDATION, useBeanValidation); - if (additionalProperties.containsKey(OPT_CONFIGURE_AUTH)) { this.configureAuthorization = convertPropertyToBoolean(OPT_CONFIGURE_AUTH); } writePropertyBack(OPT_CONFIGURE_AUTH, configureAuthorization); - // Get enum properties - if (additionalProperties.containsKey(OPT_BUILD)) { - switch ((String) additionalProperties.get(OPT_BUILD)) { - case OPT_BUILD_GRADLE: - case OPT_BUILD_MAVEN: - case OPT_BUILD_ALL: - this.buildTool = (String) additionalProperties.get(OPT_BUILD); - break; - default: - throw new RuntimeException("Build tool \"" + additionalProperties.get(OPT_BUILD) + "\" is not supported or misspelled."); - } - } - additionalProperties.put(OPT_BUILD, buildTool); - - if (additionalProperties.containsKey(OPT_TEST)) { - switch ((String) additionalProperties.get(OPT_TEST)) { - case OPT_TEST_JUNIT: - case OPT_TEST_SPOCK: - this.testTool = (String) additionalProperties.get(OPT_TEST); - break; - default: - throw new RuntimeException("Test tool \"" + additionalProperties.get(OPT_TEST) + "\" is not supported or misspelled."); - } - } - additionalProperties.put(OPT_TEST, testTool); - if (testTool.equals(OPT_TEST_JUNIT)) { - additionalProperties.put("isTestJunit", true); - } else if (testTool.equals(OPT_TEST_SPOCK)) { - additionalProperties.put("isTestSpock", true); - } + // Write property that is present in server + writePropertyBack(OPT_USE_AUTH, true); final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); - final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/"); - - // Add all the supporting files - String resourceFolder = projectFolder + "/resources"; - supportingFiles.add(new SupportingFile("configuration/application.yml.mustache", resourceFolder, "application.yml").doNotOverwrite()); // Authorization files if (configureAuthorization) { final String authFolder = invokerFolder + "/auth"; - supportingFiles.add(new SupportingFile("auth/Authorization.mustache", authFolder, "Authorization.java")); - supportingFiles.add(new SupportingFile("auth/AuthorizationBinder.mustache", authFolder, "AuthorizationBinder.java")); - supportingFiles.add(new SupportingFile("auth/Authorizations.mustache", authFolder, "Authorizations.java")); - supportingFiles.add(new SupportingFile("auth/AuthorizationFilter.mustache", authFolder, "AuthorizationFilter.java")); + supportingFiles.add(new SupportingFile("client/auth/Authorization.mustache", authFolder, "Authorization.java")); + supportingFiles.add(new SupportingFile("client/auth/AuthorizationBinder.mustache", authFolder, "AuthorizationBinder.java")); + supportingFiles.add(new SupportingFile("client/auth/Authorizations.mustache", authFolder, "Authorizations.java")); + supportingFiles.add(new SupportingFile("client/auth/AuthorizationFilter.mustache", authFolder, "AuthorizationFilter.java")); final String authConfigurationFolder = authFolder + "/configuration"; - supportingFiles.add(new SupportingFile("auth/configuration/ApiKeyAuthConfiguration.mustache", authConfigurationFolder, "ApiKeyAuthConfiguration.java")); - supportingFiles.add(new SupportingFile("auth/configuration/ConfigurableAuthorization.mustache", authConfigurationFolder, "ConfigurableAuthorization.java")); - supportingFiles.add(new SupportingFile("auth/configuration/HttpBasicAuthConfiguration.mustache", authConfigurationFolder, "HttpBasicAuthConfiguration.java")); + supportingFiles.add(new SupportingFile("client/auth/configuration/ApiKeyAuthConfiguration.mustache", authConfigurationFolder, "ApiKeyAuthConfiguration.java")); + supportingFiles.add(new SupportingFile("client/auth/configuration/ConfigurableAuthorization.mustache", authConfigurationFolder, "ConfigurableAuthorization.java")); + supportingFiles.add(new SupportingFile("client/auth/configuration/HttpBasicAuthConfiguration.mustache", authConfigurationFolder, "HttpBasicAuthConfiguration.java")); } - // Query files - final String queryFolder = invokerFolder + "/query"; - supportingFiles.add(new SupportingFile("query/QueryParam.mustache", queryFolder, "QueryParam.java")); - supportingFiles.add(new SupportingFile("query/QueryParamBinder.mustache", queryFolder, "QueryParamBinder.java")); - - if (buildTool.equals(OPT_BUILD_GRADLE) || buildTool.equals(OPT_BUILD_ALL)) { - // Gradle files - supportingFiles.add(new SupportingFile("configuration/gradle/build.gradle.mustache", "", "build.gradle").doNotOverwrite()); - supportingFiles.add(new SupportingFile("configuration/gradle/settings.gradle.mustache", "", "settings.gradle").doNotOverwrite()); - supportingFiles.add(new SupportingFile("configuration/gradle/gradle.properties.mustache", "", "gradle.properties").doNotOverwrite()); - - // Gradlew files - final String gradleWrapperFolder = "gradle/wrapper"; - supportingFiles.add(new SupportingFile("configuration/gradlew/gradlew.mustache", "", "gradlew")); - supportingFiles.add(new SupportingFile("configuration/gradlew/gradlew.bat.mustache", "", "gradlew.bat")); - supportingFiles.add(new SupportingFile("configuration/gradlew/gradle-wrapper.properties.mustache", gradleWrapperFolder, "gradle-wrapper.properties")); - supportingFiles.add(new SupportingFile("configuration/gradlew/gradle-wrapper.jar", gradleWrapperFolder, "gradle-wrapper.jar")); - } - - if (buildTool.equals(OPT_BUILD_MAVEN) || buildTool.equals(OPT_BUILD_ALL)) { - // Maven files - supportingFiles.add(new SupportingFile("configuration/pom.xml.mustache", "", "pom.xml").doNotOverwrite()); - - // Maven wrapper files - supportingFiles.add(new SupportingFile("configuration/mavenw/mvnw.mustache", "", "mvnw")); - supportingFiles.add(new SupportingFile("configuration/mavenw/mvnw.bat.mustache", "", "mvnw.bat")); - supportingFiles.add(new SupportingFile("configuration/mavenw/MavenWrapperDownloader.java.mustache", ".mvn/wrapper", "MavenWrapperDownloader.java")); - supportingFiles.add(new SupportingFile("configuration/mavenw/maven-wrapper.jar.mustache", ".mvn/wrapper", "maven-wrapper.jar")); - supportingFiles.add(new SupportingFile("configuration/mavenw/maven-wrapper.properties.mustache", ".mvn/wrapper", "maren-wrapper.properties")); - } - - // Git files - supportingFiles.add(new SupportingFile("configuration/git/gitignore.mustache", "", ".gitignore").doNotOverwrite()); - - // Use the default java Date - typeMapping.put("date", "LocalDate"); - typeMapping.put("DateTime", "LocalDateTime"); - importMapping.put("LocalDate", "java.time.LocalDate"); - importMapping.put("LocalDateTime", "java.time.LocalDateTime"); - - // Add documentation files - supportingFiles.add(new SupportingFile("doc/README.mustache", "", "README.md").doNotOverwrite()); - supportingFiles.add(new SupportingFile("doc/auth.mustache", apiDocPath, "auth.md")); - modelDocTemplateFiles.put("doc/model_doc.mustache", ".md"); - apiDocTemplateFiles.put("doc/api_doc.mustache", ".md"); - modelDocTemplateFiles.remove("model_doc.mustache"); - apiDocTemplateFiles.remove("api_doc.mustache"); - - // Add model files - modelTemplateFiles.remove("model.mustache"); - modelTemplateFiles.put("model/model.mustache", ".java"); + // Api file + apiTemplateFiles.clear(); + apiTemplateFiles.put("client/api.mustache", ".java"); // Add test files + apiTestTemplateFiles.clear(); if (testTool.equals(OPT_TEST_JUNIT)) { - apiTestTemplateFiles.put("api_test.mustache", ".java"); - modelTestTemplateFiles.put("model_test.mustache", ".java"); + apiTestTemplateFiles.put("client/test/api_test.mustache", ".java"); } else if (testTool.equals(OPT_TEST_SPOCK)) { - apiTestTemplateFiles.put("api_test.groovy.mustache", ".groovy"); - modelTestTemplateFiles.put("model_test.groovy.mustache", ".groovy"); + apiTestTemplateFiles.put("client/test/api_test.groovy.mustache", ".groovy"); } - } - @Override - public String apiTestFileFolder() { - if (testTool.equals(OPT_TEST_SPOCK)) { - return getOutputDir() + "/src/test/groovy/" + getInvokerPackage().replaceAll("\\.", "/") + "/api"; - } - return getOutputDir() + "/src/test/java/" + getInvokerPackage().replaceAll("\\.", "/") + "/api"; - } - - @Override - public String modelTestFileFolder() { - if (testTool.equals(OPT_TEST_SPOCK)) { - return getOutputDir() + "/src/test/groovy/" + getInvokerPackage().replaceAll("\\.", "/") + "/model"; - } - return getOutputDir() + "/src/test/java/" + getInvokerPackage().replaceAll("\\.", "/") + "/model"; - } - - @Override - public String toApiTestFilename(String name) { - if (testTool.equals(OPT_TEST_SPOCK)) { - return toApiName(name) + "Spec"; - } - return toApiName(name) + "Test"; - } - - @Override - public String toModelTestFilename(String name) { - if (testTool.equals(OPT_TEST_SPOCK)) { - return toModelName(name) + "Spec"; - } - return toModelName(name) + "Test"; - } - - @Override - public void setUseBeanValidation(boolean useBeanValidation) { - this.useBeanValidation = useBeanValidation; - } - - @Override - public String toApiVarName(String name) { - String apiVarName = super.toApiVarName(name); - if (reservedWords.contains(apiVarName)) { - apiVarName = escapeReservedWord(apiVarName); - } - return apiVarName; - } - - public boolean isUseBeanValidation() { - return useBeanValidation; - } - - public boolean isConfigureAuthorization() { - return configureAuthorization; + // Add documentation files + supportingFiles.add(new SupportingFile("client/doc/README.mustache", "", "README.md").doNotOverwrite()); + supportingFiles.add(new SupportingFile("client/doc/auth.mustache", apiDocPath, "auth.md")); + apiDocTemplateFiles.clear(); + apiDocTemplateFiles.put("client/doc/api_doc.mustache", ".md"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java new file mode 100644 index 00000000000..da071b68ec8 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautServerCodegen.java @@ -0,0 +1,178 @@ +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.utils.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.File; +import java.util.List; +import java.util.Map; + + +public class JavaMicronautServerCodegen extends JavaMicronautAbstractCodegen { + public static final String OPT_CONTROLLER_PACKAGE = "controllerPackage"; + public static final String OPT_GENERATE_CONTROLLER_FROM_EXAMPLES = "generateControllerFromExamples"; + public static final String OPT_GENERATE_CONTROLLER_AS_ABSTRACT = "generateControllerAsAbstract"; + + private final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); + + public static final String NAME = "java-micronaut-server"; + + protected String controllerPackage = "org.openapitools.controller"; + protected boolean generateControllerAsAbstract = false; + protected boolean generateControllerFromExamples = false; + protected boolean useAuth = true; + + protected String controllerPrefix = ""; + protected String controllerSuffix = "Controller"; + protected String apiPrefix = "Abstract"; + protected String apiSuffix = "Controller"; + + public JavaMicronautServerCodegen() { + super(); + + title = "OpenAPI Micronaut Server";; + apiPackage = "org.openapitools.api"; + apiDocPath = "docs/controllers"; + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + additionalProperties.put("server", "true"); + + cliOptions.add(new CliOption(OPT_CONTROLLER_PACKAGE, "The package in which controllers will be generated").defaultValue(apiPackage)); + cliOptions.removeIf(c -> c.getOpt().equals(CodegenConstants.API_PACKAGE)); + cliOptions.add(CliOption.newBoolean(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES, + "Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)", + generateControllerFromExamples)); + cliOptions.add(CliOption.newBoolean(OPT_GENERATE_CONTROLLER_AS_ABSTRACT, + "Generate an abstract class for controller to be extended. (" + CodegenConstants.API_PACKAGE + + " is then used for the abstract class, and " + OPT_CONTROLLER_PACKAGE + + " is used for implementation that extends it.)", + generateControllerAsAbstract)); + cliOptions.add(CliOption.newBoolean(OPT_USE_AUTH, "Whether to import authorization and to annotate controller methods accordingly", useAuth)); + + // Set the type mappings + // It could be also StreamingFileUpload + typeMapping.put("file", "CompletedFileUpload"); + importMapping.put("CompletedFileUpload", "io.micronaut.http.multipart.CompletedFileUpload"); + } + + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public String getHelp() { + return "Generates a Java Micronaut Server."; + } + + @Override + public void processOpts() { + // Get all the properties that require to know if user specified them directly + if (additionalProperties.containsKey(OPT_GENERATE_CONTROLLER_AS_ABSTRACT)) { + generateControllerAsAbstract = convertPropertyToBoolean(OPT_GENERATE_CONTROLLER_AS_ABSTRACT); + } + writePropertyBack(OPT_GENERATE_CONTROLLER_AS_ABSTRACT, generateControllerAsAbstract); + + if (additionalProperties.containsKey(OPT_CONTROLLER_PACKAGE)) { + controllerPackage = (String) additionalProperties.get(OPT_CONTROLLER_PACKAGE); + } else if (!generateControllerAsAbstract && additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + controllerPackage = (String) additionalProperties.get(CodegenConstants.API_PACKAGE); + } + additionalProperties.put(OPT_CONTROLLER_PACKAGE, controllerPackage); + + if (!generateControllerAsAbstract) { + apiPackage = controllerPackage; + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + } + super.processOpts(); + + // Get all the other properties after superclass processed everything + if (additionalProperties.containsKey(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES)) { + generateControllerFromExamples = convertPropertyToBoolean(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES); + } + writePropertyBack(OPT_GENERATE_CONTROLLER_FROM_EXAMPLES, generateControllerFromExamples); + + if (additionalProperties.containsKey(OPT_USE_AUTH)) { + useAuth = convertPropertyToBoolean(OPT_USE_AUTH); + } + writePropertyBack(OPT_USE_AUTH, useAuth); + + // Api file + apiTemplateFiles.clear(); + if (generateControllerAsAbstract) { + setApiNamePrefix(apiPrefix); + setApiNameSuffix(apiSuffix); + } else { + setApiNamePrefix(controllerPrefix); + setApiNameSuffix(controllerSuffix); + } + apiTemplateFiles.put("server/controller.mustache", ".java"); + + // Add documentation files + supportingFiles.add(new SupportingFile("server/doc/README.mustache", "", "README.md").doNotOverwrite()); + apiDocTemplateFiles.clear(); + apiDocTemplateFiles.put("server/doc/controller_doc.mustache", ".md"); + + // Add test files + apiTestTemplateFiles.clear(); + // Controller Implementation is generated as a test file - so that it is not overwritten + if (generateControllerAsAbstract) { + apiTestTemplateFiles.put("server/controllerImplementation.mustache", ".java"); + } + if (testTool.equals(OPT_TEST_JUNIT)) { + apiTestTemplateFiles.put("server/test/controller_test.mustache", ".java"); + } else if (testTool.equals(OPT_TEST_SPOCK)) { + apiTestTemplateFiles.put("server/test/controller_test.groovy.mustache", ".groovy"); + } + + // Add Application.java file + String invokerFolder = (sourceFolder + '/' + invokerPackage).replace('.', '/'); + supportingFiles.add(new SupportingFile("common/configuration/Application.mustache", invokerFolder, "Application.java").doNotOverwrite()); + } + + @Override + public String apiTestFilename(String templateName, String tag) { + if (generateControllerAsAbstract && templateName.contains("controllerImplementation")) { + return ( + outputFolder + File.separator + + sourceFolder + File.separator + + controllerPackage.replace('.', File.separatorChar) + File.separator + + StringUtils.camelize(controllerPrefix + "_" + tag + "_" + controllerSuffix) + ".java" + ).replace('/', File.separatorChar); + } + + return super.apiTestFilename(templateName, tag); + } + + @Override + public void setParameterExampleValue(CodegenParameter p) { + super.setParameterExampleValue(p); + + if (p.isFile) { + // The CompletedFileUpload cannot be initialized + p.example = "null"; + } + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + objs = super.postProcessOperationsWithModels(objs, allModels); + + // Add the controller classname to operations + Map operations = (Map) objs.get("operations"); + String controllerClassname = StringUtils.camelize(controllerPrefix + "_" + operations.get("pathPrefix") + "_" + controllerSuffix); + objs.put("controllerClassname", controllerClassname); + + return objs; + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index d5911a2139b..434911baff5 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -58,6 +58,7 @@ org.openapitools.codegen.languages.JavaClientCodegen org.openapitools.codegen.languages.JavaCXFClientCodegen org.openapitools.codegen.languages.JavaInflectorServerCodegen org.openapitools.codegen.languages.JavaMicronautClientCodegen +org.openapitools.codegen.languages.JavaMicronautServerCodegen org.openapitools.codegen.languages.JavaMSF4JServerCodegen org.openapitools.codegen.languages.JavaPKMSTServerCodegen org.openapitools.codegen.languages.JavaPlayFrameworkCodegen diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache deleted file mode 100644 index 4232340e520..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/api.mustache +++ /dev/null @@ -1,70 +0,0 @@ -{{>licenseInfo}} -package {{package}}; - -import io.micronaut.http.annotation.*; -import io.micronaut.core.annotation.*; -import io.micronaut.http.client.annotation.Client; -{{#configureAuth}} -import {{invokerPackage}}.auth.Authorization; -{{/configureAuth}} -import {{invokerPackage}}.query.QueryParam; -import io.micronaut.core.convert.format.Format; -import reactor.core.publisher.Mono; -{{#imports}}import {{import}}; -{{/imports}} -import javax.annotation.Generated; -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}}{{#useBeanValidation}} -import javax.validation.Valid; -import javax.validation.constraints.*; -{{/useBeanValidation}} - -{{>generatedAnnotation}} -@Client("${base-path}") -public interface {{classname}} { -{{#operations}}{{#operation}} - /** - {{#summary}} - * {{summary}} - {{/summary}} - {{#notes}} - * {{notes}} - {{/notes}} - {{^summary}} - {{^notes}} - * {{nickname}} - {{/notes}} - {{/summary}} - * -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -{{/allParams}} -{{#returnType}} - * @return {{returnType}} -{{/returnType}} -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} - */ - @{{#lambda.pascalcase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.pascalcase}}(uri="{{{path}}}") - {{#vendorExtensions.x-contentType}} - @Produces(value={"{{vendorExtensions.x-contentType}}"}) - {{/vendorExtensions.x-contentType}} - @Consumes(value={"{{vendorExtensions.x-accepts}}"}) - {{!auth methods}} - {{#configureAuth}} - {{#authMethods}} - @Authorization(name="{{{name}}}"{{!scopes}}{{#isOAuth}}, scopes={{=< >=}}{<={{ }}=>{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}{{=< >=}}}<={{ }}=>{{/isOAuth}}) - {{/authMethods}} - {{/configureAuth}} - {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{^allParams}});{{/allParams}}{{#allParams}} - {{>params/queryParams}}{{>params/pathParams}}{{>params/headerParams}}{{>params/bodyParams}}{{>params/formParams}}{{>params/cookieParams}}{{^-last}}, {{/-last}}{{#-last}} - );{{/-last}}{{/allParams}} - {{/operation}} -{{/operations}} -} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache deleted file mode 100644 index 4804e049014..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/gradle.properties.mustache +++ /dev/null @@ -1 +0,0 @@ -micronautVersion=3.0.0-M5 \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache deleted file mode 100644 index 3f14f653581..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/model_doc.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{#models}}{{#model}} - -{{#isEnum}}{{>doc/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>doc/pojo_doc}}{{/isEnum}} -{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache deleted file mode 100644 index bbc797247ea..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/beanValidation.mustache +++ /dev/null @@ -1,52 +0,0 @@ -{{#useBeanValidation}}{{! -validate all pojos and enums -}}{{^isContainer}}{{#isModel}} @Valid -{{/isModel}}{{/isContainer}}{{! -nullable & nonnull -}}{{#required}}{{#isNullable}} @Nullable -{{/isNullable}}{{^isNullable}} @NotNull -{{/isNullable}}{{/required}}{{^required}} @Nullable -{{/required}}{{! -pattern -}}{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}") -{{/isByteArray}}{{/pattern}}{{! -both minLength && maxLength -}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}}, max={{maxLength}}) -{{/maxLength}}{{/minLength}}{{! -just minLength -}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}) -{{/maxLength}}{{/minLength}}{{! -just maxLength -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}) -{{/maxLength}}{{/minLength}}{{! -@Size: both minItems && maxItems -}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}}, max={{maxItems}}) -{{/maxItems}}{{/minItems}}{{! -@Size: just minItems -}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}) -{{/maxItems}}{{/minItems}}{{! -@Size: just maxItems -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}) -{{/maxItems}}{{/minItems}}{{! -@Email -}}{{#isEmail}} @Email -{{/isEmail}}{{! -check for integer or long / all others=decimal type with @Decimal* -isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}) -{{/minimum}}{{#maximum}} @Max({{maximum}}) -{{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L) -{{/minimum}}{{#maximum}} @Max({{maximum}}L) -{{/maximum}}{{/isLong}}{{! -Not Integer, not Long => we have a decimal value! -}}{{^isInteger}}{{^isLong}}{{! -minimum for decimal value -}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}}, inclusive=false{{/exclusiveMinimum}}) -{{/minimum}}{{! -maximal for decimal value -}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}}, inclusive=false{{/exclusiveMaximum}}) -{{/maximum}}{{! -close decimal values -}}{{/isLong}}{{/isInteger}}{{/useBeanValidation}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache deleted file mode 100644 index b7f047ee540..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/jackson_annotations.mustache +++ /dev/null @@ -1,26 +0,0 @@ -{{! - If this is map and items are nullable, make sure that nulls are included. - To determine what JsonInclude.Include method to use, consider the following: - * If the field is required, always include it, even if it is null. - * Else use custom behaviour, IOW use whatever is defined on the object mapper - }} - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} - {{#isDateTime}} - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - {{/isDateTime}} - {{#isDate}} - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - {{/isDate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache deleted file mode 100644 index 3bb6622f08d..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelEnum.mustache +++ /dev/null @@ -1,61 +0,0 @@ -{{#jackson}} -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -{{/jackson}} - -/** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} - */ -{{#additionalEnumTypeAnnotations}} -{{{.}}} -{{/additionalEnumTypeAnnotations}}{{#useBeanValidation}}@Introspected -{{/useBeanValidation}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { - {{#allowableValues}} - {{#enumVars}} - {{#enumDescription}} - /** - * {{enumDescription}} - */ - {{/enumDescription}} - {{#withXml}} - @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) - {{/withXml}} - {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} - {{/enumVars}} - {{/allowableValues}} - - private {{{dataType}}} value; - - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { - this.value = value; - } - - {{#jackson}} - @JsonValue - {{/jackson}} - public {{{dataType}}} getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - {{#jackson}} - @JsonCreator - {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { - return b; - } - } - {{#isNullable}} - return null; - {{/isNullable}} - {{^isNullable}} - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - {{/isNullable}} - } -} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache deleted file mode 100644 index e643ca051cd..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/pojo.mustache +++ /dev/null @@ -1,332 +0,0 @@ -/** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} - */ -{{#description}} -@ApiModel(description = "{{{description}}}") -{{/description}} -{{#jackson}} -@JsonPropertyOrder({ - {{#vars}} - {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} - {{/vars}} -}) -@JsonTypeName("{{name}}") -{{/jackson}} -{{#additionalModelTypeAnnotations}} -{{{.}}} -{{/additionalModelTypeAnnotations}} -{{>generatedAnnotation}}{{#discriminator}}{{>model/typeInfoAnnotation}}{{/discriminator}}{{>model/xmlAnnotation}}{{#useBeanValidation}} -@Introspected -{{/useBeanValidation}}{{! -Declare the class with extends and implements -}}public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ - {{#serializableModel}} - private static final long serialVersionUID = 1L; - - {{/serializableModel}} - {{#vars}} - {{#isEnum}} - {{^isContainer}} -{{>model/modelInnerEnum}} - {{/isContainer}} - {{#isContainer}} - {{#mostInnerItems}} -{{>model/modelInnerEnum}} - {{/mostInnerItems}} - {{/isContainer}} - {{/isEnum}} - public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; - {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}" - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} - {{/withXml}} - {{#vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); - {{/isContainer}} - {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; - {{/isContainer}} - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} - {{/vendorExtensions.x-is-jackson-optional-nullable}} - - {{/vars}} - {{#parcelableModel}} - public {{classname}}() { - {{#parent}} - super(); - {{/parent}} - } - - {{/parcelableModel}} - {{#vars}} - {{^isReadOnly}} - public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - return this; - } - - {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); - } - try { - this.{{name}}.get().add({{name}}Item); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; - } - {{/required}} - this.{{name}}.add({{name}}Item); - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - - {{/isArray}} - {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); - } - try { - this.{{name}}.get().put(key, {{name}}Item); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; - } - {{/required}} - this.{{name}}.put(key, {{name}}Item); - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - - {{/isMap}} - {{/isReadOnly}} - /** - {{#description}} - * {{description}} - {{/description}} - {{^description}} - * Get {{name}} - {{/description}} - {{#minimum}} - * minimum: {{minimum}} - {{/minimum}} - {{#maximum}} - * maximum: {{maximum}} - {{/maximum}} - * @return {{name}} - **/ -{{>model/beanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") - {{#vendorExtensions.x-extra-annotation}} - {{{vendorExtensions.x-extra-annotation}}} - {{/vendorExtensions.x-extra-annotation}} - {{#vendorExtensions.x-is-jackson-optional-nullable}} -{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#jackson}} -{{>model/jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - {{#isReadOnly}} -{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) { - {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; - } - {{/isReadOnly}} - return {{name}}.orElse(null); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - return {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - - {{#vendorExtensions.x-is-jackson-optional-nullable}} -{{>model/jackson_annotations}} - public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { - return {{name}}; - } - - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { - {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} this.{{name}} = {{name}}; - } - - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^isReadOnly}} - {{#jackson}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} -{{>model/jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}}{{#vendorExtensions.x-setter-extra-annotation}} - {{{vendorExtensions.x-setter-extra-annotation}}} -{{/vendorExtensions.x-setter-extra-annotation}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - - {{/isReadOnly}} - {{/vars}} - @Override - public boolean equals(Object o) { - {{#useReflectionEqualsHashCode}} - return EqualsBuilder.reflectionEquals(this, o, false, null, true); - {{/useReflectionEqualsHashCode}} - {{^useReflectionEqualsHashCode}} - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - {{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && - {{/-last}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}}; - {{/hasVars}} - {{^hasVars}} - return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}}; - {{/hasVars}} - {{/useReflectionEqualsHashCode}} - } - - @Override - public int hashCode() { - {{#useReflectionEqualsHashCode}} - return HashCodeBuilder.reflectionHashCode(this); - {{/useReflectionEqualsHashCode}} - {{^useReflectionEqualsHashCode}} - return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - {{/useReflectionEqualsHashCode}} - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class {{classname}} {\n"); - {{#parent}} - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - {{/parent}} - {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); - {{/vars}} - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - {{#parcelableModel}} - public void writeToParcel(Parcel out, int flags) { - {{#model}} - {{#isArray}} - out.writeList(this); - {{/isArray}} - {{^isArray}} - {{#parent}} - super.writeToParcel(out, flags); - {{/parent}} - {{#vars}} - out.writeValue({{name}}); - {{/vars}} - {{/isArray}} - {{/model}} - } - - {{classname}}(Parcel in) { - {{#isArray}} - in.readTypedList(this, {{arrayModelType}}.CREATOR); - {{/isArray}} - {{^isArray}} - {{#parent}} - super(in); - {{/parent}} - {{#vars}} - {{#isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); - {{/isPrimitiveType}} - {{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); - {{/isPrimitiveType}} - {{/vars}} - {{/isArray}} - } - - public int describeContents() { - return 0; - } - - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { - public {{classname}} createFromParcel(Parcel in) { - {{#model}} - {{#isArray}} - {{classname}} result = new {{classname}}(); - result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); - return result; - {{/isArray}} - {{^isArray}} - return new {{classname}}(in); - {{/isArray}} - {{/model}} - } - public {{classname}}[] newArray(int size) { - return new {{classname}}[size]; - } - }; - {{/parcelableModel}} -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache deleted file mode 100644 index b111ea9e05d..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/bodyParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isBodyParam}}@Body {{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache deleted file mode 100644 index fab940b7460..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/cookieParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isCookieParam}}@CookieValue(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{defaultValue}}"{{/defaultValue}}) {{>params/beanValidationCore}}{{>params/type}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache deleted file mode 100644 index e41f37e421f..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/formParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isFormParam}}{{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache deleted file mode 100644 index 9aab83b5462..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/headerParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isHeaderParam}}@Header(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache deleted file mode 100644 index c67b97ed3f6..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/pathParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}@PathVariable(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache deleted file mode 100644 index 7ef44500582..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/queryParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isQueryParam}}@QueryParam(name="{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{!multi format}}{{#isCollectionFormatMulti}}, format=QueryParam.Format.MULTI{{/isCollectionFormatMulti}}{{!deep object}}{{#isDeepObject}}, format=QueryParam.Format.DEEP_OBJECT{{/isDeepObject}}{{!other collection formats}}{{^isCollectionFormatMulti}}{{^isDeepObject}}{{#collectionFormat}}, format=QueryParam.Format.{{#lambda.uppercase}}{{collectionFormat}}{{/lambda.uppercase}}{{/collectionFormat}}{{/isDeepObject}}{{/isCollectionFormatMulti}}) {{!validation and type}}{{>params/beanValidation}}{{>params/type}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache deleted file mode 100644 index 4c3e845a1be..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParam.mustache +++ /dev/null @@ -1,78 +0,0 @@ -{{>licenseInfo}} -package {{invokerPackage}}.query; - -import io.micronaut.context.annotation.AliasFor; -import io.micronaut.core.bind.annotation.Bindable; -import javax.annotation.Generated; -import java.lang.annotation.*; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - - -/** - * Indicates that the parameter is a query parameter - */ -{{>generatedAnnotation}} -@Documented -@Retention(RUNTIME) -@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE}) -@Bindable -@Inherited -public @interface QueryParam { - - /** - * @return The name of the parameter - */ - @AliasFor(annotation = Bindable.class, member = "value") - String value() default ""; - - /** - * @return The name of the parameter - */ - @AliasFor(annotation = Bindable.class, member = "value") - String name() default ""; - - /** - * @see Bindable#defaultValue() - * @return The default value - */ - @AliasFor(annotation = Bindable.class, member = "defaultValue") - String defaultValue() default ""; - - /** - * @return The format of the given values in the URL - */ - Format format() default Format.CSV; - - /** - * The possible formats of the query parameter in the URL. - * The conversion of various types is according to openapi v3 specification: - * @see openapi v3 specification - * Values are serialized using Jackson object mapper - */ - public static enum Format { - /** - * The values of iterator are comma-delimited. - * Ambiguity can arise if values of Iterator contain commas inside themselves. In such case, the MULTI format - * should be preferred. - * Null values are not supported and will be removed during the conversion process. - */ - CSV, - /** - * The values are space-delimited, similarly to comma-delimited format. - */ - SSV, - /** - * The values a delimited by pipes "|", similarly to comma-delimited format. - */ - PIPES, - /** - * The values are repeated as separate parameters, e.g.: color=blue&color=black&color=brown. - */ - MULTI, - /** - * The format supports 1-depth recursion into objects with setting each attribute as a separate parameter, e.g.: - * 'color[R]=100&color[G]=200&color[B]=150'. - */ - DEEP_OBJECT - } -} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache b/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache deleted file mode 100644 index 2a90b8b6658..00000000000 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/query/QueryParamBinder.mustache +++ /dev/null @@ -1,164 +0,0 @@ -{{>licenseInfo}} -package {{invokerPackage}}.query; - -import io.micronaut.core.annotation.NonNull; -import io.micronaut.core.beans.BeanProperty; -import io.micronaut.core.beans.BeanWrapper; -import io.micronaut.core.convert.ArgumentConversionContext; -import io.micronaut.core.convert.ConversionContext; -import io.micronaut.core.convert.ConversionService; -import io.micronaut.core.util.StringUtils; -import io.micronaut.http.MutableHttpRequest; -import io.micronaut.http.client.bind.AnnotatedClientArgumentRequestBinder; -import io.micronaut.http.client.bind.ClientRequestUriContext; - -import java.util.Collection; -import java.util.Optional; -import jakarta.inject.Singleton; -import javax.annotation.Generated; - - -{{>generatedAnnotation}} -@Singleton -public class QueryParamBinder implements AnnotatedClientArgumentRequestBinder { - private static final Character COMMA_DELIMITER = ','; - private static final Character PIPE_DELIMITER = '|'; - private static final Character SPACE_DELIMITER = ' '; - - private final ConversionService conversionService; - - public QueryParamBinder(ConversionService conversionService) { - this.conversionService = conversionService; - } - - @NonNull - @Override - public Class getAnnotationType() { - return QueryParam.class; - } - - @Override - public void bind(@NonNull ArgumentConversionContext context, - @NonNull ClientRequestUriContext uriContext, - @NonNull Object value, - @NonNull MutableHttpRequest request - ) { - String key = context.getAnnotationMetadata().stringValue(QueryParam.class) - .filter(StringUtils::isNotEmpty) - .orElse(context.getArgument().getName()); - - QueryParam.Format format = context.getAnnotationMetadata() - .enumValue(QueryParam.class, "format", QueryParam.Format.class) - .orElse(QueryParam.Format.CSV); - - if (format == QueryParam.Format.DEEP_OBJECT) { - addDeepObjectParameters(context, value, key, uriContext); - } else if (format == QueryParam.Format.MULTI) { - addMultiParameters(context, value, key, uriContext); - } else { - Character delimiter = ' '; - switch (format) { - case SSV: - delimiter = SPACE_DELIMITER; - break; - case PIPES: - delimiter = PIPE_DELIMITER; - break; - case CSV: - delimiter = COMMA_DELIMITER; - break; - default: - } - createSeparatedQueryParam(context, value, delimiter) - .ifPresent(v -> uriContext.addQueryParameter(key, v)); - } - } - - private void addMultiParameters( - ArgumentConversionContext context, Object value, String key, ClientRequestUriContext uriContext - ) { - if (value instanceof Iterable) { - // noinspection unchecked - Iterable iterable = (Iterable) value; - - for (Object item : iterable) { - convertToString(context, item).ifPresent(v -> uriContext.addQueryParameter(key, v)); - } - } else { - convertToString(context, value).ifPresent(v -> uriContext.addQueryParameter(key, v)); - } - } - - private void addDeepObjectParameters( - ArgumentConversionContext context, Object value, String key, ClientRequestUriContext uriContext - ) { - if (value instanceof Iterable) { - StringBuilder builder = new StringBuilder(key); - - Iterable iterable = (Iterable) value; - - int i = 0; - for (Object item: iterable) { - if (item == null) { - continue; - } - String index = String.valueOf(i); - - builder.append('['); - builder.append(index); - builder.append(']'); - - convertToString(context, item).ifPresent(v -> uriContext.addQueryParameter(builder.toString(), v)); - builder.delete(builder.length() - index.length() - 2, builder.length()); - i++; - } - } else if (value != null) { - StringBuilder builder = new StringBuilder(key); - BeanWrapper wrapper = BeanWrapper.getWrapper(value); - Collection> properties = wrapper.getBeanProperties(); - for (BeanProperty property: properties) { - Object item = property.get(value); - if (item == null) { - continue; - } - builder.append('['); - builder.append(property.getName()); - builder.append(']'); - - convertToString(context, item).ifPresent(v -> uriContext.addQueryParameter(builder.toString(), v)); - builder.delete(builder.length() - property.getName().length() - 2, builder.length()); - } - } - } - - private Optional createSeparatedQueryParam( - ArgumentConversionContext context, Object value, Character delimiter - ) { - if (value instanceof Iterable) { - StringBuilder builder = new StringBuilder(); - // noinspection unchecked - Iterable iterable = (Iterable) value; - - boolean first = true; - for (Object item : iterable) { - Optional opt = convertToString(context, item); - if (opt.isPresent()) { - if (!first) { - builder.append(delimiter); - } - first = false; - builder.append(opt.get()); - } - } - - return Optional.of(builder.toString()); - } else { - return convertToString(context, value); - } - } - - private Optional convertToString(ArgumentConversionContext context, Object value) { - return conversionService.convert(value, ConversionContext.STRING.with(context.getAnnotationMetadata())) - .filter(StringUtils::isNotEmpty); - } -} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache new file mode 100644 index 00000000000..871eb59dfe0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/api.mustache @@ -0,0 +1,71 @@ +{{>common/licenseInfo}} +package {{package}}; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.*; +import io.micronaut.http.client.annotation.Client; +{{#configureAuth}} +import {{invokerPackage}}.auth.Authorization; +{{/configureAuth}} +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +{{#imports}}import {{import}}; +{{/imports}} +import javax.annotation.Generated; +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}}{{#useBeanValidation}} +import javax.validation.Valid; +import javax.validation.constraints.*; +{{/useBeanValidation}} + +{{>common/generatedAnnotation}} +@Client("${base-path}") +public interface {{classname}} { +{{#operations}} + {{#operation}} + /** + {{#summary}} + * {{summary}} + {{/summary}} + {{#notes}} + * {{notes}} + {{/notes}} + {{^summary}} + {{^notes}} + * {{nickname}} + {{/notes}} + {{/summary}} + * + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + @{{#lambda.pascalcase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.pascalcase}}(uri="{{{path}}}") + {{#vendorExtensions.x-contentType}} + @Produces(value={"{{vendorExtensions.x-contentType}}"}) + {{/vendorExtensions.x-contentType}} + @Consumes(value={"{{vendorExtensions.x-accepts}}"}) + {{!auth methods}} + {{#configureAuth}} + {{#authMethods}} + @Authorization(name="{{{name}}}"{{!scopes}}{{#isOAuth}}, scopes={{openbrace}}{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}{{closebrace}}{{/isOAuth}}) + {{/authMethods}} + {{/configureAuth}} + {{!the method definition}} + {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{^allParams}});{{/allParams}}{{#allParams}} + {{>client/params/queryParams}}{{>client/params/pathParams}}{{>client/params/headerParams}}{{>client/params/bodyParams}}{{>client/params/formParams}}{{>client/params/cookieParams}}{{^-last}}, {{/-last}}{{#-last}} + );{{/-last}}{{/allParams}} + {{/operation}} +{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorization.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorization.mustache similarity index 94% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorization.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorization.mustache index ac5f7f979fd..e805e24db6d 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorization.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorization.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth; import io.micronaut.context.annotation.AliasFor; @@ -14,7 +14,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} @Documented @Retention(RUNTIME) @Target(METHOD) diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationBinder.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationBinder.mustache similarity index 97% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationBinder.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationBinder.mustache index fad44af0f00..7dc1814c237 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationBinder.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationBinder.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth; import io.micronaut.aop.MethodInvocationContext; @@ -15,7 +15,7 @@ import java.util.List; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} @Singleton public class AuthorizationBinder implements AnnotatedClientRequestBinder { diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationFilter.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache similarity index 99% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationFilter.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache index 021a5425d39..3bd7a3562df 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/AuthorizationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/AuthorizationFilter.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth; import io.micronaut.context.BeanContext; @@ -36,7 +36,7 @@ import java.util.stream.Stream; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} @Filter(Filter.MATCH_ALL_PATTERN) public class AuthorizationFilter implements HttpClientFilter { private static final Logger LOG = LoggerFactory.getLogger(ClientCredentialsHttpClientFilter.class); diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorizations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorizations.mustache similarity index 89% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorizations.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorizations.mustache index 1ee37c7c1df..7d3fb75cdab 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/Authorizations.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/Authorizations.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth; import io.micronaut.core.bind.annotation.Bindable; @@ -11,7 +11,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} @Documented @Retention(RUNTIME) @Target(METHOD) diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ApiKeyAuthConfiguration.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ApiKeyAuthConfiguration.mustache similarity index 97% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ApiKeyAuthConfiguration.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ApiKeyAuthConfiguration.mustache index 969da02fabc..28d1da0655c 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ApiKeyAuthConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ApiKeyAuthConfiguration.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth.configuration; import io.micronaut.context.annotation.ConfigurationInject; @@ -10,7 +10,7 @@ import io.micronaut.http.cookie.Cookie; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} @EachProperty("security.api-key-auth") public class ApiKeyAuthConfiguration implements ConfigurableAuthorization { private final String name; diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ConfigurableAuthorization.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ConfigurableAuthorization.mustache similarity index 84% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ConfigurableAuthorization.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ConfigurableAuthorization.mustache index 2d649c3a3be..ab87ecfc02c 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/ConfigurableAuthorization.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/ConfigurableAuthorization.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth.configuration; import io.micronaut.core.annotation.NonNull; @@ -6,7 +6,7 @@ import io.micronaut.http.MutableHttpRequest; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} public interface ConfigurableAuthorization { String getName(); diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/HttpBasicAuthConfiguration.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/HttpBasicAuthConfiguration.mustache similarity index 96% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/HttpBasicAuthConfiguration.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/HttpBasicAuthConfiguration.mustache index 189613b4f7e..6431c2846d6 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/auth/configuration/HttpBasicAuthConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/auth/configuration/HttpBasicAuthConfiguration.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{invokerPackage}}.auth.configuration; import io.micronaut.context.annotation.ConfigurationInject; @@ -9,7 +9,7 @@ import io.micronaut.http.MutableHttpRequest; import javax.annotation.Generated; -{{>generatedAnnotation}} +{{>common/generatedAnnotation}} @EachProperty("security.basic-auth") public class HttpBasicAuthConfiguration implements ConfigurableAuthorization { private final String name; diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/README.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/README.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/doc/README.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/api_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/api_doc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/api_doc.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/doc/api_doc.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/auth.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/auth.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/doc/auth.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache new file mode 100644 index 00000000000..fd6862369f1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}@Body {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache new file mode 100644 index 00000000000..60c2c377ec7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieValue(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{defaultValue}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache new file mode 100644 index 00000000000..cfbd00f3428 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache new file mode 100644 index 00000000000..f8a5a79ab62 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@Header(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache new file mode 100644 index 00000000000..64a0be56c6c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}@PathVariable(name="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache new file mode 100644 index 00000000000..aed538a1c3d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}@QueryValue(value="{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{!validation and type}}{{>common/params/beanValidation}}{{>client/params/type}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/type.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/params/type.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/params/type.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/params/type.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.groovy.mustache similarity index 88% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.groovy.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.groovy.mustache index af4469421f3..a660a5bb112 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.groovy.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.groovy.mustache @@ -37,7 +37,7 @@ class {{classname}}Spec extends Specification { {{{dataType}}} {{paramName}} = null {{/allParams}} // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block() - // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) + // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) expect: true diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.mustache similarity index 88% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.mustache index a3c3e48e44b..fc737b42696 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/api_test.mustache @@ -39,7 +39,7 @@ public class {{classname}}Test { {{{dataType}}} {{paramName}} = null; {{/allParams}} // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block(); - // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} asyncResponse = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.groovy.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.groovy.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.groovy.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model_test.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/client/test/model_test.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/Application.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/Application.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/Application.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/Application.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/application.yml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache similarity index 87% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/application.yml.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache index 4b0dd5f1c23..4e7d6e84498 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/application.yml.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/application.yml.mustache @@ -1,5 +1,7 @@ -base-path: "{{{basePath}}}" -context-path: "{{{contextPath}}}" +{{!CLIENT CONFIGURATION}} +{{#client}} +base-path: "{{{basePath}}}/" +context-path: "{{{contextPath}}}/" micronaut: application: @@ -51,6 +53,19 @@ micronaut: username: password: {{/isBasic}}{{/authMethods}}{{/configureAuth}} +{{/client}} +{{!SERVER CONFIGURATION}} +{{#server}} +context-path: "{{{contextPath}}}/" + +micronaut: + application: + name: {{artifactId}} + server: + port: 8080 + security: + # authentication: bearer | cookie | session | idtoken +{{/server}} jackson: serialization: diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/git_push.sh.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/git_push.sh.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/git_push.sh.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/gitignore.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/git/gitignore.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/git/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/build.gradle.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/build.gradle.mustache similarity index 85% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/build.gradle.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/build.gradle.mustache index a654fe37133..11ae6117087 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/build.gradle.mustache @@ -2,8 +2,8 @@ plugins { {{#isTestSpock}} id("groovy") {{/isTestSpock}} - id("com.github.johnrengelman.shadow") version "7.0.0" - id("io.micronaut.application") version "2.0.3" + id("com.github.johnrengelman.shadow") version "7.1.1" + id("io.micronaut.application") version "3.1.1" } version = "{{artifactVersion}}" @@ -30,12 +30,16 @@ micronaut { dependencies { annotationProcessor("io.micronaut:micronaut-http-validation") + {{#useAuth}} annotationProcessor("io.micronaut.security:micronaut-security-annotations") + {{/useAuth}} implementation("io.micronaut:micronaut-http-client") implementation("io.micronaut:micronaut-runtime") implementation("io.micronaut:micronaut-validation") + {{#useAuth}} implementation("io.micronaut.security:micronaut-security") implementation("io.micronaut.security:micronaut-security-oauth2") + {{/useAuth}} implementation("io.micronaut.reactor:micronaut-reactor") implementation("io.swagger:swagger-annotations:1.5.9") runtimeOnly("ch.qos.logback:logback-classic") @@ -49,3 +53,5 @@ java { sourceCompatibility = JavaVersion.toVersion("1.8") targetCompatibility = JavaVersion.toVersion("1.8") } + +graalvmNative.toolchainDetection = false diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache new file mode 100644 index 00000000000..b95f66a2537 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/gradle.properties.mustache @@ -0,0 +1 @@ +micronautVersion={{{micronautVersion}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/settings.gradle.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradle/settings.gradle.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradle/settings.gradle.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.jar similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.jar rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.jar diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.properties.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradle-wrapper.properties.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradle-wrapper.properties.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.bat.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.bat.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.bat.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/gradlew/gradlew.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/gradlew/gradlew.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache new file mode 100644 index 00000000000..82218708264 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/logback.xml.mustache @@ -0,0 +1,15 @@ + + + + false + + + %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n + + + + + + + diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/MavenWrapperDownloader.java.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/MavenWrapperDownloader.java.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/MavenWrapperDownloader.java.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/MavenWrapperDownloader.java.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.jar.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.jar.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.jar.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.jar.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.properties.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/maven-wrapper.properties.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/maven-wrapper.properties.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.bat.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.bat.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.bat.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.bat.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/mavenw/mvnw.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/mavenw/mvnw.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/pom.xml.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/pom.xml.mustache similarity index 97% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/pom.xml.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/pom.xml.mustache index 3ef1c44ab3e..bf1768a17c2 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/configuration/pom.xml.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/configuration/pom.xml.mustache @@ -10,7 +10,7 @@ io.micronaut micronaut-parent - 3.0.0-M5 + {{{micronautVersion}}} @@ -18,7 +18,7 @@ 1.8 - 3.0.0-M5 + {{{micronautVersion}}} {{groupId}}.Application netty 1.5.21 @@ -102,6 +102,7 @@ micronaut-reactor compile + {{#useAuth}} io.micronaut.security micronaut-security @@ -112,6 +113,7 @@ micronaut-security-oauth2 compile + {{/useAuth}} ch.qos.logback logback-classic @@ -144,11 +146,13 @@ micronaut-http-validation ${micronaut.version} + {{#useAuth}} io.micronaut.security micronaut-security-annotations ${micronaut.security.version} + {{/useAuth}} -Amicronaut.processing.group={{groupId}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/enum_outer_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/enum_outer_doc.mustache similarity index 58% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/enum_outer_doc.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/doc/enum_outer_doc.mustache index 20c512aaeae..3851c2f3050 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/enum_outer_doc.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/enum_outer_doc.mustache @@ -2,6 +2,8 @@ ## Enum +The class is defined in **[{{classname}}.java](../../{{{modelFolder}}}/{{classname}}.java)** + {{#allowableValues}}{{#enumVars}} * `{{name}}` (value: `{{{value}}}`) {{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache new file mode 100644 index 00000000000..8e6c8dde1c6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/model_doc.mustache @@ -0,0 +1,4 @@ +{{#models}}{{#model}} + +{{#isEnum}}{{>common/doc/enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>common/doc/pojo_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/pojo_doc.mustache similarity index 76% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/doc/pojo_doc.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/doc/pojo_doc.mustache index 0a79703d7a0..05d13ee4b59 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/doc/pojo_doc.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/doc/pojo_doc.mustache @@ -1,7 +1,10 @@ # {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} +{{#description}} -{{#description}}{{&description}} +{{{description}}} {{/description}} + +The class is defined in **[{{classname}}.java](../../{{{modelFolder}}}/{{classname}}.java)** {{^vendorExtensions.x-is-one-of-interface}} ## Properties @@ -10,30 +13,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}`{{baseType}}{{#items}}<{{dataType}}>`{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}`Map<String, {{dataType}}>`{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}`{{dataType}}`{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional property]{{/required}}{{#isReadOnly}} [readonly property]{{/isReadOnly}} {{/vars}} +{{#vars}} -{{#vars}}{{#isEnum}} - -## Enum: {{datatypeWithEnum}} + {{#isEnum}} +## {{datatypeWithEnum}} Name | Value ----- | -----{{#allowableValues}}{{#enumVars}} -{{name}} | `{{value}}`{{/enumVars}}{{/allowableValues}} -{{/isEnum}}{{/vars}} - +---- | ----- + {{#allowableValues}} + {{#enumVars}} +{{name}} | `{{{value}}}` + {{/enumVars}} + {{/allowableValues}} + {{/isEnum}} +{{/vars}} {{#vendorExtensions.x-implements.0}} + ## Implemented Interfaces -{{#vendorExtensions.x-implements}} + {{#vendorExtensions.x-implements}} * `{{{.}}}` -{{/vendorExtensions.x-implements}} + {{/vendorExtensions.x-implements}} {{/vendorExtensions.x-implements.0}} {{/vendorExtensions.x-is-one-of-interface}} - {{#vendorExtensions.x-is-one-of-interface}} ## Implementing Classes -{{#oneOf}} + {{#oneOf}} * `{{{.}}}` -{{/oneOf}} + {{/oneOf}} {{/vendorExtensions.x-is-one-of-interface}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/generatedAnnotation.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/generatedAnnotation.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/generatedAnnotation.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache new file mode 100644 index 00000000000..ecf4809f9e3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/beanValidation.mustache @@ -0,0 +1,52 @@ +{{#useBeanValidation}}{{! +validate all pojos and enums +}}{{^isContainer}}{{#isModel}} @Valid +{{/isModel}}{{/isContainer}}{{! +nullable & nonnull +}}{{#required}}{{#isNullable}} @Nullable +{{/isNullable}}{{^isNullable}} @NotNull +{{/isNullable}}{{/required}}{{^required}} @Nullable +{{/required}}{{! +pattern +}}{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}") +{{/isByteArray}}{{/pattern}}{{! +both minLength && maxLength +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}}, max={{maxLength}}) +{{/maxLength}}{{/minLength}}{{! +just minLength +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}) +{{/maxLength}}{{/minLength}}{{! +just maxLength +}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}) +{{/maxLength}}{{/minLength}}{{! +@Size: both minItems && maxItems +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}}, max={{maxItems}}) +{{/maxItems}}{{/minItems}}{{! +@Size: just minItems +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}) +{{/maxItems}}{{/minItems}}{{! +@Size: just maxItems +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}) +{{/maxItems}}{{/minItems}}{{! +@Email +}}{{#isEmail}} @Email +{{/isEmail}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{minimum}}) +{{/minimum}}{{#maximum}} @Max({{maximum}}) +{{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L) +{{/minimum}}{{#maximum}} @Max({{maximum}}L) +{{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{! +minimum for decimal value +}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}}, inclusive=false{{/exclusiveMinimum}}) +{{/minimum}}{{! +maximal for decimal value +}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}}, inclusive=false{{/exclusiveMaximum}}) +{{/maximum}}{{! +close decimal values +}}{{/isLong}}{{/isInteger}}{{/useBeanValidation}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache new file mode 100644 index 00000000000..6421884f47d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/jackson_annotations.mustache @@ -0,0 +1,26 @@ +{{! + If this is map and items are nullable, make sure that nulls are included. + To determine what JsonInclude.Include method to use, consider the following: + * If the field is required, always include it, even if it is null. + * Else use custom behaviour, IOW use whatever is defined on the object mapper + }} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) + {{#withXml}} + {{^isContainer}} + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isContainer}} + {{#isContainer}} + {{#isXmlWrapped}} + // items.xmlName={{items.xmlName}} + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") + {{/isXmlWrapped}} + {{/isContainer}} + {{/withXml}} + {{#isDateTime}} + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + {{/isDateTime}} + {{#isDate}} + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + {{/isDate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/model.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/model.mustache similarity index 91% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/model.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/model.mustache index d9bf0572982..f3119818d38 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/model.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/model.mustache @@ -1,4 +1,4 @@ -{{>licenseInfo}} +{{>common/licenseInfo}} package {{package}}; {{#useReflectionEqualsHashCode}} @@ -34,14 +34,14 @@ import javax.annotation.Generated; {{#models}} {{#model}} {{#isEnum}} -{{>model/modelEnum}} +{{>common/model/modelEnum}} {{/isEnum}} {{^isEnum}} {{#vendorExtensions.x-is-one-of-interface}} -{{>model/oneof_interface}} +{{>common/model/oneof_interface}} {{/vendorExtensions.x-is-one-of-interface}} {{^vendorExtensions.x-is-one-of-interface}} -{{>model/pojo}} +{{>common/model/pojo}} {{/vendorExtensions.x-is-one-of-interface}} {{/isEnum}} {{/model}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelEnum.mustache similarity index 52% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelInnerEnum.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelEnum.mustache index cd49673d015..a2e0f03ade0 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelEnum.mustache @@ -1,14 +1,15 @@ - /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} - */ -{{#withXml}} - @XmlType(name="{{datatypeWithEnum}}") - @XmlEnum({{dataType}}.class) -{{/withXml}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} + +/** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + */ {{#additionalEnumTypeAnnotations}} - {{{.}}} -{{/additionalEnumTypeAnnotations}} - public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { +{{{.}}} +{{/additionalEnumTypeAnnotations}}{{#useBeanValidation}}@Introspected +{{/useBeanValidation}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{#enumDescription}} @@ -25,36 +26,36 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { - this.value = value; + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; } {{#jackson}} @JsonValue {{/jackson}} public {{{dataType}}} getValue() { - return value; + return value; } @Override public String toString() { - return String.valueOf(value); + return String.valueOf(value); } {{#jackson}} @JsonCreator {{/jackson}} public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { - return b; + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } } - } {{#isNullable}} - return null; + return null; {{/isNullable}} {{^isNullable}} - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); {{/isNullable}} } - } \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache new file mode 100644 index 00000000000..9a1567a0ca5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/modelInnerEnum.mustache @@ -0,0 +1,60 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + */ +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} +{{#additionalEnumTypeAnnotations}} + {{{.}}} +{{/additionalEnumTypeAnnotations}} + public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{enumDescription}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + {{#jackson}} + @JsonValue + {{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + {{#jackson}} + @JsonCreator + {{/jackson}} + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}} + return null; + {{/isNullable}} + {{^isNullable}} + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + {{/isNullable}} + } + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/oneof_interface.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/oneof_interface.mustache similarity index 77% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/oneof_interface.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/oneof_interface.mustache index ca0a063d6d8..33c3d6530fe 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/oneof_interface.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/oneof_interface.mustache @@ -1,7 +1,7 @@ {{#additionalModelTypeAnnotations}} {{{.}}} {{/additionalModelTypeAnnotations}} -{{>generatedAnnotation}}{{>model/typeInfoAnnotation}}{{>model/xmlAnnotation}} +{{>common/generatedAnnotation}}{{>common/model/typeInfoAnnotation}}{{>common/model/xmlAnnotation}} public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#discriminator}} public {{propertyType}} {{propertyGetter}}(); diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache new file mode 100644 index 00000000000..8711f3f6dc7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache @@ -0,0 +1,342 @@ +/** + * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + */ +{{#description}} +@ApiModel(description = "{{{description}}}") +{{/description}} +{{#jackson}} +@JsonPropertyOrder({ + {{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} + {{/vars}} +}) +@JsonTypeName("{{name}}") +{{/jackson}} +{{#additionalModelTypeAnnotations}} +{{{.}}} +{{/additionalModelTypeAnnotations}} +{{>common/generatedAnnotation}}{{#discriminator}}{{>common/model/typeInfoAnnotation}}{{/discriminator}}{{>common/model/xmlAnnotation}}{{#useBeanValidation}} +@Introspected +{{/useBeanValidation}}{{! +Declare the class with extends and implements +}}public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ + {{#serializableModel}} + private static final long serialVersionUID = 1L; + + {{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>common/model/modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>common/model/modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{#withXml}} + {{#isXmlAttribute}} + @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}" + {{/isXmlAttribute}} + {{^isXmlAttribute}} + {{^isContainer}} + @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isContainer}} + {{#isContainer}} + // Is a container wrapped={{isXmlWrapped}} + {{#items}} + // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} + // items.example={{example}} items.type={{dataType}} + @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/items}} + {{#isXmlWrapped}} + @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isXmlWrapped}} + {{/isContainer}} + {{/isXmlAttribute}} + {{/withXml}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{/isContainer}} + {{^isContainer}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + {{#requiredPropertiesInConstructor}} + public {{classname}}({{#requiredVars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) { + {{#parent}} + super({{#vendorExtensions.requiredParentVars}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.requiredParentVars}}); + {{/parent}} + {{#vendorExtensions.requiredVars}} + this.{{name}} = {{name}}; + {{/vendorExtensions.requiredVars}} + } + + {{/requiredPropertiesInConstructor}} + {{^requiredPropertiesInConstructor}} + public {{classname}}() { + {{#parent}} + super(); + {{/parent}} + } + {{/requiredPropertiesInConstructor}} + {{#vars}} + {{^isReadOnly}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + + {{#isArray}} + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} + this.{{name}}.add({{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{/isArray}} + {{#isMap}} + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} + this.{{name}}.put(key, {{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{/isMap}} + {{/isReadOnly}} + /** + {{#description}} + * {{description}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{minimum}} + {{/minimum}} + {{#maximum}} + * maximum: {{maximum}} + {{/maximum}} + * @return {{name}} + **/ +{{>common/model/beanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + {{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} + {{/vendorExtensions.x-extra-annotation}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#jackson}} +{{>common/model/jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isReadOnly}} +{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + return {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{>common/model/jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} this.{{name}} = {{name}}; + } + + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^isReadOnly}} + {{#jackson}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} +{{>common/model/jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}}{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{/isReadOnly}} + {{/vars}} + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + {{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && + {{/-last}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}}; + {{/hasVars}} + {{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}}; + {{/hasVars}} + {{/useReflectionEqualsHashCode}} + } + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + {{/useReflectionEqualsHashCode}} + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + {{#parcelableModel}} + public void writeToParcel(Parcel out, int flags) { + {{#model}} + {{#isArray}} + out.writeList(this); + {{/isArray}} + {{^isArray}} + {{#parent}} + super.writeToParcel(out, flags); + {{/parent}} + {{#vars}} + out.writeValue({{name}}); + {{/vars}} + {{/isArray}} + {{/model}} + } + + {{classname}}(Parcel in) { + {{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); + {{/isArray}} + {{^isArray}} + {{#parent}} + super(in); + {{/parent}} + {{#vars}} + {{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); + {{/isPrimitiveType}} + {{/vars}} + {{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { + {{#model}} + {{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; + {{/isArray}} + {{^isArray}} + return new {{classname}}(in); + {{/isArray}} + {{/model}} + } + + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; + {{/parcelableModel}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/typeInfoAnnotation.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/typeInfoAnnotation.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/typeInfoAnnotation.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/model/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/model/xmlAnnotation.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/model/xmlAnnotation.mustache diff --git a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/params/beanValidation.mustache similarity index 82% rename from modules/openapi-generator/src/main/resources/java-micronaut-client/params/beanValidation.mustache rename to modules/openapi-generator/src/main/resources/java-micronaut/common/params/beanValidation.mustache index 6fd7a75b066..8b625ef1b93 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut-client/params/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/params/beanValidation.mustache @@ -1,8 +1,11 @@ -{{#useBeanValidation}}{{! +{{!First handle the nullable - it should be present unless otherwise specified}} +{{#isNullable}}@Nullable {{/isNullable}}{{^isNullable}}{{^required}}@Nullable {{/required}}{{/isNullable}}{{! +All the validation +}}{{#useBeanValidation}}{{! +nullable overrides required +}}{{^isNullable}}{{#required}}@NotNull {{/required}}{{/isNullable}}{{! validate all pojos and enums }}{{^isContainer}}{{#isModel}}@Valid {{/isModel}}{{/isContainer}}{{! -nullable & nonnull -}}{{#required}}@NotNull {{/required}}{{#isNullable}}@Nullable {{/isNullable}}{{! pattern }}{{#pattern}}{{^isByteArray}}@Pattern(regexp="{{{pattern}}}") {{/isByteArray}}{{/pattern}}{{! both minLength && maxLength @@ -18,7 +21,7 @@ just maxLength @Size: just maxItems }}{{^minItems}}{{#maxItems}}@Size(max={{maxItems}}) {{/maxItems}}{{/minItems}}{{! @Email -}}{{#isEmail}}@Email{{/isEmail}}{{! +}}{{#isEmail}}@Email {{/isEmail}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}}@Min({{minimum}}) {{/minimum}}{{#maximum}}@Max({{maximum}}) {{/maximum}}{{/isInteger}}{{! diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache new file mode 100644 index 00000000000..fb94253573c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.groovy.mustache @@ -0,0 +1,46 @@ +package {{package}} + +{{#imports}}import {{import}} +{{/imports}} +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject +{{#fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * Model tests for {{classname}} + */ +@MicronautTest +public class {{classname}}Spec extends Specification { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = null + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + void '{{classname}} test'() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + void '{{classname}} property {{name}} test'() { + // TODO: test {{name}} property of {{classname}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache new file mode 100644 index 00000000000..2a49ac94670 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/test/model_test.mustache @@ -0,0 +1,49 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import io.micronaut.test.extensions.junit5.annotation.MicronautTest; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +{{#fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * Model tests for {{classname}} + */ +@MicronautTest +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = null; + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache new file mode 100644 index 00000000000..f1affde0c26 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/controller.mustache @@ -0,0 +1,129 @@ +{{>common/licenseInfo}} +package {{apiPackage}}; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +{{#useAuth}} +import io.micronaut.security.annotation.Secured; +import io.micronaut.security.rules.SecurityRule; +{{/useAuth}} +import reactor.core.publisher.Mono; +{{#imports}} +import {{import}}; +{{/imports}} +import javax.annotation.Generated; +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{#generateControllerFromExamples}} +import java.util.Arrays; +{{/generateControllerFromExamples}} +{{/fullJavaUtil}} +{{#useBeanValidation}} +import javax.validation.Valid; +import javax.validation.constraints.*; +{{/useBeanValidation}} +import io.swagger.annotations.*; + +{{>common/generatedAnnotation}} +{{^generateControllerAsAbstract}} +@Controller("${context-path}") +{{/generateControllerAsAbstract}} +public {{#generateControllerAsAbstract}}abstract {{/generateControllerAsAbstract}}class {{classname}} { +{{#operations}} + {{#operation}} + /** + {{#summary}} + * {{summary}} + {{/summary}} + {{#notes}} + * {{notes}} + {{/notes}} + {{^summary}} + {{^notes}} + * {{nickname}} + {{/notes}} + {{/summary}} + * + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{!openapi annotations for info}} + @ApiOperation( + value = "{{{summary}}}", + nickname = "{{{operationId}}}"{{#notes}}, + notes = "{{{notes}}}"{{/notes}}{{#returnBaseType}}, + response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, + responseContainer = "{{{returnContainer}}}"{{/returnContainer}}, + authorizations = {{openbrace}}{{#hasAuthMethods}} + {{#authMethods}} + {{#isOAuth}} + @Authorization(value = "{{name}}"{{#scopes}}{{#-first}}, scopes = { + {{#scopes}} + @AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}} + {{/scopes}} + }{{/-first}}{{/scopes}}){{^-last}},{{/-last}} + {{/isOAuth}} + {{^isOAuth}} + @Authorization(value = "{{name}}"){{^-last}},{{/-last}} + {{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}}{{closebrace}}, + tags={{openbrace}}{{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}}{{closebrace}}) + {{!openapi annotations for info about responses}} + @ApiResponses(value = {{openbrace}}{{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}{{closebrace}}) + {{!micronaut annotations}} + @{{#lambda.pascalcase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.pascalcase}}(uri="{{{path}}}") + @Produces(value = {{openbrace}}{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}{{closebrace}}) + {{#consumes.0}} + @Consumes(value = {{openbrace}}{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}{{closebrace}}) + {{/consumes.0}} + {{!security annotations}} + {{#useAuth}} + {{#hasAuthMethods}} + @Secured(SecurityRule.IS_AUTHENTICATED) + {{/hasAuthMethods}} + {{^hasAuthMethods}} + @Secured(SecurityRule.IS_ANONYMOUS) + {{/hasAuthMethods}} + {{/useAuth}} + {{!the method definition}} + public {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}{{#generateControllerAsAbstract}}Api{{/generateControllerAsAbstract}}({{#allParams}} + {{>server/params/queryParams}}{{>server/params/pathParams}}{{>server/params/headerParams}}{{>server/params/bodyParams}}{{>server/params/formParams}}{{>server/params/cookieParams}}{{^-last}}, {{/-last}}{{#-last}} + {{/-last}}{{/allParams}}) { + {{^generateControllerAsAbstract}} +{{>server/controllerOperationBody}} } + {{/generateControllerAsAbstract}} + {{#generateControllerAsAbstract}} + return {{nickname}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/generateControllerAsAbstract}} + {{#generateControllerAsAbstract}} + + /** + {{#summary}} + * {{summary}} + {{/summary}} + * + * This method will be delegated to when the controller gets a request + */ + public abstract {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/generateControllerAsAbstract}} + {{^-last}} + + {{/-last}} + {{/operation}} +{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache new file mode 100644 index 00000000000..91e582a17b5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerImplementation.mustache @@ -0,0 +1,34 @@ +{{>common/licenseInfo}} +package {{controllerPackage}}; + +import io.micronaut.http.annotation.Controller; +import reactor.core.publisher.Mono; +import {{package}}.{{classname}}; +{{#imports}} +import {{import}}; +{{/imports}} +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{#generateControllerFromExamples}} +import java.util.Arrays; +{{/generateControllerFromExamples}} +{{/fullJavaUtil}} + + +@Controller("${context-path}") +public class {{controllerClassname}} extends {{classname}} { +{{#operations}} + {{#operation}} + {{!the method definition}} + @Override + public {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { +{{>server/controllerOperationBody}} } + {{^-last}} + + {{/-last}} + {{/operation}} +{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache new file mode 100644 index 00000000000..fc374fe0993 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/controllerOperationBody.mustache @@ -0,0 +1,17 @@ + {{^generateControllerFromExamples}} + {{!The body needs to be implemented by user}} + // TODO implement {{nickname}}() body; + {{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} result = Mono.empty(); + return result; + {{/generateControllerFromExamples}} + {{#generateControllerFromExamples}} + {{!The body is generated to verify that example values are passed correctly}} + {{#allParams}} + {{^isFile}} + {{{dataType}}} {{paramName}}Expected = {{{example}}}; + assert {{paramName}}.equals({{paramName}}Expected) : "The parameter {{paramName}} was expected to match its example value"; + {{/isFile}} + {{/allParams}} + + return Mono.fromCallable(() -> {{^returnType}}""{{/returnType}}{{#returnType}}{{#vendorExtensions.example}}{{{vendorExtensions.example}}}{{/vendorExtensions.example}}{{^vendorExtensions.example}}null{{/vendorExtensions.example}}{{/returnType}}); + {{/generateControllerFromExamples}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache new file mode 100644 index 00000000000..64887480031 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/README.mustache @@ -0,0 +1,27 @@ +# {{artifactId}} + +This is a generated server based on [Micronaut](https://micronaut.io/) framework. + +## Configuration + +To run the whole application, use [Application.java]({{{invokerFolder}}}/Application.java) as main class. + +Read **[Micronaut Guide](https://docs.micronaut.io/latest/guide/#ideSetup)** for detailed description on IDE setup and Micronaut Framework features. + +All the properties can be changed in the [application.yml]({{resourceFolder}}/application.yml) file or when creating micronaut application as described in **[Micronaut Guide - Configuration Section](https://docs.micronaut.io/latest/guide/#config)**. + +## Controller Guides + +Description on how to create Apis is given inside individual api guides: + +{{#apiInfo}} + {{#apis}} +* [{{classFilename}}]({{apiDocPath}}/{{classFilename}}.md) + {{/apis}} +{{/apiInfo}} + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} + diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache new file mode 100644 index 00000000000..80d49233c56 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/doc/controller_doc.mustache @@ -0,0 +1,63 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to `"{{contextPath}}"` + +The controller class is defined in **[{{classname}}.java](../../{{{apiFolder}}}/{{classname}}.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}} + {{#operation}} +[**{{operationId}}**](#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} + {{/operation}} +{{/operations}} + +{{#operations}} + {{#operation}} + +# **{{operationId}}** +```java +{{#returnType}}Mono<{{{returnType}}}>{{/returnType}}{{^returnType}}Mono{{/returnType}} {{classname}}.{{nickname}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) +``` + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + +{{#allParams}} + {{#-last}} +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +{{#allParams}} +**{{paramName}}** | {{^isPrimitiveType}}[**{{dataType}}**](../../{{modelDocPath}}/{{baseType}}.md){{/isPrimitiveType}}{{#isPrimitiveType}}`{{dataType}}`{{/isPrimitiveType}} | {{description}} |{{^required}} [optional parameter]{{/required}}{{#defaultValue}} [default to `{{defaultValue}}`]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}`{{{.}}}`{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + {{/-last}} +{{/allParams}} + +{{#returnType}} +### Return type + {{#returnTypeIsPrimitive}} +`{{returnType}}` + {{/returnTypeIsPrimitive}} + {{^returnTypeIsPrimitive}} +[**{{returnType}}**](../../{{modelDocPath}}/{{returnBaseType}}.md) + {{/returnTypeIsPrimitive}} +{{/returnType}} + +{{#authMethods}} + {{#-last}} +### Authorization + {{#authMethods}} +* **{{name}}**{{#scopes}}{{#-last}}, scopes: {{#scopes}}`{{{scope}}}`{{^-last}}, {{/-last}}{{/scopes}}{{/-last}}{{/scopes}} + {{/authMethods}} + {{/-last}} +{{/authMethods}} + +### HTTP request headers + - **Accepts Content-Type**: {{#consumes}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Produces Content-Type**: {{#produces}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + + {{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache new file mode 100644 index 00000000000..80bca1989f6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/bodyParams.mustache @@ -0,0 +1,7 @@ +{{#isBodyParam}}{{! +Multi part +}}{{#isMultipart}}@Part("{{baseName}}"){{/isMultipart}}{{! +Non-multipart body +}}{{^isMultipart}}@Body{{/isMultipart}}{{! +The type +}} {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache new file mode 100644 index 00000000000..be25ae2174c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieValue(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{defaultValue}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache new file mode 100644 index 00000000000..22c02d391bd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache new file mode 100644 index 00000000000..1cb2c90a910 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@Header(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache new file mode 100644 index 00000000000..4e2fd4c2e1a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}@PathVariable(value="{{baseName}}"{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache new file mode 100644 index 00000000000..0ba7b460614 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}@QueryValue(value="{{{baseName}}}"{{!default value}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{!validation and type}}{{>common/params/beanValidation}}{{>server/params/type}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache new file mode 100644 index 00000000000..4d51aec1c95 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/params/type.mustache @@ -0,0 +1,7 @@ +{{! +default type +}}{{^isDate}}{{^isDateTime}}{{{dataType}}}{{/isDateTime}}{{/isDate}}{{! +date-time +}}{{#isDateTime}}@Format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") {{{dataType}}}{{/isDateTime}}{{! +date +}}{{#isDate}}@Format("yyyy-MM-dd") {{{dataType}}}{{/isDate}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache new file mode 100644 index 00000000000..44c0730cb99 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.groovy.mustache @@ -0,0 +1,185 @@ +package {{package}} + +{{#imports}} +import {{import}} +{{/imports}} +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import io.micronaut.http.client.HttpClient +import io.micronaut.http.client.annotation.Client +import io.micronaut.runtime.server.EmbeddedServer +import io.micronaut.http.HttpStatus +import io.micronaut.http.HttpRequest +import io.micronaut.http.MutableHttpRequest; +import io.micronaut.http.HttpResponse +import io.micronaut.http.MediaType +import io.micronaut.http.uri.UriTemplate +import io.micronaut.http.cookie.Cookie +import io.micronaut.http.client.multipart.MultipartBody +import io.micronaut.core.type.Argument +import jakarta.inject.Inject +import spock.lang.Specification +import spock.lang.Ignore +import reactor.core.publisher.Mono +import java.io.File +import java.io.FileReader + + +/** + * Controller tests for {{classname}} + */ +@MicronautTest +class {{classname}}Spec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + {{classname}} controller + + {{#operations}} + {{#operation}} + /** + * This test is used to validate the implementation of {{operationId}}() method + * + * The method should: {{summary}} + {{#notes}} + * + * {{notes}} + {{/notes}} + * + * TODO fill in the parameters and test return value. + */ + {{^generateControllerFromExamples}} + @Ignore("Not Implemented") + {{/generateControllerFromExamples}} + def '{{operationId}}() method test'() { + given: + {{#allParams}} + {{{dataType}}} {{paramName}} = {{{vendorExtensions.groovyExample}}} + {{/allParams}} + + when: + {{#returnType}}{{{returnType}}} result = {{/returnType}}controller.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block() + + then: + {{^generateControllerFromExamples}} + true + {{/generateControllerFromExamples}} + {{#generateControllerFromExamples}} + {{^returnType}} + true + {{/returnType}} + {{#returnType}} + result == {{{vendorExtensions.groovyExample}}} + {{/returnType}} + {{/generateControllerFromExamples}} + } + + /** + * This test is used to check that the api available to client through + * '{{{path}}}' to the features of {{operationId}}() works as desired. + * + * TODO fill in the request parameters and test response. + */ + {{^generateControllerFromExamples}} + @Ignore("Not Implemented") + {{/generateControllerFromExamples}} + def '{{operationId}}() test with client through path {{{path}}}'() { + given: + {{!Create the body}} + {{#bodyParam}} + {{{dataType}}} body = {{{vendorExtensions.groovyExample}}} + {{/bodyParam}} + {{#formParams.0}} + var form = [ + // Fill in the body form parameters + {{#formParams}} + {{^isFile}} + '{{{baseName}}}': {{{vendorExtensions.groovyExample}}}{{^-last}},{{/-last}} + {{/isFile}} + {{#isFile}} + '{{{baseName}}}': new FileReader(File.createTempFile('test', '.tmp')){{^-last}},{{/-last}} + {{/isFile}} + {{/formParams}} + ] + {{/formParams.0}} + {{#isMultipart}} + {{^formParams}} + var body = MultipartBody.builder() // Create multipart body + {{#bodyParams}} + {{^isFile}} + .addPart('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}{{^isString}}.toString(){{/isString}}) + {{/isFile}} + {{#isFile}} + {{#contentType}} + .addPart('{{{baseName}}}', 'filename', MediaType.of('{{{contentType}}}'), File.createTempFile('test', '.tmp')) + {{/contentType}} + {{^contentType}} + .addPart('{{{baseName}}}', 'filename', File.createTempFile('test', '.tmp')) + {{/contentType}} + {{/isFile}} + {{/bodyParams}} + .build() + {{/formParams}} + {{/isMultipart}} + {{!Create the uri with path variables}} + var uri = UriTemplate.of('{{{path}}}').expand({{^pathParams}}[:]{{/pathParams}}{{#pathParams.0}}[ + // Fill in the path variables + {{#pathParams}} + '{{{baseName}}}': {{{vendorExtensions.groovyExample}}}{{^-last}},{{/-last}} + {{/pathParams}} + ]{{/pathParams.0}}) + {{!Create the request with body and uri}} + MutableHttpRequest request = HttpRequest.{{httpMethod}}{{#vendorExtensions.methodAllowsBody}}{{#bodyParam}}(uri, body){{/bodyParam}}{{#isMultipart}}{{^formParams}}(uri, body){{/formParams}}{{/isMultipart}}{{#formParams.0}}(uri, form){{/formParams.0}}{{^bodyParam}}{{^isMultipart}}{{^formParams}}(uri, null){{/formParams}}{{/isMultipart}}{{/bodyParam}}{{/vendorExtensions.methodAllowsBody}}{{^vendorExtensions.methodAllowsBody}}(uri){{/vendorExtensions.methodAllowsBody}} + {{!Fill in all the request parameters}} + {{#vendorExtensions.x-contentType}} + .contentType('{{vendorExtensions.x-contentType}}') + {{/vendorExtensions.x-contentType}} + {{#vendorExtensions.x-accepts}} + .accept('{{vendorExtensions.x-accepts}}') + {{/vendorExtensions.x-accepts}} + {{#headerParams}} + .header('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}{{^isString}}.toString(){{/isString}}) + {{/headerParams}} + {{#cookieParams}} + .cookie(Cookie.of('{{{baseName}}}', {{{vendorExtensions.groovyExample}}})) + {{/cookieParams}} + {{!Fill in the query parameters}} + {{#queryParams.0}} + request.getParameters() + {{#queryParams}} + {{#isCollectionFormatMulti}} + .add('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}) // The query format should be multi + {{/isCollectionFormatMulti}} + {{#isDeepObject}} + .add('{{{baseName}}}[property]', 'value') // The query format should be deep-object + {{/isDeepObject}} + {{^isCollectionFormatMulti}} + {{^isDeepObject}} + .add('{{{baseName}}}', {{{vendorExtensions.groovyExample}}}{{^isString}}.toString(){{/isString}}){{#collectionFormat}} // The query parameter format should be {{collectionFormat}}{{/collectionFormat}} + {{/isDeepObject}} + {{/isCollectionFormatMulti}} + {{/queryParams}} + {{/queryParams.0}} + + when: + HttpResponse response = client.toBlocking().exchange(request{{#returnType}}, {{#returnContainer}}Argument.of({{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}.class, {{#isMap}}String.class, {{/isMap}}{{{returnBaseType}}}.class){{/returnContainer}}{{^returnContainer}}{{{returnType}}}.class{{/returnContainer}}{{/returnType}});{{^returnType}} // To retrieve body you must specify required type (e.g. Map.class) as second argument {{/returnType}} + + then: + response.status() == HttpStatus.OK + {{#generateControllerFromExamples}} + {{#returnType}} + {{#vendorExtensions.example}} + response.body() == {{{vendorExtensions.groovyExample}}} + {{/vendorExtensions.example}} + {{/returnType}} + {{/generateControllerFromExamples}} + } + + {{/operation}} + {{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache new file mode 100644 index 00000000000..2e34bd72124 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-micronaut/server/test/controller_test.mustache @@ -0,0 +1,185 @@ +package {{package}}; + +{{#imports}} +import {{import}}; +{{/imports}} +import io.micronaut.test.extensions.junit5.annotation.MicronautTest; +import io.micronaut.http.client.HttpClient; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.runtime.server.EmbeddedServer; +import io.micronaut.http.HttpStatus; +import io.micronaut.http.MutableHttpRequest; +import io.micronaut.http.HttpRequest; +import io.micronaut.http.HttpResponse; +import io.micronaut.http.MediaType; +import io.micronaut.http.uri.UriTemplate; +import io.micronaut.http.cookie.Cookie; +import io.micronaut.http.client.multipart.MultipartBody; +import io.micronaut.core.type.Argument; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; +import jakarta.inject.Inject; +import reactor.core.publisher.Mono; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +{{^fullJavaUtil}} +import java.util.Arrays; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.HashSet; +{{/fullJavaUtil}} + + +/** + * API tests for {{classname}} + */ +@MicronautTest +public class {{classname}}Test { + + @Inject + EmbeddedServer server; + + @Inject + @Client("${context-path}") + HttpClient client; + + @Inject + {{classname}} controller; + + {{#operations}} + {{#operation}} + /** + * This test is used to validate the implementation of {{operationId}}() method + * + * The method should: {{summary}} + {{#notes}} + * + * {{notes}} + {{/notes}} + * + * TODO fill in the parameters and test return value. + */ + @Test + {{^generateControllerFromExamples}} + @Disabled("Not Implemented") + {{/generateControllerFromExamples}} + void {{operationId}}MethodTest() { + // given + {{#allParams}} + {{{dataType}}} {{paramName}} = {{{example}}}; + {{/allParams}} + + // when + {{#returnType}}{{{returnType}}} result = {{/returnType}}controller.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).block(); + + // then + {{^generateControllerFromExamples}} + Assertions.assertTrue(true); + {{/generateControllerFromExamples}} + {{#generateControllerFromExamples}} + {{#returnType}} + {{#vendorExtensions.example}} + Assertions.assertEquals(result, {{{vendorExtensions.example}}}); + {{/vendorExtensions.example}} + {{/returnType}} + {{/generateControllerFromExamples}} + } + + /** + * This test is used to check that the api available to client through + * '{{{path}}}' to the features of {{operationId}}() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Test + {{^generateControllerFromExamples}} + @Disabled("Not Implemented") + {{/generateControllerFromExamples}} + void {{operationId}}ClientApiTest() throws IOException { + // given + {{!Create the body}} + {{#bodyParam}} + {{{dataType}}} body = {{{example}}}; + {{/bodyParam}} + {{#formParams.0}} + Map form = new HashMap(){{openbrace}}{{openbrace}} + // Fill in the body form parameters + {{#formParams}} + {{^isFile}} + put("{{{baseName}}}", {{{example}}}); + {{/isFile}} + {{#isFile}} + put("{{{baseName}}}", new FileReader(File.createTempFile("test", ".tmp"))); + {{/isFile}} + {{/formParams}} + {{closebrace}}{{closebrace}}; + {{/formParams.0}} + {{#isMultipart}} + {{^formParams}} + MultipartBody body = MultipartBody.builder() // Create multipart body + {{#bodyParams}} + {{^isFile}} + .addPart("{{{baseName}}}", {{^isString}}String.valueOf({{/isString}}{{{example}}}{{^isString}}){{/isString}}) + {{/isFile}} + {{#isFile}} + {{#contentType}} + .addPart("{{{baseName}}}", "filename", MediaType.of("{{{contentType}}}"), File.createTempFile("test", ".tmp")) + {{/contentType}} + {{^contentType}} + .addPart("{{{baseName}}}", "filename", File.createTempFile("test", ".tmp")) + {{/contentType}} + {{/isFile}} + {{/bodyParams}} + .build(); + {{/formParams}} + {{/isMultipart}} + {{!Create the uri with path variables}} + String uri = UriTemplate.of("{{{path}}}").expand(new HashMap{{^pathParams}}<>(){{/pathParams}}{{#pathParams.0}}(){{openbrace}}{{openbrace}} + // Fill in the path variables + {{#pathParams}} + put("{{{baseName}}}", {{{example}}}); + {{/pathParams}} + {{closebrace}}{{closebrace}}{{/pathParams.0}}); + {{!Create the request with body and uri}} + MutableHttpRequest request = HttpRequest.{{httpMethod}}{{#vendorExtensions.methodAllowsBody}}{{#bodyParam}}(uri, body){{/bodyParam}}{{#isMultipart}}{{^formParams}}(uri, body){{/formParams}}{{/isMultipart}}{{#formParams.0}}(uri, form){{/formParams.0}}{{^bodyParam}}{{^isMultipart}}{{^formParams}}(uri, null){{/formParams}}{{/isMultipart}}{{/bodyParam}}{{/vendorExtensions.methodAllowsBody}}{{^vendorExtensions.methodAllowsBody}}(uri){{/vendorExtensions.methodAllowsBody}}{{!Fill in all the request parameters}}{{#vendorExtensions.x-contentType}} + .contentType("{{vendorExtensions.x-contentType}}"){{/vendorExtensions.x-contentType}}{{#vendorExtensions.x-accepts}} + .accept("{{vendorExtensions.x-accepts}}"){{/vendorExtensions.x-accepts}}{{#headerParams}} + .header("{{{baseName}}}", {{^isString}}String.valueOf({{/isString}}{{{example}}}{{^isString}}){{/isString}}){{/headerParams}}{{#cookieParams}} + .cookie(Cookie.of("{{{baseName}}}", {{{example}}})){{/cookieParams}}; + {{!Fill in the query parameters}} + {{#queryParams.0}} + request.getParameters() + {{#queryParams}} + {{#isCollectionFormatMulti}} + .add("{{{baseName}}}", {{{example}}}){{#-last}};{{/-last}} // The query format should be multi + {{/isCollectionFormatMulti}} + {{#isDeepObject}} + .add("{{{baseName}}}[property]", "value"){{#-last}};{{/-last}} // The query format should be deep-object + {{/isDeepObject}} + {{^isCollectionFormatMulti}} + {{^isDeepObject}} + .add("{{{baseName}}}", {{^isString}}String.valueOf({{/isString}}{{{example}}}{{^isString}}){{/isString}}){{#-last}};{{/-last}} // The query parameter format should be {{collectionFormat}} + {{/isDeepObject}} + {{/isCollectionFormatMulti}} + {{/queryParams}} + {{/queryParams.0}} + + // when + HttpResponse response = client.toBlocking().exchange(request{{#returnType}}, {{#returnContainer}}Argument.of({{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}.class, {{#isMap}}String.class, {{/isMap}}{{{returnBaseType}}}.class){{/returnContainer}}{{^returnContainer}}{{{returnType}}}.class{{/returnContainer}}{{/returnType}});{{^returnType}} // To retrieve body you must specify required type (e.g. Map.class) as second argument {{/returnType}} + + // then + Assertions.assertEquals(HttpStatus.OK, response.status()); + {{#generateControllerFromExamples}} + {{#returnType}} + Assertions.assertEquals(response.body(), {{{vendorExtensions.example}}}); + {{/returnType}} + {{/generateControllerFromExamples}} + } + + {{/operation}} + {{/operations}} +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java new file mode 100644 index 00000000000..2241771ef6a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/AbstractMicronautCodegenTest.java @@ -0,0 +1,125 @@ +package org.openapitools.codegen.java.micronaut; + +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.parser.core.models.ParseOptions; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.languages.JavaMicronautAbstractCodegen; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.regex.Pattern; + +import static org.testng.Assert.*; + + +/** + * An abstract class with methods useful for testing + */ +public abstract class AbstractMicronautCodegenTest { + /** + * Path to a common test configuration file + */ + protected final String PETSTORE_PATH = "src/test/resources/petstore.json"; + + /** + * + * @param codegen - the code generator + * @param configPath - the path to the config starting from src/test/resources + * @param filesToGenerate - which files to generate - can be CodegenConstants.MODELS, APIS, SUPPORTING_FILES, ... + * @return - the path to the generated folder + */ + protected String generateFiles(JavaMicronautAbstractCodegen codegen, String configPath, String... filesToGenerate) { + File output = null; + try { + output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + } catch (IOException e) { + fail("Unable to create temporary directory for output"); + } + output.deleteOnExit(); + + // Create parser + String outputPath = output.getAbsolutePath().replace('\\', '/'); + OpenAPI openAPI = new OpenAPIParser() + .readLocation(configPath, null, new ParseOptions()).getOpenAPI(); + + // Configure codegen + codegen.setOutputDir(outputPath); + + // Create input + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + // Generate + DefaultGenerator generator = new DefaultGenerator(); + // by default nothing is generated + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + // set all the files user wants to generate + for (String files: filesToGenerate) { + generator.setGeneratorPropertyDefault(files, "true"); + } + + generator.opts(input).generate(); + + return outputPath + "/"; + } + + public static void assertFileContainsRegex(String path, String... regex) { + String file = readFile(path); + for (String line: regex) + assertTrue(Pattern.compile(line.replace(" ", "\\s+")).matcher(file).find()); + } + + public static void assertFileNotContainsRegex(String path, String... regex) { + String file = readFile(path); + for (String line: regex) + assertFalse(Pattern.compile(line.replace(" ", "\\s+")).matcher(file).find()); + } + + public static void assertFileContains(String path, String... lines) { + String file = linearize(readFile(path)); + for (String line : lines) + assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]"); + } + + public static void assertFileNotContains(String path, String... lines) { + String file = linearize(readFile(path)); + for (String line : lines) + assertFalse(file.contains(linearize(line)), "File contains line [" + line + "]"); + } + + public static void assertFileExists(String path) { + assertTrue(Paths.get(path).toFile().exists(), "File \"" + path + "\" should exist"); + } + + public static void assertFileNotExists(String path) { + assertFalse(Paths.get(path).toFile().exists(), "File \"" + path + "\" should not exist"); + } + + public static String readFile(String path) { + String file = null; + try { + file = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8); + assertNotNull(file, "File \"" + path + "\" does not exist"); + } catch (IOException e) { + fail("Unable to evaluate file " + path); + } + + return file; + } + + public static String linearize(String target) { + return target.replaceAll("\r?\n", "").replaceAll("\\s+", "\\s"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java index 452d38f05ec..103ae98ab1c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautClientCodegenTest.java @@ -1,31 +1,18 @@ package org.openapitools.codegen.java.micronaut; -import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.parser.core.models.ParseOptions; import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.languages.JavaMicronautClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; - import static java.util.stream.Collectors.groupingBy; import static org.testng.Assert.*; -import static org.testng.Assert.fail; -public class MicronautClientCodegenTest { - private final String PETSTORE_PATH = "src/test/resources/petstore.json"; +public class MicronautClientCodegenTest extends AbstractMicronautCodegenTest { @Test public void clientOptsUnicity() { JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); @@ -55,6 +42,31 @@ public class MicronautClientCodegenTest { Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); } + @Test + public void testApiAndModelFilesPresent() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "org.test.test"); + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "org.test.test.model"); + codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "org.test.test.api"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.SUPPORTING_FILES, + CodegenConstants.APIS, + CodegenConstants.MODELS); + + String apiFolder = outputPath + "src/main/java/org/test/test/api/"; + assertFileExists(apiFolder + "PetApi.java"); + assertFileExists(apiFolder + "StoreApi.java"); + assertFileExists(apiFolder + "UserApi.java"); + + String modelFolder = outputPath + "src/main/java/org/test/test/model/"; + assertFileExists(modelFolder + "Pet.java"); + assertFileExists(modelFolder + "User.java"); + assertFileExists(modelFolder + "Order.java"); + + String resources = outputPath + "src/main/resources/"; + assertFileExists(resources + "application.yml"); + } + @Test public void doConfigureAuthParam() { JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); @@ -85,7 +97,7 @@ public class MicronautClientCodegenTest { @Test public void doUseValidationParam() { JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); - codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_CONFIGURE_AUTH, "false"); + codegen.additionalProperties().put(JavaMicronautClientCodegen.USE_BEANVALIDATION, "true"); String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.APIS); @@ -94,6 +106,18 @@ public class MicronautClientCodegenTest { assertFileContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@NotNull"); } + @Test + public void doNotUseValidationParam() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.USE_BEANVALIDATION, "false"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.APIS); + + // Files are not generated + assertFileNotContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@Valid"); + assertFileNotContains(outputPath + "/src/main/java/org/openapitools/api/PetApi.java", "@NotNull"); + } + @Test public void doGenerateForMaven() { JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); @@ -162,89 +186,33 @@ public class MicronautClientCodegenTest { assertFileContains(outputPath + "src/test/groovy/org/openapitools/api/PetApiSpec.groovy", "PetApiSpec", "@MicronautTest"); } - /** - * - * @param codegen - the code generator - * @param configPath - the path to the config starting from src/test/resources - * @param filesToGenerate - which files to generate - can be CodegenConstants.MODELS, APIS, SUPPORTING_FILES, ... - * @return - the path to the generated folder - */ - protected String generateFiles(JavaMicronautClientCodegen codegen, String configPath, String... filesToGenerate) { - File output = null; - try { - output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - } catch (IOException e) { - fail("Unable to create temporary directory for output"); - } - output.deleteOnExit(); + @Test + public void doGenerateRequiredPropertiesInConstructor() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "true"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS); - // Create parser - String outputPath = output.getAbsolutePath().replace('\\', '/'); - OpenAPI openAPI = new OpenAPIParser() - .readLocation(configPath, null, new ParseOptions()).getOpenAPI(); - - // Configure codegen - codegen.setOutputDir(outputPath); - - // Create input - ClientOptInput input = new ClientOptInput(); - input.openAPI(openAPI); - input.config(codegen); - - // Generate - DefaultGenerator generator = new DefaultGenerator(); - // by default nothing is generated - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - // set all the files user wants to generate - for (String files: filesToGenerate) { - generator.setGeneratorPropertyDefault(files, "true"); - } - - generator.opts(input).generate(); - - return outputPath + "/"; + // Constructor should have properties + String modelPath = outputPath + "src/main/java/org/openapitools/model/"; + assertFileContains(modelPath + "Pet.java", "public Pet(String name, List photoUrls)"); + assertFileNotContains(modelPath + "Pet.java", "public Pet()"); + assertFileContains(modelPath + "User.java", "public User()"); + assertFileContains(modelPath + "Order.java", "public Order()"); } - public static void assertFileContains(String path, String... lines) { - String file = readFile(path); - for (String line : lines) - assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]"); - } + @Test + public void doNotGenerateRequiredPropertiesInConstructor() { + JavaMicronautClientCodegen codegen = new JavaMicronautClientCodegen(); + codegen.additionalProperties().put(JavaMicronautClientCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "false"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS); - public static void assertFileNotContains(String path, String... lines) { - String file = readFile(path); - for (String line : lines) - assertFalse(file.contains(linearize(line)), "File contains line [" + line + "]"); - } - - public static void assertFileExists(String path) { - assertTrue(Paths.get(path).toFile().exists(), "File \"" + path + "\" should exist"); - } - - public static void assertFileNotExists(String path) { - assertFalse(Paths.get(path).toFile().exists(), "File \"" + path + "\" should not exist"); - } - - public static String readFile(String path) { - String file = null; - try { - String generatedFile = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8); - file = linearize(generatedFile); - assertNotNull(file); - } catch (IOException e) { - fail("Unable to evaluate file " + path); - } - - return file; - } - - public static String linearize(String target) { - return target.replaceAll("\r?\n", "").replaceAll("\\s+", "\\s"); + // Constructor should have properties + String modelPath = outputPath + "src/main/java/org/openapitools/model/"; + assertFileContains(modelPath + "Pet.java", "public Pet()"); + assertFileNotContainsRegex(modelPath + "Pet.java", "public Pet\\([^)]+\\)"); + assertFileContains(modelPath + "User.java", "public User()"); + assertFileNotContainsRegex(modelPath + "User.java", "public User\\([^)]+\\)"); + assertFileContains(modelPath + "Order.java", "public Order()"); + assertFileNotContainsRegex(modelPath + "Order.java", "public Order\\([^)]+\\)"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java new file mode 100644 index 00000000000..d10d250aabc --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/micronaut/MicronautServerCodegenTest.java @@ -0,0 +1,195 @@ +package org.openapitools.codegen.java.micronaut; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.servers.Server; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.JavaMicronautServerCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +import static java.util.stream.Collectors.groupingBy; +import static org.testng.Assert.assertEquals; + +public class MicronautServerCodegenTest extends AbstractMicronautCodegenTest { + @Test + public void clientOptsUnicity() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.cliOptions() + .stream() + .collect(groupingBy(CliOption::getOpt)) + .forEach((k, v) -> assertEquals(v.size(), 1, k + " is described multiple times")); + } + + @Test + public void testInitialConfigValues() throws Exception { + final JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.processOpts(); + + OpenAPI openAPI = new OpenAPI(); + openAPI.addServersItem(new Server().url("https://one.com/v2")); + openAPI.setInfo(new Info()); + codegen.preprocessOpenAPI(openAPI); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); + Assert.assertEquals(codegen.apiPackage(), "org.openapitools.controller"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.controller"); + Assert.assertEquals(codegen.additionalProperties().get(JavaMicronautServerCodegen.OPT_CONTROLLER_PACKAGE), "org.openapitools.controller"); + Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools"); + } + + @Test + public void testApiAndModelFilesPresent() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "org.test.test"); + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "org.test.test.model"); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_CONTROLLER_PACKAGE, "org.test.test.controller"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.SUPPORTING_FILES, + CodegenConstants.APIS, + CodegenConstants.MODELS); + + String invokerFolder = outputPath + "src/main/java/org/test/test/"; + assertFileExists(invokerFolder + "Application.java"); + + String controllerFolder = outputPath + "src/main/java/org/test/test/controller/"; + assertFileExists(controllerFolder + "PetController.java"); + assertFileExists(controllerFolder + "StoreController.java"); + assertFileExists(controllerFolder + "UserController.java"); + + String modelFolder = outputPath + "src/main/java/org/test/test/model/"; + assertFileExists(modelFolder + "Pet.java"); + assertFileExists(modelFolder + "User.java"); + assertFileExists(modelFolder + "Order.java"); + + String resources = outputPath + "src/main/resources/"; + assertFileExists(resources + "application.yml"); + } + + @Test + public void doUseValidationParam() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.USE_BEANVALIDATION, "true"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.APIS); + + // Files are not generated + assertFileContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@Valid"); + assertFileContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@NotNull"); + } + + @Test + public void doNotUseValidationParam() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.USE_BEANVALIDATION, "false"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.APIS); + + // Files are not generated + assertFileNotContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@Valid"); + assertFileNotContains(outputPath + "/src/main/java/org/openapitools/controller/PetController.java", "@NotNull"); + } + + @Test + public void doGenerateForMaven() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD, + JavaMicronautServerCodegen.OPT_BUILD_MAVEN); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.SUPPORTING_FILES); + + // Files are not generated + assertFileExists(outputPath + "/pom.xml"); + assertFileNotExists(outputPath + "/build.gradle"); + } + + @Test + public void doGenerateForGradle() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD, + JavaMicronautServerCodegen.OPT_BUILD_GRADLE); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.SUPPORTING_FILES); + + // Files are not generated + assertFileExists(outputPath + "/build.gradle"); + assertFileNotExists(outputPath + "/pom.xml"); + } + + @Test + public void doGenerateForTestJUnit() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD, + JavaMicronautServerCodegen.OPT_BUILD_ALL); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_TEST, + JavaMicronautServerCodegen.OPT_TEST_JUNIT); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.SUPPORTING_FILES, + CodegenConstants.API_TESTS, CodegenConstants.APIS, CodegenConstants.MODELS); + + // Files are not generated + assertFileContains(outputPath + "build.gradle", "testRuntime(\"junit"); + assertFileContains(outputPath + "pom.xml", "micronaut-test-junit"); + assertFileNotContains(outputPath + "build.gradle", "testRuntime(\"spock"); + assertFileNotContains(outputPath + "pom.xml", "micronaut-test-spock"); + assertFileExists(outputPath + "src/test/java/"); + assertFileExists(outputPath + "src/test/java/org/openapitools/controller/PetControllerTest.java"); + assertFileContains(outputPath + "src/test/java/org/openapitools/controller/PetControllerTest.java", "PetControllerTest", "@MicronautTest"); + } + + @Test + public void doGenerateForTestSpock() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_BUILD, + JavaMicronautServerCodegen.OPT_BUILD_ALL); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_TEST, + JavaMicronautServerCodegen.OPT_TEST_SPOCK); + String outputPath = generateFiles(codegen, PETSTORE_PATH, + CodegenConstants.SUPPORTING_FILES, + CodegenConstants.API_TESTS, CodegenConstants.APIS, CodegenConstants.MODELS); + + // Files are not generated + assertFileNotContains(outputPath + "build.gradle", "testRuntime(\"junit"); + assertFileNotContains(outputPath + "pom.xml", "micronaut-test-junit"); + assertFileContains(outputPath + "build.gradle", "testRuntime(\"spock"); + assertFileContains(outputPath + "pom.xml", "micronaut-test-spock"); + assertFileExists(outputPath + "src/test/groovy"); + assertFileExists(outputPath + "src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy"); + assertFileContains(outputPath + "src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy", "PetControllerSpec", "@MicronautTest"); + } + + @Test + public void doGenerateRequiredPropertiesInConstructor() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "true"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS); + + // Constructor should have properties + String modelPath = outputPath + "src/main/java/org/openapitools/model/"; + assertFileContains(modelPath + "Pet.java", "public Pet(String name, List photoUrls)"); + assertFileNotContains(modelPath + "Pet.java", "public Pet()"); + assertFileContains(modelPath + "User.java", "public User()"); + assertFileContains(modelPath + "Order.java", "public Order()"); + } + + @Test + public void doNotGenerateRequiredPropertiesInConstructor() { + JavaMicronautServerCodegen codegen = new JavaMicronautServerCodegen(); + codegen.additionalProperties().put(JavaMicronautServerCodegen.OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "false"); + String outputPath = generateFiles(codegen, PETSTORE_PATH, CodegenConstants.MODELS, CodegenConstants.APIS); + + // Constructor should have properties + String modelPath = outputPath + "src/main/java/org/openapitools/model/"; + assertFileContains(modelPath + "Pet.java", "public Pet()"); + assertFileNotContainsRegex(modelPath + "Pet.java", "public Pet\\([^)]+\\)"); + assertFileContains(modelPath + "User.java", "public User()"); + assertFileNotContainsRegex(modelPath + "User.java", "public User\\([^)]+\\)"); + assertFileContains(modelPath + "Order.java", "public Order()"); + assertFileNotContainsRegex(modelPath + "Order.java", "public Order\\([^)]+\\)"); + } +} diff --git a/pom.xml b/pom.xml index 06f87b9cb43..94336ceb9a2 100644 --- a/pom.xml +++ b/pom.xml @@ -735,6 +735,18 @@ samples/client/petstore/java-micronaut-client + + java-micronaut-server + + + env + java + + + + samples/server/petstore/java-micronaut-server + + java-msf4j-server diff --git a/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES b/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES index 22a29a5113b..d5036a847b5 100644 --- a/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES +++ b/samples/client/petstore/java-micronaut-client/.openapi-generator/FILES @@ -4,61 +4,61 @@ .mvn/wrapper/maven-wrapper.jar README.md build.gradle -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/ModelApiResponse.md -docs/ModelClient.md -docs/ModelFile.md -docs/ModelList.md -docs/ModelReturn.md -docs/Name.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -docs/auth.md +docs/apis/AnotherFakeApi.md +docs/apis/FakeApi.md +docs/apis/FakeClassnameTags123Api.md +docs/apis/PetApi.md +docs/apis/StoreApi.md +docs/apis/UserApi.md +docs/apis/auth.md +docs/models/AdditionalPropertiesAnyType.md +docs/models/AdditionalPropertiesArray.md +docs/models/AdditionalPropertiesBoolean.md +docs/models/AdditionalPropertiesClass.md +docs/models/AdditionalPropertiesInteger.md +docs/models/AdditionalPropertiesNumber.md +docs/models/AdditionalPropertiesObject.md +docs/models/AdditionalPropertiesString.md +docs/models/Animal.md +docs/models/ArrayOfArrayOfNumberOnly.md +docs/models/ArrayOfNumberOnly.md +docs/models/ArrayTest.md +docs/models/BigCat.md +docs/models/BigCatAllOf.md +docs/models/Capitalization.md +docs/models/Cat.md +docs/models/CatAllOf.md +docs/models/Category.md +docs/models/ClassModel.md +docs/models/Dog.md +docs/models/DogAllOf.md +docs/models/EnumArrays.md +docs/models/EnumClass.md +docs/models/EnumTest.md +docs/models/FileSchemaTestClass.md +docs/models/FormatTest.md +docs/models/HasOnlyReadOnly.md +docs/models/MapTest.md +docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +docs/models/Model200Response.md +docs/models/ModelApiResponse.md +docs/models/ModelClient.md +docs/models/ModelFile.md +docs/models/ModelList.md +docs/models/ModelReturn.md +docs/models/Name.md +docs/models/NumberOnly.md +docs/models/Order.md +docs/models/OuterComposite.md +docs/models/OuterEnum.md +docs/models/Pet.md +docs/models/ReadOnlyFirst.md +docs/models/SpecialModelName.md +docs/models/Tag.md +docs/models/TypeHolderDefault.md +docs/models/TypeHolderExample.md +docs/models/User.md +docs/models/XmlItem.md gradle.properties gradle/wrapper/gradle-wrapper.jar gradle/wrapper/gradle-wrapper.properties @@ -122,6 +122,5 @@ src/main/java/org/openapitools/model/TypeHolderDefault.java src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java -src/main/java/org/openapitools/query/QueryParam.java -src/main/java/org/openapitools/query/QueryParamBinder.java src/main/resources/application.yml +src/main/resources/logback.xml diff --git a/samples/client/petstore/java-micronaut-client/README.md b/samples/client/petstore/java-micronaut-client/README.md index 9ed69e201d3..149073d437e 100644 --- a/samples/client/petstore/java-micronaut-client/README.md +++ b/samples/client/petstore/java-micronaut-client/README.md @@ -25,12 +25,12 @@ All the properties can be changed in the [application.yml][src/main/resources/ap Description on how to create Apis is given inside individual api guides: -* [AnotherFakeApi](docs//AnotherFakeApi.md) -* [FakeApi](docs//FakeApi.md) -* [FakeClassnameTags123Api](docs//FakeClassnameTags123Api.md) -* [PetApi](docs//PetApi.md) -* [StoreApi](docs//StoreApi.md) -* [UserApi](docs//UserApi.md) +* [AnotherFakeApi](docs/apis/AnotherFakeApi.md) +* [FakeApi](docs/apis/FakeApi.md) +* [FakeClassnameTags123Api](docs/apis/FakeClassnameTags123Api.md) +* [PetApi](docs/apis/PetApi.md) +* [StoreApi](docs/apis/StoreApi.md) +* [UserApi](docs/apis/UserApi.md) ## Auth methods diff --git a/samples/client/petstore/java-micronaut-client/build.gradle b/samples/client/petstore/java-micronaut-client/build.gradle index 856fe2d4349..c74021320cc 100644 --- a/samples/client/petstore/java-micronaut-client/build.gradle +++ b/samples/client/petstore/java-micronaut-client/build.gradle @@ -1,7 +1,7 @@ plugins { id("groovy") - id("com.github.johnrengelman.shadow") version "7.0.0" - id("io.micronaut.application") version "2.0.3" + id("com.github.johnrengelman.shadow") version "7.1.1" + id("io.micronaut.application") version "3.1.1" } version = "1.0.0" @@ -42,3 +42,5 @@ java { sourceCompatibility = JavaVersion.toVersion("1.8") targetCompatibility = JavaVersion.toVersion("1.8") } + +graalvmNative.toolchainDetection = false diff --git a/samples/client/petstore/java-micronaut-client/docs/AnotherFakeApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/AnotherFakeApi.md similarity index 100% rename from samples/client/petstore/java-micronaut-client/docs/AnotherFakeApi.md rename to samples/client/petstore/java-micronaut-client/docs/apis/AnotherFakeApi.md diff --git a/samples/client/petstore/java-micronaut-client/docs/FakeApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/FakeApi.md similarity index 99% rename from samples/client/petstore/java-micronaut-client/docs/FakeApi.md rename to samples/client/petstore/java-micronaut-client/docs/apis/FakeApi.md index 3b9f98a4ed7..14cf772369e 100644 --- a/samples/client/petstore/java-micronaut-client/docs/FakeApi.md +++ b/samples/client/petstore/java-micronaut-client/docs/apis/FakeApi.md @@ -95,7 +95,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: `*/*` + - **Accept**: Not defined # **fakeOuterCompositeSerialize** @@ -120,7 +120,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: `*/*` + - **Accept**: Not defined # **fakeOuterNumberSerialize** @@ -145,7 +145,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: `*/*` + - **Accept**: Not defined # **fakeOuterStringSerialize** @@ -170,7 +170,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: `*/*` + - **Accept**: Not defined # **testBodyWithFileSchema** diff --git a/samples/client/petstore/java-micronaut-client/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-micronaut-client/docs/apis/FakeClassnameTags123Api.md similarity index 100% rename from samples/client/petstore/java-micronaut-client/docs/FakeClassnameTags123Api.md rename to samples/client/petstore/java-micronaut-client/docs/apis/FakeClassnameTags123Api.md diff --git a/samples/client/petstore/java-micronaut-client/docs/PetApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/PetApi.md similarity index 100% rename from samples/client/petstore/java-micronaut-client/docs/PetApi.md rename to samples/client/petstore/java-micronaut-client/docs/apis/PetApi.md diff --git a/samples/client/petstore/java-micronaut-client/docs/StoreApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/StoreApi.md similarity index 100% rename from samples/client/petstore/java-micronaut-client/docs/StoreApi.md rename to samples/client/petstore/java-micronaut-client/docs/apis/StoreApi.md diff --git a/samples/client/petstore/java-micronaut-client/docs/UserApi.md b/samples/client/petstore/java-micronaut-client/docs/apis/UserApi.md similarity index 100% rename from samples/client/petstore/java-micronaut-client/docs/UserApi.md rename to samples/client/petstore/java-micronaut-client/docs/apis/UserApi.md diff --git a/samples/client/petstore/java-micronaut-client/docs/auth.md b/samples/client/petstore/java-micronaut-client/docs/apis/auth.md similarity index 100% rename from samples/client/petstore/java-micronaut-client/docs/auth.md rename to samples/client/petstore/java-micronaut-client/docs/apis/auth.md diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesAnyType.md similarity index 57% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesAnyType.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesAnyType.md index fddcd9d8e0f..d57b2721031 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesAnyType.md @@ -2,6 +2,7 @@ # AdditionalPropertiesAnyType +The class is defined in **[AdditionalPropertiesAnyType.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesArray.md similarity index 58% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesArray.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesArray.md index c52113f687b..8eb24fe8262 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesArray.md @@ -2,6 +2,7 @@ # AdditionalPropertiesArray +The class is defined in **[AdditionalPropertiesArray.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesArray.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesBoolean.md similarity index 57% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesBoolean.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesBoolean.md index 9d626b44668..6fcfa2a50f6 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesBoolean.md @@ -2,6 +2,7 @@ # AdditionalPropertiesBoolean +The class is defined in **[AdditionalPropertiesBoolean.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesClass.md similarity index 86% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesClass.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesClass.md index 84f88e3fdba..4e452d010db 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesClass.md @@ -2,6 +2,7 @@ # AdditionalPropertiesClass +The class is defined in **[AdditionalPropertiesClass.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesClass.java)** ## Properties @@ -24,3 +25,10 @@ Name | Type | Description | Notes + + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesInteger.md similarity index 57% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesInteger.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesInteger.md index b17edb55655..3f8aee1c875 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesInteger.md @@ -2,6 +2,7 @@ # AdditionalPropertiesInteger +The class is defined in **[AdditionalPropertiesInteger.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesNumber.md similarity index 58% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesNumber.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesNumber.md index bd33c906eeb..1e8f61b42a4 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesNumber.md @@ -2,6 +2,7 @@ # AdditionalPropertiesNumber +The class is defined in **[AdditionalPropertiesNumber.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesObject.md similarity index 58% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesObject.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesObject.md index a77d38c7b19..a839641e6e8 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesObject.md @@ -2,6 +2,7 @@ # AdditionalPropertiesObject +The class is defined in **[AdditionalPropertiesObject.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesObject.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesString.md b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesString.md similarity index 58% rename from samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesString.md rename to samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesString.md index 6f1ccd0910d..1452d77056c 100644 --- a/samples/client/petstore/java-micronaut-client/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/AdditionalPropertiesString.md @@ -2,6 +2,7 @@ # AdditionalPropertiesString +The class is defined in **[AdditionalPropertiesString.java](../../src/main/java/org/openapitools/model/AdditionalPropertiesString.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/Animal.md b/samples/client/petstore/java-micronaut-client/docs/models/Animal.md similarity index 67% rename from samples/client/petstore/java-micronaut-client/docs/Animal.md rename to samples/client/petstore/java-micronaut-client/docs/models/Animal.md index 4d92e8e7e29..226b3933ac0 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Animal.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Animal.md @@ -2,6 +2,7 @@ # Animal +The class is defined in **[Animal.java](../../src/main/java/org/openapitools/model/Animal.java)** ## Properties @@ -13,5 +14,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfArrayOfNumberOnly.md similarity index 63% rename from samples/client/petstore/java-micronaut-client/docs/ArrayOfArrayOfNumberOnly.md rename to samples/client/petstore/java-micronaut-client/docs/models/ArrayOfArrayOfNumberOnly.md index 65f6fb827f1..3cf3adab1ce 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfArrayOfNumberOnly.md @@ -2,6 +2,7 @@ # ArrayOfArrayOfNumberOnly +The class is defined in **[ArrayOfArrayOfNumberOnly.java](../../src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfNumberOnly.md similarity index 63% rename from samples/client/petstore/java-micronaut-client/docs/ArrayOfNumberOnly.md rename to samples/client/petstore/java-micronaut-client/docs/models/ArrayOfNumberOnly.md index 2909608f6e8..fe09bde39c3 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ArrayOfNumberOnly.md @@ -2,6 +2,7 @@ # ArrayOfNumberOnly +The class is defined in **[ArrayOfNumberOnly.java](../../src/main/java/org/openapitools/model/ArrayOfNumberOnly.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ArrayTest.md b/samples/client/petstore/java-micronaut-client/docs/models/ArrayTest.md similarity index 78% rename from samples/client/petstore/java-micronaut-client/docs/ArrayTest.md rename to samples/client/petstore/java-micronaut-client/docs/models/ArrayTest.md index ee3f7633b28..3f3ec33c736 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ArrayTest.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ArrayTest.md @@ -2,6 +2,7 @@ # ArrayTest +The class is defined in **[ArrayTest.java](../../src/main/java/org/openapitools/model/ArrayTest.java)** ## Properties @@ -15,4 +16,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/java-micronaut-client/docs/BigCat.md b/samples/client/petstore/java-micronaut-client/docs/models/BigCat.md similarity index 52% rename from samples/client/petstore/java-micronaut-client/docs/BigCat.md rename to samples/client/petstore/java-micronaut-client/docs/models/BigCat.md index e368f81567f..2bc6032da82 100644 --- a/samples/client/petstore/java-micronaut-client/docs/BigCat.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/BigCat.md @@ -2,6 +2,7 @@ # BigCat +The class is defined in **[BigCat.java](../../src/main/java/org/openapitools/model/BigCat.java)** ## Properties @@ -9,18 +10,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | [**KindEnum**](#KindEnum) | | [optional property] - - -## Enum: KindEnum +## KindEnum Name | Value ---- | ----- -LIONS | `"lions"` -TIGERS | `"tigers"` -LEOPARDS | `"leopards"` -JAGUARS | `"jaguars"` - - - +LIONS | `"lions"` +TIGERS | `"tigers"` +LEOPARDS | `"leopards"` +JAGUARS | `"jaguars"` diff --git a/samples/client/petstore/java-micronaut-client/docs/BigCatAllOf.md b/samples/client/petstore/java-micronaut-client/docs/models/BigCatAllOf.md similarity index 52% rename from samples/client/petstore/java-micronaut-client/docs/BigCatAllOf.md rename to samples/client/petstore/java-micronaut-client/docs/models/BigCatAllOf.md index 869236ae81d..6e72649489a 100644 --- a/samples/client/petstore/java-micronaut-client/docs/BigCatAllOf.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/BigCatAllOf.md @@ -2,6 +2,7 @@ # BigCatAllOf +The class is defined in **[BigCatAllOf.java](../../src/main/java/org/openapitools/model/BigCatAllOf.java)** ## Properties @@ -9,18 +10,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | [**KindEnum**](#KindEnum) | | [optional property] - - -## Enum: KindEnum +## KindEnum Name | Value ---- | ----- -LIONS | `"lions"` -TIGERS | `"tigers"` -LEOPARDS | `"leopards"` -JAGUARS | `"jaguars"` - - - +LIONS | `"lions"` +TIGERS | `"tigers"` +LEOPARDS | `"leopards"` +JAGUARS | `"jaguars"` diff --git a/samples/client/petstore/java-micronaut-client/docs/Capitalization.md b/samples/client/petstore/java-micronaut-client/docs/models/Capitalization.md similarity index 80% rename from samples/client/petstore/java-micronaut-client/docs/Capitalization.md rename to samples/client/petstore/java-micronaut-client/docs/models/Capitalization.md index fb5232d52de..c3578bff00e 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Capitalization.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Capitalization.md @@ -2,6 +2,7 @@ # Capitalization +The class is defined in **[Capitalization.java](../../src/main/java/org/openapitools/model/Capitalization.java)** ## Properties @@ -19,3 +20,5 @@ Name | Type | Description | Notes + + diff --git a/samples/client/petstore/java-micronaut-client/docs/Cat.md b/samples/client/petstore/java-micronaut-client/docs/models/Cat.md similarity index 65% rename from samples/client/petstore/java-micronaut-client/docs/Cat.md rename to samples/client/petstore/java-micronaut-client/docs/models/Cat.md index 4a7e1503b1e..44b1d8fd3ed 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Cat.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Cat.md @@ -2,6 +2,7 @@ # Cat +The class is defined in **[Cat.java](../../src/main/java/org/openapitools/model/Cat.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/CatAllOf.md b/samples/client/petstore/java-micronaut-client/docs/models/CatAllOf.md similarity index 63% rename from samples/client/petstore/java-micronaut-client/docs/CatAllOf.md rename to samples/client/petstore/java-micronaut-client/docs/models/CatAllOf.md index 41f0898e7c0..e93b6a351fd 100644 --- a/samples/client/petstore/java-micronaut-client/docs/CatAllOf.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/CatAllOf.md @@ -2,6 +2,7 @@ # CatAllOf +The class is defined in **[CatAllOf.java](../../src/main/java/org/openapitools/model/CatAllOf.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/Category.md b/samples/client/petstore/java-micronaut-client/docs/models/Category.md similarity index 65% rename from samples/client/petstore/java-micronaut-client/docs/Category.md rename to samples/client/petstore/java-micronaut-client/docs/models/Category.md index 497a0ce8d45..cab979e1c3d 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Category.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Category.md @@ -2,6 +2,7 @@ # Category +The class is defined in **[Category.java](../../src/main/java/org/openapitools/model/Category.java)** ## Properties @@ -13,5 +14,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ClassModel.md b/samples/client/petstore/java-micronaut-client/docs/models/ClassModel.md similarity index 68% rename from samples/client/petstore/java-micronaut-client/docs/ClassModel.md rename to samples/client/petstore/java-micronaut-client/docs/models/ClassModel.md index e428f3bc207..c3565b7c929 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ClassModel.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ClassModel.md @@ -4,6 +4,8 @@ Model for testing model with \"_class\" property +The class is defined in **[ClassModel.java](../../src/main/java/org/openapitools/model/ClassModel.java)** + ## Properties Name | Type | Description | Notes @@ -12,6 +14,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/Dog.md b/samples/client/petstore/java-micronaut-client/docs/models/Dog.md similarity index 64% rename from samples/client/petstore/java-micronaut-client/docs/Dog.md rename to samples/client/petstore/java-micronaut-client/docs/models/Dog.md index db403946fcd..552e7373757 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Dog.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Dog.md @@ -2,6 +2,7 @@ # Dog +The class is defined in **[Dog.java](../../src/main/java/org/openapitools/model/Dog.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/DogAllOf.md b/samples/client/petstore/java-micronaut-client/docs/models/DogAllOf.md similarity index 63% rename from samples/client/petstore/java-micronaut-client/docs/DogAllOf.md rename to samples/client/petstore/java-micronaut-client/docs/models/DogAllOf.md index e89dd640696..6e25529833b 100644 --- a/samples/client/petstore/java-micronaut-client/docs/DogAllOf.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/DogAllOf.md @@ -2,6 +2,7 @@ # DogAllOf +The class is defined in **[DogAllOf.java](../../src/main/java/org/openapitools/model/DogAllOf.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/EnumArrays.md b/samples/client/petstore/java-micronaut-client/docs/models/EnumArrays.md similarity index 61% rename from samples/client/petstore/java-micronaut-client/docs/EnumArrays.md rename to samples/client/petstore/java-micronaut-client/docs/models/EnumArrays.md index f905c2dab35..421d6479b0e 100644 --- a/samples/client/petstore/java-micronaut-client/docs/EnumArrays.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/EnumArrays.md @@ -2,6 +2,7 @@ # EnumArrays +The class is defined in **[EnumArrays.java](../../src/main/java/org/openapitools/model/EnumArrays.java)** ## Properties @@ -10,24 +11,18 @@ Name | Type | Description | Notes **justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional property] **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional property] - - -## Enum: JustSymbolEnum +## JustSymbolEnum Name | Value ---- | ----- -GREATER_THAN_OR_EQUAL_TO | `">="` -DOLLAR | `"$"` +GREATER_THAN_OR_EQUAL_TO | `">="` +DOLLAR | `"$"` - -## Enum: List<ArrayEnumEnum> +## List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | `"fish"` -CRAB | `"crab"` - - - +FISH | `"fish"` +CRAB | `"crab"` diff --git a/samples/client/petstore/java-micronaut-client/docs/EnumClass.md b/samples/client/petstore/java-micronaut-client/docs/models/EnumClass.md similarity index 51% rename from samples/client/petstore/java-micronaut-client/docs/EnumClass.md rename to samples/client/petstore/java-micronaut-client/docs/models/EnumClass.md index b314590a759..e09084e283d 100644 --- a/samples/client/petstore/java-micronaut-client/docs/EnumClass.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/EnumClass.md @@ -4,6 +4,8 @@ ## Enum +The class is defined in **[EnumClass.java](../../src/main/java/org/openapitools/model/EnumClass.java)** + * `_ABC` (value: `"_abc"`) diff --git a/samples/client/petstore/java-micronaut-client/docs/EnumTest.md b/samples/client/petstore/java-micronaut-client/docs/models/EnumTest.md similarity index 71% rename from samples/client/petstore/java-micronaut-client/docs/EnumTest.md rename to samples/client/petstore/java-micronaut-client/docs/models/EnumTest.md index d2a2431223e..d183eb4d5fe 100644 --- a/samples/client/petstore/java-micronaut-client/docs/EnumTest.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/EnumTest.md @@ -2,6 +2,7 @@ # EnumTest +The class is defined in **[EnumTest.java](../../src/main/java/org/openapitools/model/EnumTest.java)** ## Properties @@ -13,35 +14,30 @@ Name | Type | Description | Notes **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional property] **outerEnum** | `OuterEnum` | | [optional property] - - -## Enum: EnumStringEnum +## EnumStringEnum Name | Value ---- | ----- -UPPER | `"UPPER"` -LOWER | `"lower"` -EMPTY | `""` +UPPER | `"UPPER"` +LOWER | `"lower"` +EMPTY | `""` - -## Enum: EnumStringRequiredEnum +## EnumStringRequiredEnum Name | Value ---- | ----- -UPPER | `"UPPER"` -LOWER | `"lower"` -EMPTY | `""` +UPPER | `"UPPER"` +LOWER | `"lower"` +EMPTY | `""` - -## Enum: EnumIntegerEnum +## EnumIntegerEnum Name | Value ---- | ----- NUMBER_1 | `1` NUMBER_MINUS_1 | `-1` - -## Enum: EnumNumberEnum +## EnumNumberEnum Name | Value ---- | ----- @@ -50,5 +46,3 @@ NUMBER_MINUS_1_DOT_2 | `-1.2` - - diff --git a/samples/client/petstore/java-micronaut-client/docs/FileSchemaTestClass.md b/samples/client/petstore/java-micronaut-client/docs/models/FileSchemaTestClass.md similarity index 69% rename from samples/client/petstore/java-micronaut-client/docs/FileSchemaTestClass.md rename to samples/client/petstore/java-micronaut-client/docs/models/FileSchemaTestClass.md index 4039c948684..0214efd3098 100644 --- a/samples/client/petstore/java-micronaut-client/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/FileSchemaTestClass.md @@ -2,6 +2,7 @@ # FileSchemaTestClass +The class is defined in **[FileSchemaTestClass.java](../../src/main/java/org/openapitools/model/FileSchemaTestClass.java)** ## Properties @@ -13,5 +14,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/FormatTest.md b/samples/client/petstore/java-micronaut-client/docs/models/FormatTest.md similarity index 86% rename from samples/client/petstore/java-micronaut-client/docs/FormatTest.md rename to samples/client/petstore/java-micronaut-client/docs/models/FormatTest.md index 74c29bb97b2..d7299aaa90e 100644 --- a/samples/client/petstore/java-micronaut-client/docs/FormatTest.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/FormatTest.md @@ -2,6 +2,7 @@ # FormatTest +The class is defined in **[FormatTest.java](../../src/main/java/org/openapitools/model/FormatTest.java)** ## Properties @@ -27,3 +28,13 @@ Name | Type | Description | Notes + + + + + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/HasOnlyReadOnly.md similarity index 69% rename from samples/client/petstore/java-micronaut-client/docs/HasOnlyReadOnly.md rename to samples/client/petstore/java-micronaut-client/docs/models/HasOnlyReadOnly.md index c53bce80f62..fab72494cfa 100644 --- a/samples/client/petstore/java-micronaut-client/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/HasOnlyReadOnly.md @@ -2,6 +2,7 @@ # HasOnlyReadOnly +The class is defined in **[HasOnlyReadOnly.java](../../src/main/java/org/openapitools/model/HasOnlyReadOnly.java)** ## Properties @@ -13,5 +14,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/MapTest.md b/samples/client/petstore/java-micronaut-client/docs/models/MapTest.md similarity index 75% rename from samples/client/petstore/java-micronaut-client/docs/MapTest.md rename to samples/client/petstore/java-micronaut-client/docs/models/MapTest.md index 8b868a1ae7e..f5f96393f11 100644 --- a/samples/client/petstore/java-micronaut-client/docs/MapTest.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/MapTest.md @@ -2,6 +2,7 @@ # MapTest +The class is defined in **[MapTest.java](../../src/main/java/org/openapitools/model/MapTest.java)** ## Properties @@ -13,14 +14,12 @@ Name | Type | Description | Notes **indirectMap** | `Map<String, Boolean>` | | [optional property] - -## Enum: Map<String, InnerEnum> +## Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | `"UPPER"` -LOWER | `"lower"` - +UPPER | `"UPPER"` +LOWER | `"lower"` diff --git a/samples/client/petstore/java-micronaut-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-micronaut-client/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 66% rename from samples/client/petstore/java-micronaut-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/petstore/java-micronaut-client/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md index 40f3a82effd..b7c29269f10 100644 --- a/samples/client/petstore/java-micronaut-client/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -2,6 +2,7 @@ # MixedPropertiesAndAdditionalPropertiesClass +The class is defined in **[MixedPropertiesAndAdditionalPropertiesClass.java](../../src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java)** ## Properties @@ -15,4 +16,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/java-micronaut-client/docs/Model200Response.md b/samples/client/petstore/java-micronaut-client/docs/models/Model200Response.md similarity index 71% rename from samples/client/petstore/java-micronaut-client/docs/Model200Response.md rename to samples/client/petstore/java-micronaut-client/docs/models/Model200Response.md index bc8078d0bed..7f403913bbf 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Model200Response.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Model200Response.md @@ -4,6 +4,8 @@ Model for testing model name starting with number +The class is defined in **[Model200Response.java](../../src/main/java/org/openapitools/model/Model200Response.java)** + ## Properties Name | Type | Description | Notes @@ -14,5 +16,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelApiResponse.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelApiResponse.md similarity index 70% rename from samples/client/petstore/java-micronaut-client/docs/ModelApiResponse.md rename to samples/client/petstore/java-micronaut-client/docs/models/ModelApiResponse.md index 950119dc1f1..2d8154e28e5 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ModelApiResponse.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelApiResponse.md @@ -2,6 +2,7 @@ # ModelApiResponse +The class is defined in **[ModelApiResponse.java](../../src/main/java/org/openapitools/model/ModelApiResponse.java)** ## Properties @@ -15,4 +16,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelClient.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelClient.md similarity index 62% rename from samples/client/petstore/java-micronaut-client/docs/ModelClient.md rename to samples/client/petstore/java-micronaut-client/docs/models/ModelClient.md index 74770bad073..3bfcef3bb18 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ModelClient.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelClient.md @@ -2,6 +2,7 @@ # ModelClient +The class is defined in **[ModelClient.java](../../src/main/java/org/openapitools/model/ModelClient.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelFile.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelFile.md similarity index 68% rename from samples/client/petstore/java-micronaut-client/docs/ModelFile.md rename to samples/client/petstore/java-micronaut-client/docs/models/ModelFile.md index 014716aba6a..53228b7d77d 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ModelFile.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelFile.md @@ -4,6 +4,8 @@ Must be named `File` for test. +The class is defined in **[ModelFile.java](../../src/main/java/org/openapitools/model/ModelFile.java)** + ## Properties Name | Type | Description | Notes @@ -12,6 +14,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelList.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelList.md similarity index 63% rename from samples/client/petstore/java-micronaut-client/docs/ModelList.md rename to samples/client/petstore/java-micronaut-client/docs/models/ModelList.md index 6468645316c..badcf08bd2c 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ModelList.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelList.md @@ -2,6 +2,7 @@ # ModelList +The class is defined in **[ModelList.java](../../src/main/java/org/openapitools/model/ModelList.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelReturn.md b/samples/client/petstore/java-micronaut-client/docs/models/ModelReturn.md similarity index 66% rename from samples/client/petstore/java-micronaut-client/docs/ModelReturn.md rename to samples/client/petstore/java-micronaut-client/docs/models/ModelReturn.md index f907f3a956b..48712674adb 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ModelReturn.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ModelReturn.md @@ -4,6 +4,8 @@ Model for testing reserved words +The class is defined in **[ModelReturn.java](../../src/main/java/org/openapitools/model/ModelReturn.java)** + ## Properties Name | Type | Description | Notes @@ -12,6 +14,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/Name.md b/samples/client/petstore/java-micronaut-client/docs/models/Name.md similarity index 80% rename from samples/client/petstore/java-micronaut-client/docs/Name.md rename to samples/client/petstore/java-micronaut-client/docs/models/Name.md index e9e41d13435..9595d1d9749 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Name.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Name.md @@ -4,6 +4,8 @@ Model for testing model name same as property name +The class is defined in **[Name.java](../../src/main/java/org/openapitools/model/Name.java)** + ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/java-micronaut-client/docs/NumberOnly.md b/samples/client/petstore/java-micronaut-client/docs/models/NumberOnly.md similarity index 63% rename from samples/client/petstore/java-micronaut-client/docs/NumberOnly.md rename to samples/client/petstore/java-micronaut-client/docs/models/NumberOnly.md index ff8408617c5..1c7c5a3d67a 100644 --- a/samples/client/petstore/java-micronaut-client/docs/NumberOnly.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/NumberOnly.md @@ -2,6 +2,7 @@ # NumberOnly +The class is defined in **[NumberOnly.java](../../src/main/java/org/openapitools/model/NumberOnly.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/Order.md b/samples/client/petstore/java-micronaut-client/docs/models/Order.md similarity index 72% rename from samples/client/petstore/java-micronaut-client/docs/Order.md rename to samples/client/petstore/java-micronaut-client/docs/models/Order.md index 2522ec781e4..c5f46aad0e1 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Order.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Order.md @@ -2,6 +2,7 @@ # Order +The class is defined in **[Order.java](../../src/main/java/org/openapitools/model/Order.java)** ## Properties @@ -16,15 +17,15 @@ Name | Type | Description | Notes -## Enum: StatusEnum + + +## StatusEnum Name | Value ---- | ----- -PLACED | `"placed"` -APPROVED | `"approved"` -DELIVERED | `"delivered"` - - +PLACED | `"placed"` +APPROVED | `"approved"` +DELIVERED | `"delivered"` diff --git a/samples/client/petstore/java-micronaut-client/docs/OuterComposite.md b/samples/client/petstore/java-micronaut-client/docs/models/OuterComposite.md similarity index 71% rename from samples/client/petstore/java-micronaut-client/docs/OuterComposite.md rename to samples/client/petstore/java-micronaut-client/docs/models/OuterComposite.md index dc004d557a5..13edac13070 100644 --- a/samples/client/petstore/java-micronaut-client/docs/OuterComposite.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/OuterComposite.md @@ -2,6 +2,7 @@ # OuterComposite +The class is defined in **[OuterComposite.java](../../src/main/java/org/openapitools/model/OuterComposite.java)** ## Properties @@ -15,4 +16,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/java-micronaut-client/docs/OuterEnum.md b/samples/client/petstore/java-micronaut-client/docs/models/OuterEnum.md similarity index 55% rename from samples/client/petstore/java-micronaut-client/docs/OuterEnum.md rename to samples/client/petstore/java-micronaut-client/docs/models/OuterEnum.md index 1f9b723eb8e..71fc1dfebad 100644 --- a/samples/client/petstore/java-micronaut-client/docs/OuterEnum.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/OuterEnum.md @@ -4,6 +4,8 @@ ## Enum +The class is defined in **[OuterEnum.java](../../src/main/java/org/openapitools/model/OuterEnum.java)** + * `PLACED` (value: `"placed"`) diff --git a/samples/client/petstore/java-micronaut-client/docs/Pet.md b/samples/client/petstore/java-micronaut-client/docs/models/Pet.md similarity index 74% rename from samples/client/petstore/java-micronaut-client/docs/Pet.md rename to samples/client/petstore/java-micronaut-client/docs/models/Pet.md index 6a18fe4238d..8abc005db7b 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Pet.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Pet.md @@ -2,6 +2,7 @@ # Pet +The class is defined in **[Pet.java](../../src/main/java/org/openapitools/model/Pet.java)** ## Properties @@ -16,15 +17,15 @@ Name | Type | Description | Notes -## Enum: StatusEnum + + + +## StatusEnum Name | Value ---- | ----- -AVAILABLE | `"available"` -PENDING | `"pending"` -SOLD | `"sold"` - - - +AVAILABLE | `"available"` +PENDING | `"pending"` +SOLD | `"sold"` diff --git a/samples/client/petstore/java-micronaut-client/docs/ReadOnlyFirst.md b/samples/client/petstore/java-micronaut-client/docs/models/ReadOnlyFirst.md similarity index 68% rename from samples/client/petstore/java-micronaut-client/docs/ReadOnlyFirst.md rename to samples/client/petstore/java-micronaut-client/docs/models/ReadOnlyFirst.md index 503ba210dbf..3ee5d2f8e02 100644 --- a/samples/client/petstore/java-micronaut-client/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/ReadOnlyFirst.md @@ -2,6 +2,7 @@ # ReadOnlyFirst +The class is defined in **[ReadOnlyFirst.java](../../src/main/java/org/openapitools/model/ReadOnlyFirst.java)** ## Properties @@ -13,5 +14,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/SpecialModelName.md b/samples/client/petstore/java-micronaut-client/docs/models/SpecialModelName.md similarity index 62% rename from samples/client/petstore/java-micronaut-client/docs/SpecialModelName.md rename to samples/client/petstore/java-micronaut-client/docs/models/SpecialModelName.md index 88dbe302799..881887f07a2 100644 --- a/samples/client/petstore/java-micronaut-client/docs/SpecialModelName.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/SpecialModelName.md @@ -2,6 +2,7 @@ # SpecialModelName +The class is defined in **[SpecialModelName.java](../../src/main/java/org/openapitools/model/SpecialModelName.java)** ## Properties @@ -11,6 +12,3 @@ Name | Type | Description | Notes - - - diff --git a/samples/client/petstore/java-micronaut-client/docs/Tag.md b/samples/client/petstore/java-micronaut-client/docs/models/Tag.md similarity index 69% rename from samples/client/petstore/java-micronaut-client/docs/Tag.md rename to samples/client/petstore/java-micronaut-client/docs/models/Tag.md index 7de5f5be77f..0f9ae67b0a5 100644 --- a/samples/client/petstore/java-micronaut-client/docs/Tag.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/Tag.md @@ -2,6 +2,7 @@ # Tag +The class is defined in **[Tag.java](../../src/main/java/org/openapitools/model/Tag.java)** ## Properties @@ -13,5 +14,3 @@ Name | Type | Description | Notes - - diff --git a/samples/client/petstore/java-micronaut-client/docs/TypeHolderDefault.md b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderDefault.md similarity index 72% rename from samples/client/petstore/java-micronaut-client/docs/TypeHolderDefault.md rename to samples/client/petstore/java-micronaut-client/docs/models/TypeHolderDefault.md index 1cd7787e495..cb18bde0ed3 100644 --- a/samples/client/petstore/java-micronaut-client/docs/TypeHolderDefault.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderDefault.md @@ -2,6 +2,7 @@ # TypeHolderDefault +The class is defined in **[TypeHolderDefault.java](../../src/main/java/org/openapitools/model/TypeHolderDefault.java)** ## Properties @@ -18,3 +19,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java-micronaut-client/docs/TypeHolderExample.md b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderExample.md similarity index 73% rename from samples/client/petstore/java-micronaut-client/docs/TypeHolderExample.md rename to samples/client/petstore/java-micronaut-client/docs/models/TypeHolderExample.md index 805608ae2b9..83a65f0f276 100644 --- a/samples/client/petstore/java-micronaut-client/docs/TypeHolderExample.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/TypeHolderExample.md @@ -2,6 +2,7 @@ # TypeHolderExample +The class is defined in **[TypeHolderExample.java](../../src/main/java/org/openapitools/model/TypeHolderExample.java)** ## Properties @@ -19,3 +20,5 @@ Name | Type | Description | Notes + + diff --git a/samples/client/petstore/java-micronaut-client/docs/User.md b/samples/client/petstore/java-micronaut-client/docs/models/User.md similarity index 84% rename from samples/client/petstore/java-micronaut-client/docs/User.md rename to samples/client/petstore/java-micronaut-client/docs/models/User.md index 73274c63f19..53064208094 100644 --- a/samples/client/petstore/java-micronaut-client/docs/User.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/User.md @@ -2,6 +2,7 @@ # User +The class is defined in **[User.java](../../src/main/java/org/openapitools/model/User.java)** ## Properties @@ -21,3 +22,7 @@ Name | Type | Description | Notes + + + + diff --git a/samples/client/petstore/java-micronaut-client/docs/XmlItem.md b/samples/client/petstore/java-micronaut-client/docs/models/XmlItem.md similarity index 93% rename from samples/client/petstore/java-micronaut-client/docs/XmlItem.md rename to samples/client/petstore/java-micronaut-client/docs/models/XmlItem.md index 2f07c8efbf6..71ca437c2e6 100644 --- a/samples/client/petstore/java-micronaut-client/docs/XmlItem.md +++ b/samples/client/petstore/java-micronaut-client/docs/models/XmlItem.md @@ -2,6 +2,7 @@ # XmlItem +The class is defined in **[XmlItem.java](../../src/main/java/org/openapitools/model/XmlItem.java)** ## Properties @@ -42,3 +43,28 @@ Name | Type | Description | Notes + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/gradle.properties b/samples/client/petstore/java-micronaut-client/gradle.properties index 4804e049014..70b9dde78f1 100644 --- a/samples/client/petstore/java-micronaut-client/gradle.properties +++ b/samples/client/petstore/java-micronaut-client/gradle.properties @@ -1 +1 @@ -micronautVersion=3.0.0-M5 \ No newline at end of file +micronautVersion=3.2.6 \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/pom.xml b/samples/client/petstore/java-micronaut-client/pom.xml index c64bc3bb07c..89a43adef33 100644 --- a/samples/client/petstore/java-micronaut-client/pom.xml +++ b/samples/client/petstore/java-micronaut-client/pom.xml @@ -10,7 +10,7 @@ io.micronaut micronaut-parent - 3.0.0-M5 + 3.2.6 @@ -18,7 +18,7 @@ 1.8 - 3.0.0-M5 + 3.2.6 org.openapitools.Application netty 1.5.21 diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java index 09c1c9fb397..26e3afaff52 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -15,7 +15,6 @@ package org.openapitools.api; import io.micronaut.http.annotation.*; import io.micronaut.core.annotation.*; import io.micronaut.http.client.annotation.Client; -import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; import org.openapitools.model.ModelClient; @@ -31,18 +30,17 @@ import javax.validation.constraints.*; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Client("${base-path}") public interface AnotherFakeApi { - - /** - * To test special tags - * To test special tags and operation ID starting with number - * - * @param _body client model (required) - * @return ModelClient - */ - @Patch(uri="/another-fake/dummy") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono call123testSpecialTags( - @Body @Valid @NotNull ModelClient _body + /** + * To test special tags + * To test special tags and operation ID starting with number + * + * @param _body client model (required) + * @return ModelClient + */ + @Patch(uri="/another-fake/dummy") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono call123testSpecialTags( + @Body @NotNull @Valid ModelClient _body ); } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java index 1a5913a842c..7f5970b69a6 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeApi.java @@ -15,7 +15,6 @@ package org.openapitools.api; import io.micronaut.http.annotation.*; import io.micronaut.core.annotation.*; import io.micronaut.http.client.annotation.Client; -import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; import java.math.BigDecimal; @@ -39,242 +38,228 @@ import javax.validation.constraints.*; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Client("${base-path}") public interface FakeApi { - - /** - * creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - */ - @Post(uri="/fake/create_xml_item") - @Produces(value={"application/xml"}) - @Consumes(value={"application/json"}) - Mono createXmlItem( - @Body @Valid @NotNull XmlItem xmlItem + /** + * creates an XmlItem + * this route creates an XmlItem + * + * @param xmlItem XmlItem Body (required) + */ + @Post(uri="/fake/create_xml_item") + @Produces(value={"application/xml"}) + @Consumes(value={"application/json"}) + Mono createXmlItem( + @Body @NotNull @Valid XmlItem xmlItem ); - - /** - * Test serialization of outer boolean types - * - * @param _body Input boolean as post body (optional) - * @return Boolean - */ - @Post(uri="/fake/outer/boolean") - @Produces(value={"*/*"}) - @Consumes(value={"*/*"}) - Mono fakeOuterBooleanSerialize( - @Body Boolean _body + /** + * Test serialization of outer boolean types + * + * @param _body Input boolean as post body (optional) + * @return Boolean + */ + @Post(uri="/fake/outer/boolean") + @Produces(value={"application/json"}) + @Consumes(value={"*/*"}) + Mono fakeOuterBooleanSerialize( + @Body @Nullable Boolean _body ); - - /** - * Test serialization of object with outer number type - * - * @param _body Input composite as post body (optional) - * @return OuterComposite - */ - @Post(uri="/fake/outer/composite") - @Produces(value={"*/*"}) - @Consumes(value={"*/*"}) - Mono fakeOuterCompositeSerialize( - @Body @Valid OuterComposite _body + /** + * Test serialization of object with outer number type + * + * @param _body Input composite as post body (optional) + * @return OuterComposite + */ + @Post(uri="/fake/outer/composite") + @Produces(value={"application/json"}) + @Consumes(value={"*/*"}) + Mono fakeOuterCompositeSerialize( + @Body @Nullable @Valid OuterComposite _body ); - - /** - * Test serialization of outer number types - * - * @param _body Input number as post body (optional) - * @return BigDecimal - */ - @Post(uri="/fake/outer/number") - @Produces(value={"*/*"}) - @Consumes(value={"*/*"}) - Mono fakeOuterNumberSerialize( - @Body BigDecimal _body + /** + * Test serialization of outer number types + * + * @param _body Input number as post body (optional) + * @return BigDecimal + */ + @Post(uri="/fake/outer/number") + @Produces(value={"application/json"}) + @Consumes(value={"*/*"}) + Mono fakeOuterNumberSerialize( + @Body @Nullable BigDecimal _body ); - - /** - * Test serialization of outer string types - * - * @param _body Input string as post body (optional) - * @return String - */ - @Post(uri="/fake/outer/string") - @Produces(value={"*/*"}) - @Consumes(value={"*/*"}) - Mono fakeOuterStringSerialize( - @Body String _body + /** + * Test serialization of outer string types + * + * @param _body Input string as post body (optional) + * @return String + */ + @Post(uri="/fake/outer/string") + @Produces(value={"application/json"}) + @Consumes(value={"*/*"}) + Mono fakeOuterStringSerialize( + @Body @Nullable String _body ); - - /** - * For this test, the body for this request much reference a schema named `File`. - * - * @param _body (required) - */ - @Put(uri="/fake/body-with-file-schema") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono testBodyWithFileSchema( - @Body @Valid @NotNull FileSchemaTestClass _body + /** + * For this test, the body for this request much reference a schema named `File`. + * + * @param _body (required) + */ + @Put(uri="/fake/body-with-file-schema") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono testBodyWithFileSchema( + @Body @NotNull @Valid FileSchemaTestClass _body ); - - /** - * testBodyWithQueryParams - * - * @param query (required) - * @param _body (required) - */ - @Put(uri="/fake/body-with-query-params") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono testBodyWithQueryParams( - @QueryParam(name="query") @NotNull String query, - @Body @Valid @NotNull User _body + /** + * testBodyWithQueryParams + * + * @param query (required) + * @param _body (required) + */ + @Put(uri="/fake/body-with-query-params") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono testBodyWithQueryParams( + @QueryValue(value="query") @NotNull String query, + @Body @NotNull @Valid User _body ); - - /** - * To test \"client\" model - * To test \"client\" model - * - * @param _body client model (required) - * @return ModelClient - */ - @Patch(uri="/fake") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono testClientModel( - @Body @Valid @NotNull ModelClient _body + /** + * To test \"client\" model + * To test \"client\" model + * + * @param _body client model (required) + * @return ModelClient + */ + @Patch(uri="/fake") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono testClientModel( + @Body @NotNull @Valid ModelClient _body ); - - /** - * 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) - */ - @Post(uri="/fake") - @Produces(value={"application/x-www-form-urlencoded"}) - @Consumes(value={"application/json"}) - Mono testEndpointParameters( + /** + * 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) + */ + @Post(uri="/fake") + @Produces(value={"application/x-www-form-urlencoded"}) + @Consumes(value={"application/json"}) + Mono testEndpointParameters( @NotNull @DecimalMin("32.1") @DecimalMax("543.2") BigDecimal number, @NotNull @DecimalMin("67.8") @DecimalMax("123.4") Double _double, @NotNull @Pattern(regexp="^[A-Z].*") String patternWithoutDelimiter, @NotNull byte[] _byte, - @Min(10) @Max(100) Integer integer, - @Min(20) @Max(200) Integer int32, - Long int64, - @DecimalMax("987.6") Float _float, - @Pattern(regexp="/[a-z]/i") String string, - File binary, - @Format("yyyy-MM-dd") LocalDate date, - @Format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") LocalDateTime dateTime, - @Size(min=10, max=64) String password, - String paramCallback + @Nullable @Min(10) @Max(100) Integer integer, + @Nullable @Min(20) @Max(200) Integer int32, + @Nullable Long int64, + @Nullable @DecimalMax("987.6") Float _float, + @Nullable @Pattern(regexp="/[a-z]/i") String string, + @Nullable File binary, + @Nullable @Format("yyyy-MM-dd") LocalDate date, + @Nullable @Format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") LocalDateTime dateTime, + @Nullable @Size(min=10, max=64) String password, + @Nullable String paramCallback ); - - /** - * To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @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) - */ - @Get(uri="/fake") - @Produces(value={"application/x-www-form-urlencoded"}) - @Consumes(value={"application/json"}) - Mono testEnumParameters( - @Header(name="enum_header_string_array") List enumHeaderStringArray, - @Header(name="enum_header_string", defaultValue="-efg") String enumHeaderString, - @QueryParam(name="enum_query_string_array", format=QueryParam.Format.CSV) List enumQueryStringArray, - @QueryParam(name="enum_query_string", defaultValue="-efg") String enumQueryString, - @QueryParam(name="enum_query_integer") Integer enumQueryInteger, - @QueryParam(name="enum_query_double") Double enumQueryDouble, - List enumFormStringArray, - String enumFormString + /** + * To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @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) + */ + @Get(uri="/fake") + @Produces(value={"application/x-www-form-urlencoded"}) + @Consumes(value={"application/json"}) + Mono testEnumParameters( + @Header(name="enum_header_string_array") @Nullable List enumHeaderStringArray, + @Header(name="enum_header_string", defaultValue="-efg") @Nullable String enumHeaderString, + @QueryValue(value="enum_query_string_array") @Nullable List enumQueryStringArray, + @QueryValue(value="enum_query_string", defaultValue="-efg") @Nullable String enumQueryString, + @QueryValue(value="enum_query_integer") @Nullable Integer enumQueryInteger, + @QueryValue(value="enum_query_double") @Nullable Double enumQueryDouble, + @Nullable List enumFormStringArray, + @Nullable String enumFormString ); - - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - */ - @Delete(uri="/fake") - @Consumes(value={"application/json"}) - Mono testGroupParameters( - @QueryParam(name="required_string_group") @NotNull Integer requiredStringGroup, + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + */ + @Delete(uri="/fake") + @Consumes(value={"application/json"}) + Mono testGroupParameters( + @QueryValue(value="required_string_group") @NotNull Integer requiredStringGroup, @Header(name="required_boolean_group") @NotNull Boolean requiredBooleanGroup, - @QueryParam(name="required_int64_group") @NotNull Long requiredInt64Group, - @QueryParam(name="string_group") Integer stringGroup, - @Header(name="boolean_group") Boolean booleanGroup, - @QueryParam(name="int64_group") Long int64Group + @QueryValue(value="required_int64_group") @NotNull Long requiredInt64Group, + @QueryValue(value="string_group") @Nullable Integer stringGroup, + @Header(name="boolean_group") @Nullable Boolean booleanGroup, + @QueryValue(value="int64_group") @Nullable Long int64Group ); - - /** - * test inline additionalProperties - * - * @param param request body (required) - */ - @Post(uri="/fake/inline-additionalProperties") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono testInlineAdditionalProperties( + /** + * test inline additionalProperties + * + * @param param request body (required) + */ + @Post(uri="/fake/inline-additionalProperties") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono testInlineAdditionalProperties( @Body @NotNull Map param ); - - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - */ - @Get(uri="/fake/jsonFormData") - @Produces(value={"application/x-www-form-urlencoded"}) - @Consumes(value={"application/json"}) - Mono testJsonFormData( + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + */ + @Get(uri="/fake/jsonFormData") + @Produces(value={"application/x-www-form-urlencoded"}) + @Consumes(value={"application/json"}) + Mono testJsonFormData( @NotNull String param, @NotNull String param2 ); - - /** - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - */ - @Put(uri="/fake/test-query-parameters") - @Consumes(value={"application/json"}) - Mono testQueryParameterCollectionFormat( - @QueryParam(name="pipe", format=QueryParam.Format.CSV) @NotNull List pipe, - @QueryParam(name="ioutil", format=QueryParam.Format.CSV) @NotNull List ioutil, - @QueryParam(name="http", format=QueryParam.Format.SSV) @NotNull List http, - @QueryParam(name="url", format=QueryParam.Format.CSV) @NotNull List url, - @QueryParam(name="context", format=QueryParam.Format.MULTI) @NotNull List context + /** + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + */ + @Put(uri="/fake/test-query-parameters") + @Consumes(value={"application/json"}) + Mono testQueryParameterCollectionFormat( + @QueryValue(value="pipe") @NotNull List pipe, + @QueryValue(value="ioutil") @NotNull List ioutil, + @QueryValue(value="http") @NotNull List http, + @QueryValue(value="url") @NotNull List url, + @QueryValue(value="context") @NotNull List context ); } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index e586776bc7d..5b965862178 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -15,7 +15,6 @@ package org.openapitools.api; import io.micronaut.http.annotation.*; import io.micronaut.core.annotation.*; import io.micronaut.http.client.annotation.Client; -import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; import org.openapitools.model.ModelClient; @@ -31,18 +30,17 @@ import javax.validation.constraints.*; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Client("${base-path}") public interface FakeClassnameTags123Api { - - /** - * To test class name in snake case - * To test class name in snake case - * - * @param _body client model (required) - * @return ModelClient - */ - @Patch(uri="/fake_classname_test") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono testClassname( - @Body @Valid @NotNull ModelClient _body + /** + * To test class name in snake case + * To test class name in snake case + * + * @param _body client model (required) + * @return ModelClient + */ + @Patch(uri="/fake_classname_test") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono testClassname( + @Body @NotNull @Valid ModelClient _body ); } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java index 538f7eb80fa..a49acded581 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/PetApi.java @@ -15,7 +15,6 @@ package org.openapitools.api; import io.micronaut.http.annotation.*; import io.micronaut.core.annotation.*; import io.micronaut.http.client.annotation.Client; -import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; import java.io.File; @@ -34,130 +33,121 @@ import javax.validation.constraints.*; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Client("${base-path}") public interface PetApi { - - /** - * Add a new pet to the store - * - * @param _body Pet object that needs to be added to the store (required) - */ - @Post(uri="/pet") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono addPet( - @Body @Valid @NotNull Pet _body + /** + * Add a new pet to the store + * + * @param _body Pet object that needs to be added to the store (required) + */ + @Post(uri="/pet") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono addPet( + @Body @NotNull @Valid Pet _body ); - - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - */ - @Delete(uri="/pet/{petId}") - @Consumes(value={"application/json"}) - Mono deletePet( + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + */ + @Delete(uri="/pet/{petId}") + @Consumes(value={"application/json"}) + Mono deletePet( @PathVariable(name="petId") @NotNull Long petId, - @Header(name="api_key") String apiKey + @Header(name="api_key") @Nullable String apiKey ); - - /** - * 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> - */ - @Get(uri="/pet/findByStatus") - @Consumes(value={"application/json"}) - Mono> findPetsByStatus( - @QueryParam(name="status", format=QueryParam.Format.CSV) @NotNull List status + /** + * 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> + */ + @Get(uri="/pet/findByStatus") + @Consumes(value={"application/json"}) + Mono> findPetsByStatus( + @QueryValue(value="status") @NotNull List status ); - - /** - * 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 Set<Pet> - */ - @Get(uri="/pet/findByTags") - @Consumes(value={"application/json"}) - Mono> findPetsByTags( - @QueryParam(name="tags", format=QueryParam.Format.CSV) @NotNull Set tags + /** + * 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 Set<Pet> + */ + @Get(uri="/pet/findByTags") + @Consumes(value={"application/json"}) + Mono> findPetsByTags( + @QueryValue(value="tags") @NotNull Set tags ); - - /** - * Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return Pet - */ - @Get(uri="/pet/{petId}") - @Consumes(value={"application/json"}) - Mono getPetById( + /** + * Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return Pet + */ + @Get(uri="/pet/{petId}") + @Consumes(value={"application/json"}) + Mono getPetById( @PathVariable(name="petId") @NotNull Long petId ); - - /** - * Update an existing pet - * - * @param _body Pet object that needs to be added to the store (required) - */ - @Put(uri="/pet") - @Produces(value={"application/json"}) - @Consumes(value={"application/json"}) - Mono updatePet( - @Body @Valid @NotNull Pet _body + /** + * Update an existing pet + * + * @param _body Pet object that needs to be added to the store (required) + */ + @Put(uri="/pet") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono updatePet( + @Body @NotNull @Valid Pet _body ); - - /** - * 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) - */ - @Post(uri="/pet/{petId}") - @Produces(value={"application/x-www-form-urlencoded"}) - @Consumes(value={"application/json"}) - Mono updatePetWithForm( + /** + * 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) + */ + @Post(uri="/pet/{petId}") + @Produces(value={"application/x-www-form-urlencoded"}) + @Consumes(value={"application/json"}) + Mono updatePetWithForm( @PathVariable(name="petId") @NotNull Long petId, - String name, - String status + @Nullable String name, + @Nullable String status ); - - /** - * 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 - */ - @Post(uri="/pet/{petId}/uploadImage") - @Produces(value={"multipart/form-data"}) - @Consumes(value={"application/json"}) - Mono uploadFile( + /** + * 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 + */ + @Post(uri="/pet/{petId}/uploadImage") + @Produces(value={"multipart/form-data"}) + @Consumes(value={"application/json"}) + Mono uploadFile( @PathVariable(name="petId") @NotNull Long petId, - String additionalMetadata, - File _file + @Nullable String additionalMetadata, + @Nullable File _file ); - - /** - * 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 - */ - @Post(uri="/fake/{petId}/uploadImageWithRequiredFile") - @Produces(value={"multipart/form-data"}) - @Consumes(value={"application/json"}) - Mono uploadFileWithRequiredFile( + /** + * 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 + */ + @Post(uri="/fake/{petId}/uploadImageWithRequiredFile") + @Produces(value={"multipart/form-data"}) + @Consumes(value={"application/json"}) + Mono uploadFileWithRequiredFile( @PathVariable(name="petId") @NotNull Long petId, @NotNull File requiredFile, - String additionalMetadata + @Nullable String additionalMetadata ); } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java index 5a0bb8af787..36ccca35533 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/StoreApi.java @@ -15,7 +15,6 @@ package org.openapitools.api; import io.micronaut.http.annotation.*; import io.micronaut.core.annotation.*; import io.micronaut.http.client.annotation.Client; -import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; import org.openapitools.model.Order; @@ -31,52 +30,48 @@ import javax.validation.constraints.*; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Client("${base-path}") public interface StoreApi { - - /** - * 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) - */ - @Delete(uri="/store/order/{order_id}") - @Consumes(value={"application/json"}) - Mono deleteOrder( + /** + * 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) + */ + @Delete(uri="/store/order/{order_id}") + @Consumes(value={"application/json"}) + Mono deleteOrder( @PathVariable(name="order_id") @NotNull String orderId ); - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return Map<String, Integer> - */ - @Get(uri="/store/inventory") - @Consumes(value={"application/json"}) - Mono> getInventory(); - - /** - * 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 - */ - @Get(uri="/store/order/{order_id}") - @Consumes(value={"application/json"}) - Mono getOrderById( + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return Map<String, Integer> + */ + @Get(uri="/store/inventory") + @Consumes(value={"application/json"}) + Mono> getInventory(); + /** + * 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 + */ + @Get(uri="/store/order/{order_id}") + @Consumes(value={"application/json"}) + Mono getOrderById( @PathVariable(name="order_id") @NotNull @Min(1L) @Max(5L) Long orderId ); - - /** - * Place an order for a pet - * - * @param _body order placed for purchasing the pet (required) - * @return Order - */ - @Post(uri="/store/order") - @Produces(value={"*/*"}) - @Consumes(value={"application/json"}) - Mono placeOrder( - @Body @Valid @NotNull Order _body + /** + * Place an order for a pet + * + * @param _body order placed for purchasing the pet (required) + * @return Order + */ + @Post(uri="/store/order") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono placeOrder( + @Body @NotNull @Valid Order _body ); } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java index 6e608808a73..8fa12ce923b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java @@ -15,7 +15,6 @@ package org.openapitools.api; import io.micronaut.http.annotation.*; import io.micronaut.core.annotation.*; import io.micronaut.http.client.annotation.Client; -import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; import java.time.LocalDateTime; @@ -32,102 +31,94 @@ import javax.validation.constraints.*; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Client("${base-path}") public interface UserApi { - - /** - * Create user - * This can only be done by the logged in user. - * - * @param _body Created user object (required) - */ - @Post(uri="/user") - @Produces(value={"*/*"}) - @Consumes(value={"application/json"}) - Mono createUser( - @Body @Valid @NotNull User _body + /** + * Create user + * This can only be done by the logged in user. + * + * @param _body Created user object (required) + */ + @Post(uri="/user") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono createUser( + @Body @NotNull @Valid User _body ); - - /** - * Creates list of users with given input array - * - * @param _body List of user object (required) - */ - @Post(uri="/user/createWithArray") - @Produces(value={"*/*"}) - @Consumes(value={"application/json"}) - Mono createUsersWithArrayInput( + /** + * Creates list of users with given input array + * + * @param _body List of user object (required) + */ + @Post(uri="/user/createWithArray") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono createUsersWithArrayInput( @Body @NotNull List _body ); - - /** - * Creates list of users with given input array - * - * @param _body List of user object (required) - */ - @Post(uri="/user/createWithList") - @Produces(value={"*/*"}) - @Consumes(value={"application/json"}) - Mono createUsersWithListInput( + /** + * Creates list of users with given input array + * + * @param _body List of user object (required) + */ + @Post(uri="/user/createWithList") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono createUsersWithListInput( @Body @NotNull List _body ); - - /** - * Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - */ - @Delete(uri="/user/{username}") - @Consumes(value={"application/json"}) - Mono deleteUser( + /** + * Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + */ + @Delete(uri="/user/{username}") + @Consumes(value={"application/json"}) + Mono deleteUser( @PathVariable(name="username") @NotNull String username ); - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return User - */ - @Get(uri="/user/{username}") - @Consumes(value={"application/json"}) - Mono getUserByName( + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + */ + @Get(uri="/user/{username}") + @Consumes(value={"application/json"}) + Mono getUserByName( @PathVariable(name="username") @NotNull String username ); - - /** - * 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 - */ - @Get(uri="/user/login") - @Consumes(value={"application/json"}) - Mono loginUser( - @QueryParam(name="username") @NotNull String username, - @QueryParam(name="password") @NotNull String password + /** + * 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 + */ + @Get(uri="/user/login") + @Consumes(value={"application/json"}) + Mono loginUser( + @QueryValue(value="username") @NotNull String username, + @QueryValue(value="password") @NotNull String password ); - - /** - * Logs out current logged in user session - * - */ - @Get(uri="/user/logout") - @Consumes(value={"application/json"}) - Mono logoutUser(); - - /** - * Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param _body Updated user object (required) - */ - @Put(uri="/user/{username}") - @Produces(value={"*/*"}) - @Consumes(value={"application/json"}) - Mono updateUser( + /** + * Logs out current logged in user session + * + */ + @Get(uri="/user/logout") + @Consumes(value={"application/json"}) + Mono logoutUser(); + /** + * Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param _body Updated user object (required) + */ + @Put(uri="/user/{username}") + @Produces(value={"application/json"}) + @Consumes(value={"application/json"}) + Mono updateUser( @PathVariable(name="username") @NotNull String username, - @Body @Valid @NotNull User _body + @Body @NotNull @Valid User _body ); } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index c727e3389ab..96ce13164ee 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesAnyType extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesAnyType() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.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 AdditionalPropertiesAnyType {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(this.name, additionalPropertiesAnyType.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 AdditionalPropertiesAnyType {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 749c516be0a..107272b74d1 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -36,69 +36,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesArray extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesArray() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.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 AdditionalPropertiesArray {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(this.name, additionalPropertiesArray.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 AdditionalPropertiesArray {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 859739c31a5..cfdb8791d0a 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesBoolean extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesBoolean() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.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 AdditionalPropertiesBoolean {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(this.name, additionalPropertiesBoolean.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 AdditionalPropertiesBoolean {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index aef32243b4e..8e130aca02e 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -47,411 +47,413 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesClass { - public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - private Map mapString = null; + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + private Map mapString = null; - public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - private Map mapNumber = null; + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + private Map mapNumber = null; - public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - private Map mapInteger = null; + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + private Map mapInteger = null; - public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; - private Map mapBoolean = null; + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + private Map mapBoolean = null; - public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; - private Map> mapArrayInteger = null; + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + private Map> mapArrayInteger = null; - public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; - private Map> mapArrayAnytype = null; + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + private Map> mapArrayAnytype = null; - public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; - private Map> mapMapString = null; + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + private Map> mapMapString = null; - public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; - private Map> mapMapAnytype = null; + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + private Map> mapMapAnytype = null; - public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - private Object anytype1; + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + private Object anytype1; - public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; - private Object anytype2; + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + private Object anytype2; - public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - private Object anytype3; + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + private Object anytype3; - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap(); + public AdditionalPropertiesClass() { } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapString() { - return mapString; - } - - @JsonProperty(JSON_PROPERTY_MAP_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; + return this; } - this.mapNumber.put(key, mapNumberItem); - return this; + + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap(); + } + this.mapString.put(key, mapStringItem); + return this; } - /** - * Get mapNumber - * @return mapNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapNumber() { - return mapNumber; - } - - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap(); + /** + * Get mapString + * @return mapString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapString() { + return mapString; } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - /** - * Get mapInteger - * @return mapInteger - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapInteger() { - return mapInteger; - } - - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap(); + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapString(Map mapString) { + this.mapString = mapString; } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - /** - * Get mapBoolean - * @return mapBoolean - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapBoolean() { - return mapBoolean; - } - - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap>(); + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + return this; } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; + + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap(); + } + this.mapNumber.put(key, mapNumberItem); + return this; } - /** - * Get mapArrayInteger - * @return mapArrayInteger - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap>(); + /** + * Get mapNumber + * @return mapNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapNumber() { + return mapNumber; } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap>(); + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - /** - * Get mapMapString - * @return mapMapString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapString() { - return mapMapString; - } - - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap>(); + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; + + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; } - /** - * Get mapMapAnytype - * @return mapMapAnytype - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getAnytype1() { - return anytype1; - } - - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getAnytype2() { - return anytype2; - } - - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getAnytype3() { - return anytype3; - } - - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get mapInteger + * @return mapInteger + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapInteger() { + return mapInteger; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).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(Object o) { - if (o == null) { - return "null"; + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; } - return o.toString().replace("\n", "\n "); + + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; } + /** + * Get mapBoolean + * @return mapBoolean + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapBoolean() { + return mapBoolean; + } + + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapString() { + return mapMapString; + } + + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { + return anytype1; + } + + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype2() { + return anytype2; + } + + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype3() { + return anytype3; + } + + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && + Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + } + + @Override + public int hashCode() { + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 5d6f4bcec0f..1e1c1f20731 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesInteger extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesInteger() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.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 AdditionalPropertiesInteger {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(this.name, additionalPropertiesInteger.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 AdditionalPropertiesInteger {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 88dfc96af1b..972cb4ae44d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -36,69 +36,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesNumber extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesNumber() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.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 AdditionalPropertiesNumber {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(this.name, additionalPropertiesNumber.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 AdditionalPropertiesNumber {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 393746a2f1d..1c3fe0f8626 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesObject extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesObject() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.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 AdditionalPropertiesObject {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(this.name, additionalPropertiesObject.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 AdditionalPropertiesObject {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index cefd74bd15d..732a70109db 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class AdditionalPropertiesString extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AdditionalPropertiesString() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.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 AdditionalPropertiesString {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(this.name, additionalPropertiesString.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 AdditionalPropertiesString {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java index 5225322d5c8..9920cdfda2d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Animal.java @@ -43,95 +43,97 @@ import javax.annotation.Generated; @Introspected public class Animal { - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - protected String className; + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + protected String className; - public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + 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 - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { - return className; - } - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { - return color; - } - - @JsonProperty(JSON_PROPERTY_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Animal() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Animal className(String className) { + this.className = className; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get className + * @return className + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { + return color; + } + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0388c7c5ae6..f8e35cafcb3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -36,75 +36,77 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ArrayOfArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = null; + 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>(); + public ArrayOfArrayOfNumberOnly() { } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 721d788bd90..0c81db857ce 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -36,75 +36,77 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = null; + 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(); + public ArrayOfNumberOnly() { } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayNumber() { - return arrayNumber; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + this.arrayNumber.add(arrayNumberItem); + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get arrayNumber + * @return arrayNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { + return arrayNumber; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java index 07578136d1e..91a150fa94d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ArrayTest.java @@ -38,147 +38,149 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected 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_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_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 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(); + public ArrayTest() { } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayOfString() { - return arrayOfString; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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>(); + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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>(); + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * Get arrayOfString + * @return arrayOfString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { + return arrayOfString; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; } - 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(Object o) { - if (o == null) { - return "null"; + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java index badc9384314..732353de97d 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCat.java @@ -35,104 +35,107 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class BigCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - TIGERS("tigers"), - LEOPARDS("leopards"), - JAGUARS("jaguars"); + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + TIGERS("tigers"), + LEOPARDS("leopards"), + JAGUARS("jaguars"); - private String value; + private String value; - KindEnum(String value) { - this.value = value; + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public BigCat() { + super(); + } + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get kind + * @return kind + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KindEnum getKind() { + return kind; + } + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public KindEnum getKind() { - return kind; - } - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java index cdc464b8e9d..f19a8935510 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -33,102 +33,104 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class BigCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - TIGERS("tigers"), - LEOPARDS("leopards"), - JAGUARS("jaguars"); + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + TIGERS("tigers"), + LEOPARDS("leopards"), + JAGUARS("jaguars"); - private String value; + private String value; - KindEnum(String value) { - this.value = value; + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public BigCatAllOf() { + } + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get kind + * @return kind + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KindEnum getKind() { + return kind; + } + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public KindEnum getKind() { - return kind; - } - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java index dd01342a8a6..312e637f866 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Capitalization.java @@ -38,207 +38,209 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Capitalization { - public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - private String smallCamel; + 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_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_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_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_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 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallCamel() { - return smallCamel; - } - - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalCamel() { - return capitalCamel; - } - - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallSnake() { - return smallSnake; - } - - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalSnake() { - return capitalSnake; - } - - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @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; - } - - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Capitalization() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get smallCamel + * @return smallCamel + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { + return smallCamel; + } + + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { + return capitalCamel; + } + + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { + return smallSnake; + } + + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { + return capitalSnake; + } + + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @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; + } + + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java index 8f9fe12d884..817807f86d7 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Cat.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Cat extends Animal { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { - return declawed; - } - - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Cat() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get declawed + * @return declawed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; + } + + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java index 4ee623d649b..6125a814c9b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/CatAllOf.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class CatAllOf { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { - return declawed; - } - - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public CatAllOf() { } - if (o == null || getClass() != o.getClass()) { - return false; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get declawed + * @return declawed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; + } + + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java index 552c577d79a..88978ee639c 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Category.java @@ -34,95 +34,97 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Category { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + 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 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Category() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Category id(Long id) { + this.id = id; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java index 2f94229b7e8..37dafc836ca 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ClassModel.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ClassModel { - public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - private String propertyClass; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { - return propertyClass; - } - - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ClassModel() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get propertyClass + * @return propertyClass + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java index 8bde5e0809e..53a7c64f13b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Dog.java @@ -35,69 +35,72 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Dog extends Animal { - public static final String JSON_PROPERTY_BREED = "breed"; - private String breed; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { - return breed; - } - - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Dog() { + super(); } - if (o == null || getClass() != o.getClass()) { - return false; + public Dog breed(String breed) { + this.breed = breed; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get breed + * @return breed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; + } + + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java index 51dec00ea10..3dba0d3bc20 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/DogAllOf.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class DogAllOf { - public static final String JSON_PROPERTY_BREED = "breed"; - private String breed; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { - return breed; - } - - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public DogAllOf() { } - if (o == null || getClass() != o.getClass()) { - return false; + public DogAllOf breed(String breed) { + this.breed = breed; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get breed + * @return breed + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; + } + + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java index c71f5edf0c4..9c72665e822 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumArrays.java @@ -36,169 +36,171 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class EnumArrays { - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - DOLLAR("$"); + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); - private String value; + private String value; - JustSymbolEnum(String value) { - this.value = 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() { + } + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get justSymbol + * @return justSymbol + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { + return arrayEnum; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(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() { - return String.valueOf(value); + 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(); } - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayEnum() { - return arrayEnum; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java index 1ee1b126d03..f01bfc41755 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumClass.java @@ -29,34 +29,34 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @Introspected public enum EnumClass { - _ABC("_abc"), - _EFG("-efg"), - _XYZ_("(xyz)"); + _ABC("_abc"), + _EFG("-efg"), + _XYZ_("(xyz)"); - private String value; + 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; - } + 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 + "'"); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java index 0b9c758a822..1168da6df50 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/EnumTest.java @@ -38,313 +38,315 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class EnumTest { - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - LOWER("lower"), - EMPTY(""); + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); - private String value; + private String value; - EnumStringEnum(String value) { - this.value = 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 OuterEnum outerEnum; + + public EnumTest() { + } + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get enumString + * @return enumString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { + return enumString; + } + + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { + return outerEnum; + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + @Override + public boolean equals(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); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } @Override public String toString() { - return String.valueOf(value); + 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("}"); + return sb.toString(); } - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - 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 OuterEnum outerEnum; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumStringEnum getEnumString() { - return enumString; - } - - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(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); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @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("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 9e250b52efc..b1f30f1a4fc 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -37,104 +37,106 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class FileSchemaTestClass { - public static final String JSON_PROPERTY_FILE = "file"; - private ModelFile _file; + public static final String JSON_PROPERTY_FILE = "file"; + private ModelFile _file; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public FileSchemaTestClass _file(ModelFile _file) { - this._file = _file; - return this; - } - - /** - * Get _file - * @return _file - **/ - @Valid - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ModelFile getFile() { - return _file; - } - - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFile(ModelFile _file) { - this._file = _file; - } - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(ModelFile filesItem) { - if (this.files == null) { - this.files = new ArrayList(); + public FileSchemaTestClass() { } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { - return files; - } - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get _file + * @return _file + **/ + @Valid + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelFile getFile() { + return _file; } - 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(Object o) { - if (o == null) { - return "null"; + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java index 239ef22ecb2..83555236ab5 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/FormatTest.java @@ -51,457 +51,459 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class FormatTest { - public static final String JSON_PROPERTY_INTEGER = "integer"; - private Integer integer; + 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_INT32 = "int32"; + private Integer int32; - public static final String JSON_PROPERTY_INT64 = "int64"; - private Long int64; + 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_NUMBER = "number"; + private BigDecimal number; - public static final String JSON_PROPERTY_FLOAT = "float"; - private Float _float; + 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_DOUBLE = "double"; + private Double _double; - public static final String JSON_PROPERTY_STRING = "string"; - private String string; + 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_BYTE = "byte"; + private byte[] _byte; - public static final String JSON_PROPERTY_BINARY = "binary"; - private File binary; + 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 = "date"; + private LocalDate date; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private LocalDateTime dateTime; + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private LocalDateTime dateTime; - public static final String JSON_PROPERTY_UUID = "uuid"; - private UUID uuid; + 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_PASSWORD = "password"; + private String password; - public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; - private BigDecimal bigDecimal; + public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; + private BigDecimal bigDecimal; - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - **/ - @Nullable - @Min(10) - @Max(100) - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInteger() { - return integer; - } - - @JsonProperty(JSON_PROPERTY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @Min(20) - @Max(200) - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INT32) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInt32() { - return int32; - } - - @JsonProperty(JSON_PROPERTY_INT32) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INT64) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getInt64() { - return int64; - } - - @JsonProperty(JSON_PROPERTY_INT64) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @NotNull - @DecimalMin("32.1") - @DecimalMax("543.2") - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumber() { - return number; - } - - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - 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 - **/ - @Nullable - @DecimalMin("54.3") - @DecimalMax("987.6") - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FLOAT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Float getFloat() { - return _float; - } - - @JsonProperty(JSON_PROPERTY_FLOAT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @DecimalMin("67.8") - @DecimalMax("123.4") - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDouble() { - return _double; - } - - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @Nullable - @Pattern(regexp="/[a-z]/i") - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getString() { - return string; - } - - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_BYTE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public byte[] getByte() { - return _byte; - } - - @JsonProperty(JSON_PROPERTY_BYTE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(File binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BINARY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getBinary() { - return binary; - } - - @JsonProperty(JSON_PROPERTY_BINARY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBinary(File binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - public LocalDate getDate() { - return date; - } - - @JsonProperty(JSON_PROPERTY_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public LocalDateTime getDateTime() { - return dateTime; - } - - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public void setDateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @Nullable - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { - return uuid; - } - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @NotNull - @Size(min=10, max=64) - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public FormatTest() { } - if (o == null || getClass() != o.getClass()) { - return false; + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; } - 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.bigDecimal, formatTest.bigDecimal); - } - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @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(" bigDecimal: ").append(toIndentedString(bigDecimal)).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(Object o) { - if (o == null) { - return "null"; + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @Nullable + @Min(10) + @Max(100) + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { + return integer; + } + + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @Min(20) + @Max(200) + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { + return int32; + } + + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { + return int64; + } + + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { + return number; + } + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 + **/ + @Nullable + @DecimalMin("54.3") + @DecimalMax("987.6") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { + return _float; + } + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @DecimalMin("67.8") + @DecimalMax("123.4") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { + return _double; + } + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @Nullable + @Pattern(regexp="/[a-z]/i") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { + return string; + } + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { + return _byte; + } + + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { + return binary; + } + + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + public LocalDate getDate() { + return date; + } + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getDateTime() { + return dateTime; + } + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setDateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @Nullable + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @NotNull + @Size(min=10, max=64) + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + @Override + public boolean equals(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.bigDecimal, formatTest.bigDecimal); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + } + + @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(" bigDecimal: ").append(toIndentedString(bigDecimal)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 43e713b0305..0de28c49786 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -34,73 +34,75 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class HasOnlyReadOnly { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; - public static final String JSON_PROPERTY_FOO = "foo"; - private String foo; + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; - /** - * Get bar - * @return bar - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { - return bar; - } - - /** - * Get foo - * @return foo - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FOO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFoo() { - return foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public HasOnlyReadOnly() { } - if (o == null || getClass() != o.getClass()) { - return false; + /** + * Get bar + * @return bar + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get foo + * @return foo + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { + return foo; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java index 259929412b2..57112ef976a 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MapTest.java @@ -39,216 +39,218 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class MapTest { - public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - private Map> mapMapOfString = null; + 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"); + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + LOWER("lower"); - private String value; + private String value; - InnerEnum(String value) { - this.value = 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() { + } + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; } - @JsonValue - public String getValue() { - return value; + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { + return mapMapOfString; + } + + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { + return directMap; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { + return indirectMap; + } + + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(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() { - return String.valueOf(value); + 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(); } - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getDirectMap() { - return directMap; - } - - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getIndirectMap() { - return indirectMap; - } - - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4f546fae5f9..46e2e81f47a 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -41,133 +41,135 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class MixedPropertiesAndAdditionalPropertiesClass { - public static final String JSON_PROPERTY_UUID = "uuid"; - private UUID uuid; + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private LocalDateTime dateTime; + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private LocalDateTime dateTime; - public static final String JSON_PROPERTY_MAP = "map"; - private Map map = null; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { - return uuid; - } - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public LocalDateTime getDateTime() { - return dateTime; - } - - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public void setDateTime(LocalDateTime 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(); + public MixedPropertiesAndAdditionalPropertiesClass() { } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMap() { - return map; - } - - @JsonProperty(JSON_PROPERTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get uuid + * @return uuid + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; } - 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(Object o) { - if (o == null) { - return "null"; + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; } - return o.toString().replace("\n", "\n "); + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getDateTime() { + return dateTime; + } + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setDateTime(LocalDateTime 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { + return map; + } + + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java index 34604b7b3bf..05141ad7076 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Model200Response.java @@ -35,95 +35,97 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Model200Response { - public static final String JSON_PROPERTY_NAME = "name"; - private Integer name; + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; - public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - private String propertyClass; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { - return propertyClass; - } - - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Model200Response() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Model200Response name(Integer name) { + this.name = name; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java index 7d185d9d0ba..33e9cd2305f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -35,123 +35,125 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelApiResponse { - public static final String JSON_PROPERTY_CODE = "code"; - private Integer code; + 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_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCode() { - return code; - } - - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { - return type; - } - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelApiResponse() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelApiResponse code(Integer code) { + this.code = code; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get code + * @return code + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java index af4f73af5cc..936ddd4a2df 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelClient.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelClient { - public static final String JSON_PROPERTY_CLIENT = "client"; - private String _client; + public static final String JSON_PROPERTY_CLIENT = "client"; + private String _client; - public ModelClient _client(String _client) { - this._client = _client; - return this; - } - - /** - * Get _client - * @return _client - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CLIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClient() { - return _client; - } - - @JsonProperty(JSON_PROPERTY_CLIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClient(String _client) { - this._client = _client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelClient() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelClient _client(String _client) { + this._client = _client; + return this; } - ModelClient _client = (ModelClient) 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 ModelClient {\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(Object o) { - if (o == null) { - return "null"; + /** + * Get _client + * @return _client + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return _client; + } + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(String _client) { + this._client = _client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelClient _client = (ModelClient) 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 ModelClient {\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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java index 7112952184c..b4d40ff9b65 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelFile { - public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; - private String sourceURI; + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - **/ - @Nullable - @ApiModelProperty(value = "Test capitalization") - @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSourceURI() { - return sourceURI; - } - - @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelFile() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { - if (o == null) { - return "null"; + /** + * Test capitalization + * @return sourceURI + **/ + @Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java index 9aa652a72ee..6c48df8fe43 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelList { - public static final String JSON_PROPERTY_123LIST = "123-list"; - private String _123list; + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_123LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String get123list() { - return _123list; - } - - @JsonProperty(JSON_PROPERTY_123LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelList() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).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(Object o) { - if (o == null) { - return "null"; + /** + * Get _123list + * @return _123list + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; + } + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java index 2688ecad262..be60946ba7f 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelReturn.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ModelReturn { - public static final String JSON_PROPERTY_RETURN = "return"; - private Integer _return; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_RETURN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getReturn() { - return _return; - } - - @JsonProperty(JSON_PROPERTY_RETURN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ModelReturn() { } - if (o == null || getClass() != o.getClass()) { - return false; + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get _return + * @return _return + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { + return _return; + } + + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java index 018d3cf558e..401002e5de2 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Name.java @@ -37,129 +37,131 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Name { - public static final String JSON_PROPERTY_NAME = "name"; - private Integer 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_SNAKE_CASE = "snake_case"; + private Integer snakeCase; - public static final String JSON_PROPERTY_PROPERTY = "property"; - private String property; + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; - public static final String JSON_PROPERTY_123NUMBER = "123Number"; - private Integer _123number; + 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 - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(Integer name) { - this.name = name; - } - - /** - * Get snakeCase - * @return snakeCase - **/ - @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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProperty() { - return property; - } - - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperty(String property) { - this.property = property; - } - - /** - * Get _123number - * @return _123number - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_123NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer get123number() { - return _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Name() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Name name(Integer name) { + this.name = name; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(Integer name) { + this.name = name; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { + return property; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(String property) { + this.property = property; + } + + /** + * Get _123number + * @return _123number + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { + return _123number; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java index e4197f390e5..9b3e86e34e3 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/NumberOnly.java @@ -34,67 +34,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class NumberOnly { - public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - private BigDecimal justNumber; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getJustNumber() { - return justNumber; - } - - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public NumberOnly() { } - if (o == null || getClass() != o.getClass()) { - return false; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get justNumber + * @return justNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { + return justNumber; + } + + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java index 8ecdbda1260..801a4d52c66 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Order.java @@ -39,243 +39,245 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Order { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + 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_PET_ID = "petId"; + private Long petId; - public static final String JSON_PROPERTY_QUANTITY = "quantity"; - private Integer quantity; + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; - public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - private LocalDateTime shipDate; + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private LocalDateTime shipDate; - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); - private String value; + private String value; - StatusEnum(String value) { - this.value = 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() { + } + public Order id(Long id) { + this.id = id; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getShipDate() { + return shipDate; + } + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setShipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @Nullable + @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(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() { - return String.valueOf(value); + 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(); } - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PET_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getPetId() { - return petId; - } - - @JsonProperty(JSON_PROPERTY_PET_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getQuantity() { - return quantity; - } - - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(LocalDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public LocalDateTime getShipDate() { - return shipDate; - } - - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") - public void setShipDate(LocalDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - **/ - @Nullable - @ApiModelProperty(value = "Order Status") - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { - return status; - } - - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getComplete() { - return complete; - } - - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java index 4c41ddc658f..96fd146e253 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterComposite.java @@ -36,123 +36,125 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class OuterComposite { - public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - private BigDecimal myNumber; + 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_STRING = "my_string"; + private String myString; - public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - private Boolean myBoolean; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getMyNumber() { - return myNumber; - } - - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMyString() { - return myString; - } - - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMyBoolean() { - return myBoolean; - } - - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public OuterComposite() { } - if (o == null || getClass() != o.getClass()) { - return false; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get myNumber + * @return myNumber + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { + return myNumber; + } + + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { + return myString; + } + + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { + return myBoolean; + } + + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java index 76fe37007e9..5cf96d10932 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/OuterEnum.java @@ -29,34 +29,34 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @Introspected public enum OuterEnum { - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); - private String value; + 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; - } + 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; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java index f142a57afdd..fa4dec4b495 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Pet.java @@ -45,257 +45,258 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Pet { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + 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_CATEGORY = "category"; + private Category category; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private Set photoUrls = new LinkedHashSet(); + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private Set photoUrls = new LinkedHashSet(); - public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = null; + 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"); + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); - private String value; + private String value; - StatusEnum(String value) { - this.value = 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() { + } + public Pet id(Long id) { + this.id = id; + return this; } - @JsonValue - public String getValue() { - return value; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @Valid + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Set getPhotoUrls() { + return photoUrls; + } + + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(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() { - return String.valueOf(value); + 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(); } - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - **/ - @Valid - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { - return category; - } - - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { - return tags; - } - - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - **/ - @Nullable - @ApiModelProperty(value = "pet status in the store") - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { - return status; - } - - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(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(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java index a9827ceca00..38133c13c8e 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -34,84 +34,86 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class ReadOnlyFirst { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; - public static final String JSON_PROPERTY_BAZ = "baz"; - private String baz; + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; - /** - * Get bar - * @return bar - **/ - @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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BAZ) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBaz() { - return baz; - } - - @JsonProperty(JSON_PROPERTY_BAZ) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ReadOnlyFirst() { } - if (o == null || getClass() != o.getClass()) { - return false; + /** + * Get bar + * @return bar + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - 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(Object o) { - if (o == null) { - return "null"; + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { + return baz; + } + + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java index 0845ebff638..d0a8db4de8b 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/SpecialModelName.java @@ -33,67 +33,69 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class SpecialModelName { - public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - private Long $specialPropertyName; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public SpecialModelName() { } - if (o == null || getClass() != o.getClass()) { - return false; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java index eee95fd360d..7163b186331 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/Tag.java @@ -34,95 +34,97 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class Tag { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + 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 - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public Tag() { } - if (o == null || getClass() != o.getClass()) { - return false; + public Tag id(Long id) { + this.id = id; + return this; } - 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(Object o) { - if (o == null) { - return "null"; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7475ae2ec45..47b47122e39 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -40,184 +40,186 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class TypeHolderDefault { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - private String stringItem = "what"; + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + private String stringItem = "what"; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - private BigDecimal numberItem; + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + private BigDecimal numberItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - private Integer integerItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - private Boolean boolItem = true; + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + private Boolean boolItem = true; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList(); - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getStringItem() { - return stringItem; - } - - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumberItem() { - return numberItem; - } - - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getIntegerItem() { - return integerItem; - } - - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getBoolItem() { - return boolItem; - } - - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @NotNull - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getArrayItem() { - return arrayItem; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TypeHolderDefault() { } - if (o == null || getClass() != o.getClass()) { - return false; + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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(Object o) { - if (o == null) { - return "null"; + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { + return stringItem; + } + + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { + return numberItem; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { + return integerItem; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { + return boolItem; + } + + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { + return arrayItem; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && + Objects.equals(this.numberItem, typeHolderDefault.numberItem) && + Objects.equals(this.integerItem, typeHolderDefault.integerItem) && + Objects.equals(this.boolItem, typeHolderDefault.boolItem) && + Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java index 539ef489b97..be1a7351861 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -41,212 +41,214 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class TypeHolderExample { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - private String stringItem; + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + private String stringItem; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - private BigDecimal numberItem; + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + private BigDecimal numberItem; - public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; - private Float floatItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - private Integer integerItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - private Boolean boolItem; + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + private Boolean boolItem; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList(); - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @NotNull - @ApiModelProperty(example = "what", required = true, value = "") - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getStringItem() { - return stringItem; - } - - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumberItem() { - return numberItem; - } - - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - **/ - @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Float getFloatItem() { - return floatItem; - } - - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getIntegerItem() { - return integerItem; - } - - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @NotNull - @ApiModelProperty(example = "true", required = true, value = "") - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getBoolItem() { - return boolItem; - } - - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getArrayItem() { - return arrayItem; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TypeHolderExample() { } - if (o == null || getClass() != o.getClass()) { - return false; + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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(Object o) { - if (o == null) { - return "null"; + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { + return stringItem; + } + + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { + return numberItem; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @NotNull + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Float getFloatItem() { + return floatItem; + } + + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { + return integerItem; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { + return boolItem; + } + + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { + return arrayItem; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(this.stringItem, typeHolderExample.stringItem) && + Objects.equals(this.numberItem, typeHolderExample.numberItem) && + Objects.equals(this.floatItem, typeHolderExample.floatItem) && + Objects.equals(this.integerItem, typeHolderExample.integerItem) && + Objects.equals(this.boolItem, typeHolderExample.boolItem) && + Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java index caea2374d87..fedc16d2919 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/User.java @@ -40,263 +40,265 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class User { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + 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_USERNAME = "username"; + private String username; - public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - private String firstName; + 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_LAST_NAME = "lastName"; + private String lastName; - public static final String JSON_PROPERTY_EMAIL = "email"; - private String email; + 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_PASSWORD = "password"; + private String password; - public static final String JSON_PROPERTY_PHONE = "phone"; - private String phone; + 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_USER_STATUS = "userStatus"; + private Integer userStatus; - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { - return id; - } - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUsername() { - return username; - } - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFirstName() { - return firstName; - } - - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLastName() { - return lastName; - } - - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_EMAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmail() { - return email; - } - - @JsonProperty(JSON_PROPERTY_EMAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPassword() { - return password; - } - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPhone() { - return phone; - } - - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - **/ - @Nullable - @ApiModelProperty(value = "User Status") - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUserStatus() { - return userStatus; - } - - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public User() { } - if (o == null || getClass() != o.getClass()) { - return false; + public User id(Long id) { + this.id = id; + return this; } - 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); - } - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @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("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @Nullable + @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java index 5ef91590040..351e04063b0 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/XmlItem.java @@ -64,923 +64,925 @@ import javax.annotation.Generated; @Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") @Introspected public class XmlItem { - public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - private String attributeString; + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + private String attributeString; - public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - private BigDecimal attributeNumber; + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + private BigDecimal attributeNumber; - public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - private Integer attributeInteger; + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + private Integer attributeInteger; - public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - private Boolean attributeBoolean; + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + private Boolean attributeBoolean; - public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = null; + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + private List wrappedArray = null; - public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - private String nameString; + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + private String nameString; - public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - private BigDecimal nameNumber; + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + private BigDecimal nameNumber; - public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - private Integer nameInteger; + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + private Integer nameInteger; - public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - private Boolean nameBoolean; + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + private Boolean nameBoolean; - public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = null; + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + private List nameArray = null; - public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = null; + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + private List nameWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - private String prefixString; + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + private String prefixString; - public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - private BigDecimal prefixNumber; + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + private BigDecimal prefixNumber; - public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - private Integer prefixInteger; + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + private Integer prefixInteger; - public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - private Boolean prefixBoolean; + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + private Boolean prefixBoolean; - public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = null; + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + private List prefixArray = null; - public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = null; + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + private List prefixWrappedArray = null; - public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - private String namespaceString; + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + private String namespaceString; - public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - private BigDecimal namespaceNumber; + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + private BigDecimal namespaceNumber; - public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - private Integer namespaceInteger; + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + private Integer namespaceInteger; - public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - private Boolean namespaceBoolean; + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + private Boolean namespaceBoolean; - public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = null; + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + private List namespaceArray = null; - public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = null; + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + private List namespaceWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - private String prefixNsString; + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + private String prefixNsString; - public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - private BigDecimal prefixNsNumber; + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + private BigDecimal prefixNsNumber; - public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - private Integer prefixNsInteger; + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + private Integer prefixNsInteger; - public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - private Boolean prefixNsBoolean; + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + private Boolean prefixNsBoolean; - public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = null; + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + private List prefixNsArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = null; + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + private List prefixNsWrappedArray = null; - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAttributeString() { - return attributeString; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getAttributeInteger() { - return attributeInteger; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList(); + public XmlItem() { } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getWrappedArray() { - return wrappedArray; - } - - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNameString() { - return nameString; - } - - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getNameNumber() { - return nameNumber; - } - - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNameInteger() { - return nameInteger; - } - - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getNameBoolean() { - return nameBoolean; - } - - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList(); + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; } - this.nameArray.add(nameArrayItem); - return this; - } - /** - * Get nameArray - * @return nameArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNameArray() { - return nameArray; - } - - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList(); + /** + * Get attributeString + * @return attributeString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { + return attributeString; } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - /** - * Get nameWrappedArray - * @return nameWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNameWrappedArray() { - return nameWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrefixString() { - return prefixString; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPrefixInteger() { - return prefixInteger; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; } - this.prefixArray.add(prefixArrayItem); - return this; - } - /** - * Get prefixArray - * @return prefixArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixArray() { - return prefixArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList(); + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getNamespaceString() { - return namespaceString; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList(); + /** + * Get attributeNumber + * @return attributeNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { + return attributeNumber; } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - /** - * Get namespaceArray - * @return namespaceArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNamespaceArray() { - return namespaceArray; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - **/ - @Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPrefixNsString() { - return prefixNsString; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - **/ - @Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - **/ - @Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - **/ - @Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList(); + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - /** - * Get prefixNsArray - * @return prefixNsArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixNsArray() { - return prefixNsArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList(); + /** + * Get attributeInteger + * @return attributeInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { + return attributeInteger; } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - **/ - @Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; } - if (o == null || getClass() != o.getClass()) { - return false; + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).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(Object o) { - if (o == null) { - return "null"; + /** + * Get attributeBoolean + * @return attributeBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList(); + } + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { + return wrappedArray; + } + + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { + return nameString; + } + + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { + return nameNumber; + } + + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { + return nameInteger; + } + + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { + return nameBoolean; + } + + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList(); + } + this.nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { + return nameArray; + } + + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList(); + } + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { + return nameWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { + return prefixString; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { + return prefixInteger; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList(); + } + this.prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { + return prefixArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList(); + } + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { + return namespaceString; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList(); + } + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { + return namespaceArray; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList(); + } + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + **/ + @Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { + return prefixNsString; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + **/ + @Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + **/ + @Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + **/ + @Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList(); + } + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { + return prefixNsArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList(); + } + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(this.attributeString, xmlItem.attributeString) && + Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && + Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && + Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && + Objects.equals(this.nameString, xmlItem.nameString) && + Objects.equals(this.nameNumber, xmlItem.nameNumber) && + Objects.equals(this.nameInteger, xmlItem.nameInteger) && + Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && + Objects.equals(this.nameArray, xmlItem.nameArray) && + Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(this.prefixString, xmlItem.prefixString) && + Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && + Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && + Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(this.prefixArray, xmlItem.prefixArray) && + Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(this.namespaceString, xmlItem.namespaceString) && + Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && + Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && + Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } } diff --git a/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml b/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml index bf9e0df6cad..49d8cc32a02 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml +++ b/samples/client/petstore/java-micronaut-client/src/main/resources/application.yml @@ -1,5 +1,5 @@ -base-path: "http://petstore.swagger.io:80/v2" -context-path: "/v2" +base-path: "http://petstore.swagger.io:80/v2/" +context-path: "/v2/" micronaut: application: diff --git a/samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml b/samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml new file mode 100644 index 00000000000..82218708264 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/main/resources/logback.xml @@ -0,0 +1,15 @@ + + + + false + + + %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/.gitignore b/samples/server/petstore/java-micronaut-server/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.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/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 00000000000..fc435c409b3 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,124 @@ +/* + * Copyright 2007-present 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. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.Authenticator; +import java.net.PasswordAuthentication; +import java.net.URL; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.6"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties new file mode 100644 index 00000000000..642d572ce90 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.mvn/wrapper/maren-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/samples/server/petstore/java-micronaut-server/.openapi-generator-ignore b/samples/server/petstore/java-micronaut-server/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.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/server/petstore/java-micronaut-server/.openapi-generator/FILES b/samples/server/petstore/java-micronaut-server/.openapi-generator/FILES new file mode 100644 index 00000000000..c1595591bf4 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.openapi-generator/FILES @@ -0,0 +1,36 @@ +.gitignore +.mvn/wrapper/MavenWrapperDownloader.java +.mvn/wrapper/maren-wrapper.properties +.mvn/wrapper/maven-wrapper.jar +README.md +build.gradle +docs/controllers/PetController.md +docs/controllers/StoreController.md +docs/controllers/UserController.md +docs/models/Category.md +docs/models/ModelApiResponse.md +docs/models/Order.md +docs/models/Pet.md +docs/models/Tag.md +docs/models/User.md +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +mvnw +mvnw.bat +pom.xml +settings.gradle +src/main/java/org/openapitools/Application.java +src/main/java/org/openapitools/controller/PetController.java +src/main/java/org/openapitools/controller/StoreController.java +src/main/java/org/openapitools/controller/UserController.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java +src/main/resources/application.yml +src/main/resources/logback.xml diff --git a/samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION b/samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/README.md b/samples/server/petstore/java-micronaut-server/README.md new file mode 100644 index 00000000000..7f5a8dd218e --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/README.md @@ -0,0 +1,27 @@ +# petstore-micronaut-server + +This is a generated server based on [Micronaut](https://micronaut.io/) framework. + +## Configuration + +To run the whole application, use [Application.java](src/main/java/org/openapitools/Application.java) as main class. + +Read **[Micronaut Guide](https://docs.micronaut.io/latest/guide/#ideSetup)** for detailed description on IDE setup and Micronaut Framework features. + +All the properties can be changed in the [application.yml](src/main/resources/application.yml) file or when creating micronaut application as described in **[Micronaut Guide - Configuration Section](https://docs.micronaut.io/latest/guide/#config)**. + +## Controller Guides + +Description on how to create Apis is given inside individual api guides: + +* [PetController](docs/controllers/PetController.md) +* [StoreController](docs/controllers/StoreController.md) +* [UserController](docs/controllers/UserController.md) + +## Author + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/build.gradle b/samples/server/petstore/java-micronaut-server/build.gradle new file mode 100644 index 00000000000..29b6603f793 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/build.gradle @@ -0,0 +1,43 @@ +plugins { + id("groovy") + id("com.github.johnrengelman.shadow") version "7.1.1" + id("io.micronaut.application") version "3.1.1" +} + +version = "1.0.0" +group = "org.openapitools" + +repositories { + mavenCentral() +} + +micronaut { + runtime("netty") + testRuntime("spock2") + processing { + incremental(true) + annotations("org.openapitools.*") + } +} + + +dependencies { + annotationProcessor("io.micronaut:micronaut-http-validation") + implementation("io.micronaut:micronaut-http-client") + implementation("io.micronaut:micronaut-runtime") + implementation("io.micronaut:micronaut-validation") + implementation("io.micronaut.reactor:micronaut-reactor") + implementation("io.swagger:swagger-annotations:1.5.9") + runtimeOnly("ch.qos.logback:logback-classic") +} + +// TODO Set the main class +application { + mainClass.set("org.openapitools.Application") +} +java { + sourceCompatibility = JavaVersion.toVersion("1.8") + targetCompatibility = JavaVersion.toVersion("1.8") +} + +graalvmNative.toolchainDetection = false diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md new file mode 100644 index 00000000000..da831a4f13b --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/PetController.md @@ -0,0 +1,208 @@ +# PetController + +All URIs are relative to `"/v2"` + +The controller class is defined in **[PetController.java](../../src/main/java/org/openapitools/controller/PetController.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```java +Mono PetController.addPet(pet) +``` + +Add a new pet to the store + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**pet** | [**Pet**](../../docs/models/Pet.md) | Pet object that needs to be added to the store | + +### Return type +[**Pet**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `application/json`, `application/xml` + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **deletePet** +```java +Mono PetController.deletePet(petIdapiKey) +``` + +Deletes a pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | Pet id to delete | +**apiKey** | `String` | | [optional parameter] + + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **findPetsByStatus** +```java +Mono> PetController.findPetsByStatus(status) +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**status** | [**List<String>**](../../docs/models/String.md) | Status values that need to be considered for filter | [enum: `available`, `pending`, `sold`] + +### Return type +[**List<Pet>**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **findPetsByTags** +```java +Mono> PetController.findPetsByTags(tags) +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**tags** | [**List<String>**](../../docs/models/String.md) | Tags to filter by | + +### Return type +[**List<Pet>**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **getPetById** +```java +Mono PetController.getPetById(petId) +``` + +Find pet by ID + +Returns a single pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | ID of pet to return | + +### Return type +[**Pet**](../../docs/models/Pet.md) + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **updatePet** +```java +Mono PetController.updatePet(pet) +``` + +Update an existing pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**pet** | [**Pet**](../../docs/models/Pet.md) | Pet object that needs to be added to the store | + +### Return type +[**Pet**](../../docs/models/Pet.md) + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `application/json`, `application/xml` + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **updatePetWithForm** +```java +Mono PetController.updatePetWithForm(petIdnamestatus) +``` + +Updates a pet in the store with form data + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | ID of pet that needs to be updated | +**name** | `String` | Updated name of the pet | [optional parameter] +**status** | `String` | Updated status of the pet | [optional parameter] + + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `application/x-www-form-urlencoded` + - **Produces Content-Type**: Not defined + + +# **uploadFile** +```java +Mono PetController.uploadFile(petIdadditionalMetadata_file) +``` + +uploads an image + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**petId** | `Long` | ID of pet to update | +**additionalMetadata** | `String` | Additional data to pass to server | [optional parameter] +**_file** | `CompletedFileUpload` | file to upload | [optional parameter] + +### Return type +[**ModelApiResponse**](../../docs/models/ModelApiResponse.md) + +### Authorization +* **petstore_auth**, scopes: `write:pets`, `read:pets` + +### HTTP request headers + - **Accepts Content-Type**: `multipart/form-data` + - **Produces Content-Type**: `application/json` + diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md new file mode 100644 index 00000000000..0cc9c7f0a20 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/StoreController.md @@ -0,0 +1,99 @@ +# StoreController + +All URIs are relative to `"/v2"` + +The controller class is defined in **[StoreController.java](../../src/main/java/org/openapitools/controller/StoreController.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```java +Mono StoreController.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 + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**orderId** | `String` | ID of the order that needs to be deleted | + + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **getInventory** +```java +Mono> StoreController.getInventory() +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + + +### Return type +`Map<String, Integer>` + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/json` + + +# **getOrderById** +```java +Mono StoreController.getOrderById(orderId) +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**orderId** | `Long` | ID of pet that needs to be fetched | + +### Return type +[**Order**](../../docs/models/Order.md) + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **placeOrder** +```java +Mono StoreController.placeOrder(order) +``` + +Place an order for a pet + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**order** | [**Order**](../../docs/models/Order.md) | order placed for purchasing the pet | + +### Return type +[**Order**](../../docs/models/Order.md) + + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: `application/xml`, `application/json` + diff --git a/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md b/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md new file mode 100644 index 00000000000..31012f2b441 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/controllers/UserController.md @@ -0,0 +1,189 @@ +# UserController + +All URIs are relative to `"/v2"` + +The controller class is defined in **[UserController.java](../../src/main/java/org/openapitools/controller/UserController.java)** + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```java +Mono UserController.createUser(user) +``` + +Create user + +This can only be done by the logged in user. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user** | [**User**](../../docs/models/User.md) | Created user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + + +# **createUsersWithArrayInput** +```java +Mono UserController.createUsersWithArrayInput(user) +``` + +Creates list of users with given input array + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user** | [**List<User>**](../../docs/models/User.md) | List of user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + + +# **createUsersWithListInput** +```java +Mono UserController.createUsersWithListInput(user) +``` + +Creates list of users with given input array + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**user** | [**List<User>**](../../docs/models/User.md) | List of user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + + +# **deleteUser** +```java +Mono UserController.deleteUser(username) +``` + +Delete user + +This can only be done by the logged in user. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | The name that needs to be deleted | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **getUserByName** +```java +Mono UserController.getUserByName(username) +``` + +Get user by user name + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | The name that needs to be fetched. Use user1 for testing. | + +### Return type +[**User**](../../docs/models/User.md) + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **loginUser** +```java +Mono UserController.loginUser(usernamepassword) +``` + +Logs user into the system + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | The user name for login | +**password** | `String` | The password for login in clear text | + +### Return type +`String` + + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: `application/xml`, `application/json` + + +# **logoutUser** +```java +Mono UserController.logoutUser() +``` + +Logs out current logged in user session + + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: Not defined + - **Produces Content-Type**: Not defined + + +# **updateUser** +```java +Mono UserController.updateUser(usernameuser) +``` + +Updated user + +This can only be done by the logged in user. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**username** | `String` | name that need to be deleted | +**user** | [**User**](../../docs/models/User.md) | Updated user object | + + +### Authorization +* **api_key** + +### HTTP request headers + - **Accepts Content-Type**: `application/json` + - **Produces Content-Type**: Not defined + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Category.md b/samples/server/petstore/java-micronaut-server/docs/models/Category.md new file mode 100644 index 00000000000..65cdd608ada --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Category.md @@ -0,0 +1,18 @@ + + +# Category + +A category for a pet + +The class is defined in **[Category.java](../../src/main/java/org/openapitools/model/Category.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**name** | `String` | | [optional property] + + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md b/samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md new file mode 100644 index 00000000000..be3226fa260 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/ModelApiResponse.md @@ -0,0 +1,20 @@ + + +# ModelApiResponse + +Describes the result of uploading an image resource + +The class is defined in **[ModelApiResponse.java](../../src/main/java/org/openapitools/model/ModelApiResponse.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | `Integer` | | [optional property] +**type** | `String` | | [optional property] +**message** | `String` | | [optional property] + + + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Order.md b/samples/server/petstore/java-micronaut-server/docs/models/Order.md new file mode 100644 index 00000000000..b514feb22d0 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Order.md @@ -0,0 +1,33 @@ + + +# Order + +An order for a pets from the pet store + +The class is defined in **[Order.java](../../src/main/java/org/openapitools/model/Order.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**petId** | `Long` | | [optional property] +**quantity** | `Integer` | | [optional property] +**shipDate** | `LocalDateTime` | | [optional property] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional property] +**complete** | `Boolean` | | [optional property] + + + + + +## StatusEnum + +Name | Value +---- | ----- +PLACED | `"placed"` +APPROVED | `"approved"` +DELIVERED | `"delivered"` + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Pet.md b/samples/server/petstore/java-micronaut-server/docs/models/Pet.md new file mode 100644 index 00000000000..9f8876b0df5 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Pet.md @@ -0,0 +1,33 @@ + + +# Pet + +A pet for sale in the pet store + +The class is defined in **[Pet.java](../../src/main/java/org/openapitools/model/Pet.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**category** | [`Category`](Category.md) | | [optional property] +**name** | `String` | | +**photoUrls** | `List<String>` | | +**tags** | [`List<Tag>`](Tag.md) | | [optional property] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional property] + + + + + + +## StatusEnum + +Name | Value +---- | ----- +AVAILABLE | `"available"` +PENDING | `"pending"` +SOLD | `"sold"` + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/Tag.md b/samples/server/petstore/java-micronaut-server/docs/models/Tag.md new file mode 100644 index 00000000000..557c72572a2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/Tag.md @@ -0,0 +1,18 @@ + + +# Tag + +A tag for a pet + +The class is defined in **[Tag.java](../../src/main/java/org/openapitools/model/Tag.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**name** | `String` | | [optional property] + + + + diff --git a/samples/server/petstore/java-micronaut-server/docs/models/User.md b/samples/server/petstore/java-micronaut-server/docs/models/User.md new file mode 100644 index 00000000000..dac90ef84e7 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/docs/models/User.md @@ -0,0 +1,30 @@ + + +# User + +A User who is purchasing from the pet store + +The class is defined in **[User.java](../../src/main/java/org/openapitools/model/User.java)** + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | `Long` | | [optional property] +**username** | `String` | | [optional property] +**firstName** | `String` | | [optional property] +**lastName** | `String` | | [optional property] +**email** | `String` | | [optional property] +**password** | `String` | | [optional property] +**phone** | `String` | | [optional property] +**userStatus** | `Integer` | User Status | [optional property] + + + + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/gradle.properties b/samples/server/petstore/java-micronaut-server/gradle.properties new file mode 100644 index 00000000000..70b9dde78f1 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradle.properties @@ -0,0 +1 @@ +micronautVersion=3.2.6 \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.jar b/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties b/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..f2e1eb1fd47 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip diff --git a/samples/server/petstore/java-micronaut-server/gradlew b/samples/server/petstore/java-micronaut-server/gradlew new file mode 100644 index 00000000000..4f906e0c811 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradlew @@ -0,0 +1,185 @@ +#!/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/server/petstore/java-micronaut-server/gradlew.bat b/samples/server/petstore/java-micronaut-server/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/gradlew.bat @@ -0,0 +1,89 @@ +@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 Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@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 execute + +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 execute + +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 + +: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 %* + +: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/server/petstore/java-micronaut-server/mvnw b/samples/server/petstore/java-micronaut-server/mvnw new file mode 100644 index 00000000000..a16b5431b4c --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + 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 + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + 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 + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/samples/server/petstore/java-micronaut-server/mvnw.bat b/samples/server/petstore/java-micronaut-server/mvnw.bat new file mode 100644 index 00000000000..c8d43372c98 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/mvnw.bat @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. 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, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/samples/server/petstore/java-micronaut-server/pom.xml b/samples/server/petstore/java-micronaut-server/pom.xml new file mode 100644 index 00000000000..71aee310caa --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/pom.xml @@ -0,0 +1,159 @@ + + + 4.0.0 + org.openapitools + petstore-micronaut-server + 1.0.0 + ${packaging} + + + io.micronaut + micronaut-parent + 3.2.6 + + + + jar + 1.8 + + + 3.2.6 + org.openapitools.Application + netty + 1.5.21 + + + + + central + https://repo.maven.apache.org/maven2 + + + + + + io.micronaut + micronaut-inject + compile + + + io.micronaut + micronaut-validation + compile + + + io.micronaut + micronaut-inject-groovy + test + + + org.spockframework + spock-core + test + + + org.codehaus.groovy + groovy-all + + + + + io.micronaut.test + micronaut-test-spock + test + + + io.micronaut + micronaut-http-client + compile + + + io.micronaut + micronaut-http-server-netty + compile + + + io.micronaut + micronaut-runtime + compile + + + io.micronaut.reactor + micronaut-reactor + compile + + + ch.qos.logback + logback-classic + runtime + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + + + io.micronaut.build + micronaut-maven-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + + + io.micronaut + micronaut-http-validation + ${micronaut.version} + + + + -Amicronaut.processing.group=org.openapitools + -Amicronaut.processing.module=petstore-micronaut-server + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*Spec.* + **/*Test.* + + + + + + org.codehaus.gmavenplus + gmavenplus-plugin + 1.9.0 + + + + addSources + generateStubs + compile + removeStubs + addTestSources + generateTestStubs + compileTests + removeTestStubs + + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/settings.gradle b/samples/server/petstore/java-micronaut-server/settings.gradle new file mode 100644 index 00000000000..f96ffa51ae2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-micronaut-server" \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java new file mode 100644 index 00000000000..54b6adc71ec --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/Application.java @@ -0,0 +1,9 @@ +package org.openapitools; + +import io.micronaut.runtime.Micronaut; + +public class Application { + public static void main(String[] args) { + Micronaut.run(Application.class, args); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java new file mode 100644 index 00000000000..330ee3b7074 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/PetController.java @@ -0,0 +1,286 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.controller; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +import io.micronaut.http.multipart.CompletedFileUpload; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import javax.annotation.Generated; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Controller("${context-path}") +public class PetController { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return Pet + */ + @ApiOperation( + value = "Add a new pet to the store", + nickname = "addPet", + response = Pet.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 405, message = "Invalid input")}) + @Post(uri="/pet") + @Produces(value = {"application/xml", "application/json"}) + @Consumes(value = {"application/json", "application/xml"}) + public Mono addPet( + @Body @NotNull @Valid Pet pet + ) { + // TODO implement addPet() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + */ + @ApiOperation( + value = "Deletes a pet", + nickname = "deletePet", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value")}) + @Delete(uri="/pet/{petId}") + @Produces(value = {}) + public Mono deletePet( + @PathVariable(value="petId") @NotNull Long petId, + @Header(value="api_key") @Nullable String apiKey + ) { + // TODO implement deletePet() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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> + */ + @ApiOperation( + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet.class, + responseContainer = "array", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "array"), + @ApiResponse(code = 400, message = "Invalid status value")}) + @Get(uri="/pet/findByStatus") + @Produces(value = {"application/xml", "application/json"}) + public Mono> findPetsByStatus( + @QueryValue(value="status") @NotNull List status + ) { + // TODO implement findPetsByStatus() body; + Mono> result = Mono.empty(); + return result; + } + + /** + * 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> + */ + @ApiOperation( + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet.class, + responseContainer = "array", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "array"), + @ApiResponse(code = 400, message = "Invalid tag value")}) + @Get(uri="/pet/findByTags") + @Produces(value = {"application/xml", "application/json"}) + public Mono> findPetsByTags( + @QueryValue(value="tags") @NotNull List tags + ) { + // TODO implement findPetsByTags() body; + Mono> result = Mono.empty(); + return result; + } + + /** + * Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return Pet + */ + @ApiOperation( + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet.class, + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found")}) + @Get(uri="/pet/{petId}") + @Produces(value = {"application/xml", "application/json"}) + public Mono getPetById( + @PathVariable(value="petId") @NotNull Long petId + ) { + // TODO implement getPetById() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return Pet + */ + @ApiOperation( + value = "Update an existing pet", + nickname = "updatePet", + response = Pet.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception")}) + @Put(uri="/pet") + @Produces(value = {"application/xml", "application/json"}) + @Consumes(value = {"application/json", "application/xml"}) + public Mono updatePet( + @Body @NotNull @Valid Pet pet + ) { + // TODO implement updatePet() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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) + */ + @ApiOperation( + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input")}) + @Post(uri="/pet/{petId}") + @Produces(value = {}) + @Consumes(value = {"application/x-www-form-urlencoded"}) + public Mono updatePetWithForm( + @PathVariable(value="petId") @NotNull Long petId, + @Nullable String name, + @Nullable String status + ) { + // TODO implement updatePetWithForm() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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 + */ + @ApiOperation( + value = "uploads an image", + nickname = "uploadFile", + response = ModelApiResponse.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)}) + @Post(uri="/pet/{petId}/uploadImage") + @Produces(value = {"application/json"}) + @Consumes(value = {"multipart/form-data"}) + public Mono uploadFile( + @PathVariable(value="petId") @NotNull Long petId, + @Nullable String additionalMetadata, + @Nullable CompletedFileUpload _file + ) { + // TODO implement uploadFile() body; + Mono result = Mono.empty(); + return result; + } +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java new file mode 100644 index 00000000000..3ae60165ca0 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/StoreController.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.controller; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +import org.openapitools.model.Order; +import javax.annotation.Generated; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Controller("${context-path}") +public class StoreController { + /** + * 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) + */ + @ApiOperation( + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found")}) + @Delete(uri="/store/order/{orderId}") + @Produces(value = {}) + public Mono deleteOrder( + @PathVariable(value="orderId") @NotNull String orderId + ) { + // TODO implement deleteOrder() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return Map<String, Integer> + */ + @ApiOperation( + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = Integer.class, + responseContainer = "map", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "map")}) + @Get(uri="/store/inventory") + @Produces(value = {"application/json"}) + public Mono> getInventory() { + // TODO implement getInventory() body; + Mono> result = Mono.empty(); + return result; + } + + /** + * 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 + */ + @ApiOperation( + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found")}) + @Get(uri="/store/order/{orderId}") + @Produces(value = {"application/xml", "application/json"}) + public Mono getOrderById( + @PathVariable(value="orderId") @NotNull @Min(1L) @Max(5L) Long orderId + ) { + // TODO implement getOrderById() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + */ + @ApiOperation( + value = "Place an order for a pet", + nickname = "placeOrder", + response = Order.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order")}) + @Post(uri="/store/order") + @Produces(value = {"application/xml", "application/json"}) + @Consumes(value = {"application/json"}) + public Mono placeOrder( + @Body @NotNull @Valid Order order + ) { + // TODO implement placeOrder() body; + Mono result = Mono.empty(); + return result; + } +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java new file mode 100644 index 00000000000..78adec91467 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/controller/UserController.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.controller; + +import io.micronaut.http.annotation.*; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.convert.format.Format; +import reactor.core.publisher.Mono; +import java.time.LocalDateTime; +import org.openapitools.model.User; +import javax.annotation.Generated; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.annotations.*; + +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Controller("${context-path}") +public class UserController { + /** + * Create user + * This can only be done by the logged in user. + * + * @param user Created user object (required) + */ + @ApiOperation( + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Post(uri="/user") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono createUser( + @Body @NotNull @Valid User user + ) { + // TODO implement createUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + */ + @ApiOperation( + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Post(uri="/user/createWithArray") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono createUsersWithArrayInput( + @Body @NotNull List user + ) { + // TODO implement createUsersWithArrayInput() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + */ + @ApiOperation( + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Post(uri="/user/createWithList") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono createUsersWithListInput( + @Body @NotNull List user + ) { + // TODO implement createUsersWithListInput() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + */ + @ApiOperation( + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found")}) + @Delete(uri="/user/{username}") + @Produces(value = {}) + public Mono deleteUser( + @PathVariable(value="username") @NotNull String username + ) { + // TODO implement deleteUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + */ + @ApiOperation( + value = "Get user by user name", + nickname = "getUserByName", + response = User.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found")}) + @Get(uri="/user/{username}") + @Produces(value = {"application/xml", "application/json"}) + public Mono getUserByName( + @PathVariable(value="username") @NotNull String username + ) { + // TODO implement getUserByName() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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 + */ + @ApiOperation( + value = "Logs user into the system", + nickname = "loginUser", + response = String.class, + authorizations = {}, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied")}) + @Get(uri="/user/login") + @Produces(value = {"application/xml", "application/json"}) + public Mono loginUser( + @QueryValue(value="username") @NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") String username, + @QueryValue(value="password") @NotNull String password + ) { + // TODO implement loginUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * Logs out current logged in user session + * + */ + @ApiOperation( + value = "Logs out current logged in user session", + nickname = "logoutUser", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 0, message = "successful operation")}) + @Get(uri="/user/logout") + @Produces(value = {}) + public Mono logoutUser() { + // TODO implement logoutUser() body; + Mono result = Mono.empty(); + return result; + } + + /** + * 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) + */ + @ApiOperation( + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = { + @Authorization(value = "api_key") + }, + tags={}) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found")}) + @Put(uri="/user/{username}") + @Produces(value = {}) + @Consumes(value = {"application/json"}) + public Mono updateUser( + @PathVariable(value="username") @NotNull String username, + @Body @NotNull @Valid User user + ) { + // TODO implement updateUser() body; + Mono result = Mono.empty(); + return result; + } +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..e6a3f7e9432 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A category for a pet + */ +@ApiModel(description = "A category for a pet") +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +@JsonTypeName("Category") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +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; + + public Category() { + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @Nullable + @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..6e4b2b0834f --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * Describes the result of uploading an image resource + */ +@ApiModel(description = "Describes the result of uploading an image resource") +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("ApiResponse") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +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() { + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..2ef8aa82858 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,285 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * An order for a pets from the pet store + */ +@ApiModel(description = "An order for a pets from the pet store") +@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 +}) +@JsonTypeName("Order") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +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 LocalDateTime 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() { + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public LocalDateTime getShipDate() { + return shipDate; + } + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX") + public void setShipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @Nullable + @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..a2625f7d89a --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,302 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A pet for sale in the pet store + */ +@ApiModel(description = "A pet for sale in the pet store") +@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 +}) +@JsonTypeName("Pet") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +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(String name, List photoUrls) { + this.name = name; + this.photoUrls = photoUrls; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @Valid + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 + **/ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { + return photoUrls; + } + + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + **/ + @Nullable + @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..830c5ded133 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A tag for a pet + */ +@ApiModel(description = "A tag for a pet") +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +@JsonTypeName("Tag") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +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() { + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..057e2f19d91 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * A User who is purchasing from the pet store + */ +@ApiModel(description = "A User who is purchasing from the pet store") +@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 +}) +@JsonTypeName("User") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautServerCodegen") +@Introspected +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 User() { + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @Nullable + @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/main/resources/application.yml b/samples/server/petstore/java-micronaut-server/src/main/resources/application.yml new file mode 100644 index 00000000000..932949d0b39 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/resources/application.yml @@ -0,0 +1,18 @@ +context-path: "/v2/" + +micronaut: + application: + name: petstore-micronaut-server + server: + port: 8080 + security: + # authentication: bearer | cookie | session | idtoken + +jackson: + serialization: + writeEnumsUsingToString: true + writeDatesAsTimestamps: false + deserialization: + readEnumsUsingToString: true + failOnUnknownProperties: false + failOnInvalidSubtype: false diff --git a/samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml b/samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml new file mode 100644 index 00000000000..82218708264 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/main/resources/logback.xml @@ -0,0 +1,15 @@ + + + + false + + + %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n + + + + + + + diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy new file mode 100644 index 00000000000..1a42ac43aa2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/PetControllerSpec.groovy @@ -0,0 +1,398 @@ +package org.openapitools.controller + +import io.micronaut.http.multipart.CompletedFileUpload +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import io.micronaut.http.client.HttpClient +import io.micronaut.http.client.annotation.Client +import io.micronaut.runtime.server.EmbeddedServer +import io.micronaut.http.HttpStatus +import io.micronaut.http.HttpRequest +import io.micronaut.http.MutableHttpRequest; +import io.micronaut.http.HttpResponse +import io.micronaut.http.MediaType +import io.micronaut.http.uri.UriTemplate +import io.micronaut.http.cookie.Cookie +import io.micronaut.http.client.multipart.MultipartBody +import io.micronaut.core.type.Argument +import jakarta.inject.Inject +import spock.lang.Specification +import spock.lang.Ignore +import reactor.core.publisher.Mono +import java.io.File +import java.io.FileReader + + +/** + * Controller tests for PetController + */ +@MicronautTest +class PetControllerSpec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + PetController controller + + /** + * This test is used to validate the implementation of addPet() method + * + * The method should: Add a new pet to the store + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'addPet() method test'() { + given: + Pet pet = new Pet('doggie', ['example']) + + when: + Pet result = controller.addPet(pet).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet' to the features of addPet() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'addPet() test with client through path /pet'() { + given: + Pet body = new Pet('doggie', ['example']) + var uri = UriTemplate.of('/pet').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Pet.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of deletePet() method + * + * The method should: Deletes a pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'deletePet() method test'() { + given: + Long petId = 56L + String apiKey = 'example' + + when: + controller.deletePet(petId, apiKey).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}' to the features of deletePet() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'deletePet() test with client through path /pet/{petId}'() { + given: + var uri = UriTemplate.of('/pet/{petId}').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.DELETE(uri) + .accept('application/json') + .header('api_key', 'example') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of findPetsByStatus() method + * + * The method should: Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'findPetsByStatus() method test'() { + given: + List status = ['available'] + + when: + List result = controller.findPetsByStatus(status).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/findByStatus' to the features of findPetsByStatus() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'findPetsByStatus() test with client through path /pet/findByStatus'() { + given: + var uri = UriTemplate.of('/pet/findByStatus').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + request.getParameters() + .add('status', ['available'].toString()) // The query parameter format should be csv + + when: + HttpResponse response = client.toBlocking().exchange(request, Argument.of(List.class, Pet.class)); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of findPetsByTags() method + * + * The method should: Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'findPetsByTags() method test'() { + given: + List tags = ['example'] + + when: + List result = controller.findPetsByTags(tags).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/findByTags' to the features of findPetsByTags() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'findPetsByTags() test with client through path /pet/findByTags'() { + given: + var uri = UriTemplate.of('/pet/findByTags').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + request.getParameters() + .add('tags', ['example'].toString()) // The query parameter format should be csv + + when: + HttpResponse response = client.toBlocking().exchange(request, Argument.of(List.class, Pet.class)); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getPetById() method + * + * The method should: Find pet by ID + * + * Returns a single pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getPetById() method test'() { + given: + Long petId = 56L + + when: + Pet result = controller.getPetById(petId).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}' to the features of getPetById() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getPetById() test with client through path /pet/{petId}'() { + given: + var uri = UriTemplate.of('/pet/{petId}').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Pet.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of updatePet() method + * + * The method should: Update an existing pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'updatePet() method test'() { + given: + Pet pet = new Pet('doggie', ['example']) + + when: + Pet result = controller.updatePet(pet).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet' to the features of updatePet() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'updatePet() test with client through path /pet'() { + given: + Pet body = new Pet('doggie', ['example']) + var uri = UriTemplate.of('/pet').expand([:]) + MutableHttpRequest request = HttpRequest.PUT(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Pet.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of updatePetWithForm() method + * + * The method should: Updates a pet in the store with form data + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'updatePetWithForm() method test'() { + given: + Long petId = 56L + String name = 'example' + String status = 'example' + + when: + controller.updatePetWithForm(petId, name, status).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}' to the features of updatePetWithForm() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'updatePetWithForm() test with client through path /pet/{petId}'() { + given: + var form = [ + // Fill in the body form parameters + 'name': 'example', + 'status': 'example' + ] + var uri = UriTemplate.of('/pet/{petId}').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.POST(uri, form) + .contentType('application/x-www-form-urlencoded') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of uploadFile() method + * + * The method should: uploads an image + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'uploadFile() method test'() { + given: + Long petId = 56L + String additionalMetadata = 'example' + CompletedFileUpload file = null + + when: + ModelApiResponse result = controller.uploadFile(petId, additionalMetadata, file).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/pet/{petId}/uploadImage' to the features of uploadFile() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'uploadFile() test with client through path /pet/{petId}/uploadImage'() { + given: + var body = MultipartBody.builder() // Create multipart body + .addPart('additionalMetadata', 'example') + .addPart('file', 'filename', File.createTempFile('test', '.tmp')) + .build() + var uri = UriTemplate.of('/pet/{petId}/uploadImage').expand([ + // Fill in the path variables + 'petId': 56L + ]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('multipart/form-data') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, ModelApiResponse.class); + + then: + response.status() == HttpStatus.OK + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy new file mode 100644 index 00000000000..4af6ebfface --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/StoreControllerSpec.groovy @@ -0,0 +1,210 @@ +package org.openapitools.controller + +import org.openapitools.model.Order +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import io.micronaut.http.client.HttpClient +import io.micronaut.http.client.annotation.Client +import io.micronaut.runtime.server.EmbeddedServer +import io.micronaut.http.HttpStatus +import io.micronaut.http.HttpRequest +import io.micronaut.http.MutableHttpRequest; +import io.micronaut.http.HttpResponse +import io.micronaut.http.MediaType +import io.micronaut.http.uri.UriTemplate +import io.micronaut.http.cookie.Cookie +import io.micronaut.http.client.multipart.MultipartBody +import io.micronaut.core.type.Argument +import jakarta.inject.Inject +import spock.lang.Specification +import spock.lang.Ignore +import reactor.core.publisher.Mono +import java.io.File +import java.io.FileReader + + +/** + * Controller tests for StoreController + */ +@MicronautTest +class StoreControllerSpec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + StoreController controller + + /** + * This test is used to validate the implementation of deleteOrder() method + * + * The method should: Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'deleteOrder() method test'() { + given: + String orderId = 'example' + + when: + controller.deleteOrder(orderId).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/order/{orderId}' to the features of deleteOrder() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'deleteOrder() test with client through path /store/order/{orderId}'() { + given: + var uri = UriTemplate.of('/store/order/{orderId}').expand([ + // Fill in the path variables + 'orderId': 'example' + ]) + MutableHttpRequest request = HttpRequest.DELETE(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getInventory() method + * + * The method should: Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getInventory() method test'() { + given: + + when: + Map result = controller.getInventory().block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/inventory' to the features of getInventory() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getInventory() test with client through path /store/inventory'() { + given: + var uri = UriTemplate.of('/store/inventory').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Argument.of(Map.class, String.class, Integer.class)); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getOrderById() method + * + * The method should: Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getOrderById() method test'() { + given: + Long orderId = 56L + + when: + Order result = controller.getOrderById(orderId).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/order/{orderId}' to the features of getOrderById() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getOrderById() test with client through path /store/order/{orderId}'() { + given: + var uri = UriTemplate.of('/store/order/{orderId}').expand([ + // Fill in the path variables + 'orderId': 56L + ]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Order.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of placeOrder() method + * + * The method should: Place an order for a pet + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'placeOrder() method test'() { + given: + Order order = new Order() + + when: + Order result = controller.placeOrder(order).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/store/order' to the features of placeOrder() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'placeOrder() test with client through path /store/order'() { + given: + Order body = new Order() + var uri = UriTemplate.of('/store/order').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, Order.class); + + then: + response.status() == HttpStatus.OK + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy new file mode 100644 index 00000000000..59940a3b5a5 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/controller/UserControllerSpec.groovy @@ -0,0 +1,381 @@ +package org.openapitools.controller + +import java.time.LocalDateTime +import org.openapitools.model.User +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import io.micronaut.http.client.HttpClient +import io.micronaut.http.client.annotation.Client +import io.micronaut.runtime.server.EmbeddedServer +import io.micronaut.http.HttpStatus +import io.micronaut.http.HttpRequest +import io.micronaut.http.MutableHttpRequest; +import io.micronaut.http.HttpResponse +import io.micronaut.http.MediaType +import io.micronaut.http.uri.UriTemplate +import io.micronaut.http.cookie.Cookie +import io.micronaut.http.client.multipart.MultipartBody +import io.micronaut.core.type.Argument +import jakarta.inject.Inject +import spock.lang.Specification +import spock.lang.Ignore +import reactor.core.publisher.Mono +import java.io.File +import java.io.FileReader + + +/** + * Controller tests for UserController + */ +@MicronautTest +class UserControllerSpec extends Specification { + + @Inject + EmbeddedServer server + + @Inject + @Client('${context-path}') + HttpClient client + + @Inject + UserController controller + + /** + * This test is used to validate the implementation of createUser() method + * + * The method should: Create user + * + * This can only be done by the logged in user. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'createUser() method test'() { + given: + User user = new User() + + when: + controller.createUser(user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user' to the features of createUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'createUser() test with client through path /user'() { + given: + User body = new User() + var uri = UriTemplate.of('/user').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of createUsersWithArrayInput() method + * + * The method should: Creates list of users with given input array + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'createUsersWithArrayInput() method test'() { + given: + List user = [] + + when: + controller.createUsersWithArrayInput(user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/createWithArray' to the features of createUsersWithArrayInput() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'createUsersWithArrayInput() test with client through path /user/createWithArray'() { + given: + List body = [] + var uri = UriTemplate.of('/user/createWithArray').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of createUsersWithListInput() method + * + * The method should: Creates list of users with given input array + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'createUsersWithListInput() method test'() { + given: + List user = [] + + when: + controller.createUsersWithListInput(user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/createWithList' to the features of createUsersWithListInput() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'createUsersWithListInput() test with client through path /user/createWithList'() { + given: + List body = [] + var uri = UriTemplate.of('/user/createWithList').expand([:]) + MutableHttpRequest request = HttpRequest.POST(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of deleteUser() method + * + * The method should: Delete user + * + * This can only be done by the logged in user. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'deleteUser() method test'() { + given: + String username = 'example' + + when: + controller.deleteUser(username).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/{username}' to the features of deleteUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'deleteUser() test with client through path /user/{username}'() { + given: + var uri = UriTemplate.of('/user/{username}').expand([ + // Fill in the path variables + 'username': 'example' + ]) + MutableHttpRequest request = HttpRequest.DELETE(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of getUserByName() method + * + * The method should: Get user by user name + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'getUserByName() method test'() { + given: + String username = 'example' + + when: + User result = controller.getUserByName(username).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/{username}' to the features of getUserByName() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'getUserByName() test with client through path /user/{username}'() { + given: + var uri = UriTemplate.of('/user/{username}').expand([ + // Fill in the path variables + 'username': 'example' + ]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request, User.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of loginUser() method + * + * The method should: Logs user into the system + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'loginUser() method test'() { + given: + String username = 'example' + String password = 'example' + + when: + String result = controller.loginUser(username, password).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/login' to the features of loginUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'loginUser() test with client through path /user/login'() { + given: + var uri = UriTemplate.of('/user/login').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + request.getParameters() + .add('username', 'example') + .add('password', 'example') + + when: + HttpResponse response = client.toBlocking().exchange(request, String.class); + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of logoutUser() method + * + * The method should: Logs out current logged in user session + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'logoutUser() method test'() { + given: + + when: + controller.logoutUser().block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/logout' to the features of logoutUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'logoutUser() test with client through path /user/logout'() { + given: + var uri = UriTemplate.of('/user/logout').expand([:]) + MutableHttpRequest request = HttpRequest.GET(uri) + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + + /** + * This test is used to validate the implementation of updateUser() method + * + * The method should: Updated user + * + * This can only be done by the logged in user. + * + * TODO fill in the parameters and test return value. + */ + @Ignore("Not Implemented") + def 'updateUser() method test'() { + given: + String username = 'example' + User user = new User() + + when: + controller.updateUser(username, user).block() + + then: + true + } + + /** + * This test is used to check that the api available to client through + * '/user/{username}' to the features of updateUser() works as desired. + * + * TODO fill in the request parameters and test response. + */ + @Ignore("Not Implemented") + def 'updateUser() test with client through path /user/{username}'() { + given: + User body = new User() + var uri = UriTemplate.of('/user/{username}').expand([ + // Fill in the path variables + 'username': 'example' + ]) + MutableHttpRequest request = HttpRequest.PUT(uri, body) + .contentType('application/json') + .accept('application/json') + + when: + HttpResponse response = client.toBlocking().exchange(request); // To retrieve body you must specify required type (e.g. Map.class) as second argument + + then: + response.status() == HttpStatus.OK + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy new file mode 100644 index 00000000000..09ea5aea6bf --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/CategorySpec.groovy @@ -0,0 +1,37 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Category + */ +@MicronautTest +public class CategorySpec extends Specification { + private final Category model = null + + /** + * Model tests for Category + */ + void 'Category test'() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + void 'Category property id test'() { + // TODO: test id property of Category + } + + /** + * Test the property 'name' + */ + void 'Category property name test'() { + // TODO: test name property of Category + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy new file mode 100644 index 00000000000..11581554b2e --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/ModelApiResponseSpec.groovy @@ -0,0 +1,44 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for ModelApiResponse + */ +@MicronautTest +public class ModelApiResponseSpec extends Specification { + private final ModelApiResponse model = null + + /** + * Model tests for ModelApiResponse + */ + void 'ModelApiResponse test'() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + void 'ModelApiResponse property code test'() { + // TODO: test code property of ModelApiResponse + } + + /** + * Test the property 'type' + */ + void 'ModelApiResponse property type test'() { + // TODO: test type property of ModelApiResponse + } + + /** + * Test the property 'message' + */ + void 'ModelApiResponse property message test'() { + // TODO: test message property of ModelApiResponse + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy new file mode 100644 index 00000000000..f49fd81a9a2 --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/OrderSpec.groovy @@ -0,0 +1,66 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import java.time.LocalDateTime +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Order + */ +@MicronautTest +public class OrderSpec extends Specification { + private final Order model = null + + /** + * Model tests for Order + */ + void 'Order test'() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + void 'Order property id test'() { + // TODO: test id property of Order + } + + /** + * Test the property 'petId' + */ + void 'Order property petId test'() { + // TODO: test petId property of Order + } + + /** + * Test the property 'quantity' + */ + void 'Order property quantity test'() { + // TODO: test quantity property of Order + } + + /** + * Test the property 'shipDate' + */ + void 'Order property shipDate test'() { + // TODO: test shipDate property of Order + } + + /** + * Test the property 'status' + */ + void 'Order property status test'() { + // TODO: test status property of Order + } + + /** + * Test the property 'complete' + */ + void 'Order property complete test'() { + // TODO: test complete property of Order + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy new file mode 100644 index 00000000000..87de485ec4b --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/PetSpec.groovy @@ -0,0 +1,69 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import java.util.ArrayList +import java.util.List +import org.openapitools.model.Category +import org.openapitools.model.Tag +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Pet + */ +@MicronautTest +public class PetSpec extends Specification { + private final Pet model = null + + /** + * Model tests for Pet + */ + void 'Pet test'() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + void 'Pet property id test'() { + // TODO: test id property of Pet + } + + /** + * Test the property 'category' + */ + void 'Pet property category test'() { + // TODO: test category property of Pet + } + + /** + * Test the property 'name' + */ + void 'Pet property name test'() { + // TODO: test name property of Pet + } + + /** + * Test the property 'photoUrls' + */ + void 'Pet property photoUrls test'() { + // TODO: test photoUrls property of Pet + } + + /** + * Test the property 'tags' + */ + void 'Pet property tags test'() { + // TODO: test tags property of Pet + } + + /** + * Test the property 'status' + */ + void 'Pet property status test'() { + // TODO: test status property of Pet + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy new file mode 100644 index 00000000000..23208c3464b --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/TagSpec.groovy @@ -0,0 +1,37 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for Tag + */ +@MicronautTest +public class TagSpec extends Specification { + private final Tag model = null + + /** + * Model tests for Tag + */ + void 'Tag test'() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + void 'Tag property id test'() { + // TODO: test id property of Tag + } + + /** + * Test the property 'name' + */ + void 'Tag property name test'() { + // TODO: test name property of Tag + } + +} diff --git a/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy new file mode 100644 index 00000000000..c3060a006bb --- /dev/null +++ b/samples/server/petstore/java-micronaut-server/src/test/groovy/org/openapitools/model/UserSpec.groovy @@ -0,0 +1,79 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for User + */ +@MicronautTest +public class UserSpec extends Specification { + private final User model = null + + /** + * Model tests for User + */ + void 'User test'() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + void 'User property id test'() { + // TODO: test id property of User + } + + /** + * Test the property 'username' + */ + void 'User property username test'() { + // TODO: test username property of User + } + + /** + * Test the property 'firstName' + */ + void 'User property firstName test'() { + // TODO: test firstName property of User + } + + /** + * Test the property 'lastName' + */ + void 'User property lastName test'() { + // TODO: test lastName property of User + } + + /** + * Test the property 'email' + */ + void 'User property email test'() { + // TODO: test email property of User + } + + /** + * Test the property 'password' + */ + void 'User property password test'() { + // TODO: test password property of User + } + + /** + * Test the property 'phone' + */ + void 'User property phone test'() { + // TODO: test phone property of User + } + + /** + * Test the property 'userStatus' + */ + void 'User property userStatus test'() { + // TODO: test userStatus property of User + } + +} From 209f08e4a461bd35be6d68beac7f873b14d73739 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 26 Jan 2022 14:54:11 +0800 Subject: [PATCH 092/113] update doc --- docs/generators/java-micronaut-server.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index b99834e7c64..1089565806f 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -10,6 +10,7 @@ title: Documentation for the java-micronaut-server Generator | generator stability | BETA | | | generator type | SERVER | | | generator language | Java | | +| generator default templating engine | mustache | | | helpTxt | Generates a Java Micronaut Server. | | ## CONFIG OPTIONS From 2ebadc36f7ddff8aca1b35a93fbd218fd2c0dae9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 26 Jan 2022 14:54:32 +0800 Subject: [PATCH 093/113] update undertow dependencies (#11411) --- .../src/main/resources/java-undertow-server/pom.mustache | 6 +++--- samples/server/petstore/java-undertow/pom.xml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache index 9ad7d579940..ead7f7e3c7d 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache @@ -27,11 +27,11 @@ 1.2 3.1.2 1.2.0 - 4.13 + 4.13.1 2.1.0-beta.124 - 1.4.0.Final + 2.1.6.Final 2.2.0 - 4.5.2 + 4.5.13 4.1.2 1.5.10 diff --git a/samples/server/petstore/java-undertow/pom.xml b/samples/server/petstore/java-undertow/pom.xml index 53ccffba47d..3e18815a1d1 100644 --- a/samples/server/petstore/java-undertow/pom.xml +++ b/samples/server/petstore/java-undertow/pom.xml @@ -27,11 +27,11 @@ 1.2 3.1.2 1.2.0 - 4.13 + 4.13.1 2.1.0-beta.124 - 1.4.0.Final + 2.1.6.Final 2.2.0 - 4.5.2 + 4.5.13 4.1.2 1.5.10 From adcf04c63b257a20230dbca8e073091f451cb88b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 26 Jan 2022 15:40:24 +0800 Subject: [PATCH 094/113] update jaxrs junit to newer version (#11410) --- .../JavaJaxRS/libraries/jersey1/pom.mustache | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-cxf-client-jackson/pom.xml | 5 +- .../gen/java/org/openapitools/api/PetApi.java | 3 +- .../java/org/openapitools/api/StoreApi.java | 1 - .../java/org/openapitools/api/UserApi.java | 2 +- .../java/org/openapitools/model/Category.java | 7 -- .../openapitools/model/ModelApiResponse.java | 7 -- .../java/org/openapitools/model/Order.java | 11 +-- .../gen/java/org/openapitools/model/Pet.java | 11 +-- .../gen/java/org/openapitools/model/Tag.java | 7 -- .../gen/java/org/openapitools/model/User.java | 7 -- .../.openapi-generator/VERSION | 2 +- .../client/petstore/jaxrs-cxf-client/pom.xml | 5 +- .../gen/java/org/openapitools/api/PetApi.java | 3 +- .../java/org/openapitools/api/StoreApi.java | 1 - .../java/org/openapitools/api/UserApi.java | 2 +- .../java/org/openapitools/model/Category.java | 7 -- .../openapitools/model/ModelApiResponse.java | 7 -- .../java/org/openapitools/model/Order.java | 11 +-- .../gen/java/org/openapitools/model/Pet.java | 11 +-- .../gen/java/org/openapitools/model/Tag.java | 7 -- .../gen/java/org/openapitools/model/User.java | 7 -- .../.openapi-generator/FILES | 3 + .../.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-cxf-test-data/pom.xml | 16 ++-- .../org/openapitools/api/AnotherFakeApi.java | 1 - .../java/org/openapitools/api/FakeApi.java | 10 +-- .../api/FakeClassnameTags123Api.java | 1 - .../gen/java/org/openapitools/api/PetApi.java | 9 +- .../java/org/openapitools/api/StoreApi.java | 1 - .../java/org/openapitools/api/UserApi.java | 4 +- .../model/AdditionalPropertiesAnyType.java | 9 +- .../model/AdditionalPropertiesArray.java | 9 +- .../model/AdditionalPropertiesBoolean.java | 9 +- .../model/AdditionalPropertiesClass.java | 29 +++--- .../model/AdditionalPropertiesInteger.java | 9 +- .../model/AdditionalPropertiesNumber.java | 9 +- .../model/AdditionalPropertiesObject.java | 9 +- .../model/AdditionalPropertiesString.java | 9 +- .../java/org/openapitools/model/Animal.java | 11 +-- .../org/openapitools/model/AnimalFarm.java | 7 -- .../model/ArrayOfArrayOfNumberOnly.java | 9 +- .../openapitools/model/ArrayOfNumberOnly.java | 9 +- .../org/openapitools/model/ArrayTest.java | 13 +-- .../java/org/openapitools/model/BigCat.java | 19 ++-- .../org/openapitools/model/BigCatAllOf.java | 19 ++-- .../openapitools/model/Capitalization.java | 19 ++-- .../gen/java/org/openapitools/model/Cat.java | 9 +- .../java/org/openapitools/model/CatAllOf.java | 9 +- .../java/org/openapitools/model/Category.java | 11 +-- .../org/openapitools/model/ClassModel.java | 9 +- .../java/org/openapitools/model/Client.java | 9 +- .../gen/java/org/openapitools/model/Dog.java | 9 +- .../java/org/openapitools/model/DogAllOf.java | 9 +- .../org/openapitools/model/EnumArrays.java | 23 ++--- .../org/openapitools/model/EnumClass.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 45 ++++------ .../model/FileSchemaTestClass.java | 42 ++++----- .../org/openapitools/model/FormatTest.java | 35 +++----- .../openapitools/model/HasOnlyReadOnly.java | 11 +-- .../java/org/openapitools/model/MapTest.java | 21 ++--- ...ropertiesAndAdditionalPropertiesClass.java | 13 +-- .../openapitools/model/Model200Response.java | 11 +-- .../openapitools/model/ModelApiResponse.java | 13 +-- .../org/openapitools/model/ModelFile.java | 70 +++++++++++++++ .../org/openapitools/model/ModelList.java | 61 +++++++++++++ .../org/openapitools/model/ModelReturn.java | 9 +- .../gen/java/org/openapitools/model/Name.java | 15 +--- .../org/openapitools/model/NumberOnly.java | 9 +- .../java/org/openapitools/model/Order.java | 27 ++---- .../openapitools/model/OuterComposite.java | 13 +-- .../org/openapitools/model/OuterEnum.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 29 +++--- .../org/openapitools/model/ReadOnlyFirst.java | 11 +-- .../openapitools/model/SpecialModelName.java | 9 +- .../openapitools/model/StringBooleanMap.java | 7 -- .../gen/java/org/openapitools/model/Tag.java | 11 +-- .../openapitools/model/TypeHolderDefault.java | 17 ++-- .../openapitools/model/TypeHolderExample.java | 19 ++-- .../gen/java/org/openapitools/model/User.java | 23 ++--- .../java/org/openapitools/model/XmlItem.java | 65 ++++++-------- .../api/impl/AnotherFakeApiServiceImpl.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 3 +- .../FakeClassnameTags123ApiServiceImpl.java | 2 +- .../api/impl/PetApiServiceImpl.java | 4 +- .../api/impl/StoreApiServiceImpl.java | 2 +- .../api/impl/UserApiServiceImpl.java | 3 +- .../src/main/resources/ApplicationContext.xml | 2 +- .../src/main/resources/test-data.json | 15 +++- .../src/main/webapp/WEB-INF/context.xml | 8 +- .../src/main/webapp/WEB-INF/web.xml | 2 +- .../api/SpringBootApplication.java | 8 +- .../.openapi-generator/FILES | 2 + .../.openapi-generator/VERSION | 2 +- .../jaxrs-spec-interface-response/pom.xml | 16 ++-- .../java/org/openapitools/api/FakeApi.java | 8 +- .../gen/java/org/openapitools/api/PetApi.java | 8 +- .../java/org/openapitools/api/UserApi.java | 3 +- .../model/AdditionalPropertiesAnyType.java | 3 + .../model/AdditionalPropertiesArray.java | 3 + .../model/AdditionalPropertiesBoolean.java | 3 + .../model/AdditionalPropertiesClass.java | 13 +++ .../model/AdditionalPropertiesInteger.java | 3 + .../model/AdditionalPropertiesNumber.java | 3 + .../model/AdditionalPropertiesObject.java | 3 + .../model/AdditionalPropertiesString.java | 3 + .../java/org/openapitools/model/Animal.java | 4 + .../model/ArrayOfArrayOfNumberOnly.java | 3 + .../openapitools/model/ArrayOfNumberOnly.java | 3 + .../org/openapitools/model/ArrayTest.java | 5 ++ .../java/org/openapitools/model/BigCat.java | 3 + .../org/openapitools/model/BigCatAllOf.java | 3 + .../openapitools/model/Capitalization.java | 8 ++ .../gen/java/org/openapitools/model/Cat.java | 3 + .../java/org/openapitools/model/CatAllOf.java | 3 + .../java/org/openapitools/model/Category.java | 4 + .../org/openapitools/model/ClassModel.java | 3 + .../java/org/openapitools/model/Client.java | 3 + .../gen/java/org/openapitools/model/Dog.java | 3 + .../java/org/openapitools/model/DogAllOf.java | 3 + .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 7 ++ .../model/FileSchemaTestClass.java | 33 ++++--- .../org/openapitools/model/FormatTest.java | 16 ++++ .../openapitools/model/HasOnlyReadOnly.java | 4 + .../java/org/openapitools/model/MapTest.java | 8 +- ...ropertiesAndAdditionalPropertiesClass.java | 5 ++ .../openapitools/model/Model200Response.java | 4 + .../openapitools/model/ModelApiResponse.java | 5 ++ .../org/openapitools/model/ModelFile.java | 88 +++++++++++++++++++ .../org/openapitools/model/ModelList.java | 85 ++++++++++++++++++ .../org/openapitools/model/ModelReturn.java | 3 + .../gen/java/org/openapitools/model/Name.java | 6 ++ .../org/openapitools/model/NumberOnly.java | 3 + .../java/org/openapitools/model/Order.java | 8 ++ .../openapitools/model/OuterComposite.java | 5 ++ .../gen/java/org/openapitools/model/Pet.java | 10 +++ .../org/openapitools/model/ReadOnlyFirst.java | 4 + .../openapitools/model/SpecialModelName.java | 3 + .../gen/java/org/openapitools/model/Tag.java | 4 + .../openapitools/model/TypeHolderDefault.java | 7 ++ .../openapitools/model/TypeHolderExample.java | 8 ++ .../gen/java/org/openapitools/model/User.java | 10 +++ .../java/org/openapitools/model/XmlItem.java | 31 +++++++ .../petstore/jaxrs/jersey1-useTags/pom.xml | 2 +- samples/server/petstore/jaxrs/jersey1/pom.xml | 2 +- 147 files changed, 862 insertions(+), 731 deletions(-) create mode 100644 samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelFile.java create mode 100644 samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelList.java create mode 100644 samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java create mode 100644 samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache index 0bef89d2309..828013c794c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache @@ -217,7 +217,7 @@ 1.19.1 2.9.9 1.7.21 - 4.13 + 4.13.1 4.0.4 UTF-8 diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION index 6555596f931..0984c4c1ad2 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml b/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml index 7fccbfb562e..177096636d3 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/pom.xml @@ -6,6 +6,8 @@ jaxrs-cxf-jackson-petstore-client This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. 1.0.0 + + src/main/java @@ -111,7 +113,7 @@ ${cxf-version} test - + org.apache.cxf @@ -172,7 +174,6 @@ 9.2.9.v20150224 4.13.1 1.2.0 - 2.5 3.3.0 2.9.9 1.3.5 diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/PetApi.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/PetApi.java index 51cce1e1d63..cb3a46b1f51 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/PetApi.java @@ -135,6 +135,5 @@ public interface PetApi { @ApiOperation(value = "uploads an image", tags={ }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); + public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail); } - diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/StoreApi.java index 073884a0c6f..c1216ebe2cc 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/StoreApi.java @@ -84,4 +84,3 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid Order") }) public Order placeOrder(Order body); } - diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/UserApi.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/UserApi.java index ee7ab783661..31d37fe19cd 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import org.openapitools.model.User; import java.io.InputStream; @@ -128,4 +129,3 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public void updateUser(@PathParam("username") String username, User body); } - diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Category.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Category.java index 8312405424a..385d6324ae4 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Category.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/ModelApiResponse.java index 14b393d1097..d37f40980d3 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Order.java index 770e6d30baa..aa0f0ce80b8 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Order.java @@ -6,13 +6,6 @@ import io.swagger.annotations.ApiModel; import java.util.Date; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -33,11 +26,9 @@ public class Order { @ApiModelProperty(value = "") private Date shipDate; -@XmlType(name="StatusEnum") -@XmlEnum(String.class) public enum StatusEnum { -@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); +PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); private String value; diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Pet.java index 807cb4182d8..c151c373398 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Pet.java @@ -9,13 +9,6 @@ import org.openapitools.model.Category; import org.openapitools.model.Tag; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -39,11 +32,9 @@ public class Pet { @ApiModelProperty(value = "") private List tags = null; -@XmlType(name="StatusEnum") -@XmlEnum(String.class) public enum StatusEnum { -@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); +AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); private String value; diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Tag.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Tag.java index ad321a15496..49680fe48a4 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/Tag.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/User.java b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/User.java index 0cd34a9baf4..bab06ed1f71 100644 --- a/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/User.java +++ b/samples/client/petstore/jaxrs-cxf-client-jackson/src/gen/java/org/openapitools/model/User.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION index 6555596f931..0984c4c1ad2 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index d2c3b968a2a..bb40eef574a 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -6,6 +6,8 @@ jaxrs-cxf-petstore-client This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. 1.0.0 + + src/main/java @@ -111,7 +113,7 @@ ${cxf-version} test - + org.apache.cxf @@ -172,7 +174,6 @@ 9.2.9.v20150224 4.13.1 1.2.0 - 2.5 3.3.0 2.9.9 1.3.5 diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java index 51cce1e1d63..cb3a46b1f51 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/PetApi.java @@ -135,6 +135,5 @@ public interface PetApi { @ApiOperation(value = "uploads an image", tags={ }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail); + public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail); } - diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java index 073884a0c6f..c1216ebe2cc 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/StoreApi.java @@ -84,4 +84,3 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid Order") }) public Order placeOrder(Order body); } - diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java index ee7ab783661..31d37fe19cd 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import org.openapitools.model.User; import java.io.InputStream; @@ -128,4 +129,3 @@ public interface UserApi { @ApiResponse(code = 404, message = "User not found") }) public void updateUser(@PathParam("username") String username, User body); } - diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Category.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Category.java index 8312405424a..385d6324ae4 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Category.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/ModelApiResponse.java index 14b393d1097..d37f40980d3 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java index 9ebf511b68e..76f00250240 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java @@ -4,13 +4,6 @@ import io.swagger.annotations.ApiModel; import java.util.Date; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -31,11 +24,9 @@ public class Order { @ApiModelProperty(value = "") private Date shipDate; -@XmlType(name="StatusEnum") -@XmlEnum(String.class) public enum StatusEnum { -@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered")); +PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); private String value; diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java index d6dd036a532..baf8f5a9d7b 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java @@ -7,13 +7,6 @@ import org.openapitools.model.Category; import org.openapitools.model.Tag; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -37,11 +30,9 @@ public class Pet { @ApiModelProperty(value = "") private List tags = null; -@XmlType(name="StatusEnum") -@XmlEnum(String.class) public enum StatusEnum { -@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold")); +AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); private String value; diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Tag.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Tag.java index ad321a15496..49680fe48a4 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Tag.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/User.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/User.java index 0cd34a9baf4..bab06ed1f71 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/User.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/User.java @@ -3,13 +3,6 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; import com.fasterxml.jackson.annotation.JsonProperty; /** diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES index 0fc7cbf70c7..8a46c3fe211 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES @@ -40,6 +40,8 @@ src/gen/java/org/openapitools/model/MapTest.java src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java src/gen/java/org/openapitools/model/Model200Response.java src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelFile.java +src/gen/java/org/openapitools/model/ModelList.java src/gen/java/org/openapitools/model/ModelReturn.java src/gen/java/org/openapitools/model/Name.java src/gen/java/org/openapitools/model/NumberOnly.java @@ -62,6 +64,7 @@ src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java src/main/resources/ApplicationContext.xml +src/main/resources/test-data.json src/main/webapp/WEB-INF/context.xml src/main/webapp/WEB-INF/web.xml src/test/java/org/openapitools/api/SpringBootApplication.java diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION index 6555596f931..0984c4c1ad2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/pom.xml b/samples/server/petstore/jaxrs-cxf-test-data/pom.xml index f17dde84bad..f42f6e5455e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-test-data/pom.xml @@ -43,8 +43,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api ${beanvalidation-version} @@ -87,7 +87,7 @@ - + maven-war-plugin @@ -127,8 +127,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api provided @@ -200,7 +200,7 @@ org.springframework spring-web - + - javax.validation - validation-api - 1.1.0.Final + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} provided 2.9.9 4.13.1 + 2.0.2 + 2.1.6 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java index 882acd3129a..6647d22250f 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java @@ -81,7 +81,7 @@ import javax.validation.Valid; @ApiOperation(value = "", notes = "", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User body); + Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User body); @PATCH @Consumes({ "application/json" }) @@ -108,13 +108,13 @@ import javax.validation.Valid; @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); @DELETE @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); + Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); @POST @Path("/inline-additionalProperties") @@ -137,7 +137,7 @@ import javax.validation.Valid; @ApiOperation(value = "", notes = "To test the collection format in query parameters", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); + Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); @POST @Path("/{petId}/uploadImageWithRequiredFile") diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java index 480057d9367..688f409117a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java @@ -42,7 +42,7 @@ import javax.validation.Valid; @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); @GET @Path("/findByStatus") @@ -55,7 +55,7 @@ import javax.validation.Valid; @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); @GET @Path("/findByTags") @@ -68,7 +68,7 @@ import javax.validation.Valid; @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "Set") }) - Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") Set tags); + Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") Set tags); @GET @Path("/{petId}") @@ -120,5 +120,5 @@ import javax.validation.Valid; }, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream); + Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java index 77ea16dbeb8..ed2fcd7dc4e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; @@ -63,7 +64,7 @@ import javax.validation.Valid; @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) - Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); + Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password); @GET @Path("/logout") diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 6b9dcfa1ac6..50c6702c65f 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesAnyType extends HashMap implements Serializable { private @Valid String name; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 1b504c15f4e..3b400ed375e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesArray extends HashMap implements Serializable { private @Valid String name; @@ -37,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d842728a186..e1dbfa0821a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesBoolean extends HashMap implements Serializable { private @Valid String name; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index ab1baad9976..61bec1b6ff4 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -15,9 +15,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesClass implements Serializable { private @Valid Map mapString = new HashMap(); @@ -48,6 +50,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapString; } + @JsonProperty("map_string") public void setMapString(Map mapString) { this.mapString = mapString; } @@ -68,6 +71,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapNumber; } + @JsonProperty("map_number") public void setMapNumber(Map mapNumber) { this.mapNumber = mapNumber; } @@ -88,6 +92,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapInteger; } + @JsonProperty("map_integer") public void setMapInteger(Map mapInteger) { this.mapInteger = mapInteger; } @@ -108,6 +113,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapBoolean; } + @JsonProperty("map_boolean") public void setMapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; } @@ -128,6 +134,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapArrayInteger; } + @JsonProperty("map_array_integer") public void setMapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; } @@ -148,6 +155,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapArrayAnytype; } + @JsonProperty("map_array_anytype") public void setMapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; } @@ -168,6 +176,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapMapString; } + @JsonProperty("map_map_string") public void setMapMapString(Map> mapMapString) { this.mapMapString = mapMapString; } @@ -188,6 +197,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return mapMapAnytype; } + @JsonProperty("map_map_anytype") public void setMapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; } @@ -208,6 +218,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return anytype1; } + @JsonProperty("anytype_1") public void setAnytype1(Object anytype1) { this.anytype1 = anytype1; } @@ -228,6 +239,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return anytype2; } + @JsonProperty("anytype_2") public void setAnytype2(Object anytype2) { this.anytype2 = anytype2; } @@ -248,6 +260,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return anytype3; } + @JsonProperty("anytype_3") public void setAnytype3(Object anytype3) { this.anytype3 = anytype3; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 6f925720aba..fc85a62ad02 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesInteger extends HashMap implements Serializable { private @Valid String name; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 884577dcdd0..25852547106 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesNumber extends HashMap implements Serializable { private @Valid String name; @@ -37,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index cbe4428f3e3..998b85d511d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesObject extends HashMap implements Serializable { private @Valid String name; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 16f6a60afd1..b317c03b4c0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class AdditionalPropertiesString extends HashMap implements Serializable { private @Valid String name; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java index 8ddd9ed2f8c..7c6fb6c670a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java @@ -13,6 +13,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ @@ -22,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonValue; }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Animal implements Serializable { private @Valid String className; @@ -44,6 +46,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return className; } + @JsonProperty("className") public void setClassName(String className) { this.className = className; } @@ -64,6 +67,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return color; } + @JsonProperty("color") public void setColor(String color) { this.color = color; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 9643930053c..cbca7de2f69 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfArrayOfNumberOnly implements Serializable { private @Valid List> arrayArrayNumber = new ArrayList>(); @@ -37,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayArrayNumber; } + @JsonProperty("ArrayArrayNumber") public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 2c585cdc1e8..ad7cc3db32e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayOfNumberOnly implements Serializable { private @Valid List arrayNumber = new ArrayList(); @@ -37,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayNumber; } + @JsonProperty("ArrayNumber") public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java index edc0b7a9484..f2b7469f65c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ArrayTest implements Serializable { private @Valid List arrayOfString = new ArrayList(); @@ -39,6 +41,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayOfString; } + @JsonProperty("array_of_string") public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } @@ -59,6 +62,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayArrayOfInteger; } + @JsonProperty("array_array_of_integer") public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } @@ -79,6 +83,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayArrayOfModel; } + @JsonProperty("array_array_of_model") public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCat.java index 1a3ddba789b..483c60b3d06 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCat.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class BigCat extends Cat implements Serializable { @@ -69,6 +71,7 @@ public enum KindEnum { return kind; } + @JsonProperty("kind") public void setKind(KindEnum kind) { this.kind = kind; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java index 080e86afaca..db687359046 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class BigCatAllOf implements Serializable { @@ -67,6 +69,7 @@ public enum KindEnum { return kind; } + @JsonProperty("kind") public void setKind(KindEnum kind) { this.kind = kind; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java index a65c79d984e..59529655970 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Capitalization implements Serializable { private @Valid String smallCamel; @@ -39,6 +41,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return smallCamel; } + @JsonProperty("smallCamel") public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } @@ -59,6 +62,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return capitalCamel; } + @JsonProperty("CapitalCamel") public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } @@ -79,6 +83,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return smallSnake; } + @JsonProperty("small_Snake") public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } @@ -99,6 +104,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return capitalSnake; } + @JsonProperty("Capital_Snake") public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } @@ -119,6 +125,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return scAETHFlowPoints; } + @JsonProperty("SCA_ETH_Flow_Points") public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } @@ -140,6 +147,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return ATT_NAME; } + @JsonProperty("ATT_NAME") public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java index 4cc078e2235..948b28d037a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Cat extends Animal implements Serializable { private @Valid Boolean declawed; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return declawed; } + @JsonProperty("declawed") public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java index e56df72d3be..b5d2587fe85 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/CatAllOf.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class CatAllOf implements Serializable { private @Valid Boolean declawed; @@ -34,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return declawed; } + @JsonProperty("declawed") public void setDeclawed(Boolean declawed) { this.declawed = declawed; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java index 9af6f93c7c4..6d4e8a87992 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Category implements Serializable { private @Valid Long id; @@ -35,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return id; } + @JsonProperty("id") public void setId(Long id) { this.id = id; } @@ -56,6 +59,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java index f050e12bb25..fec3c619257 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java @@ -11,11 +11,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model with \"_class\" property **/ @ApiModel(description = "Model for testing model with \"_class\" property") +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ClassModel implements Serializable { private @Valid String propertyClass; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return propertyClass; } + @JsonProperty("_class") public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java index 4cdbbef940d..74d489b5ace 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Client implements Serializable { private @Valid String client; @@ -34,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return client; } + @JsonProperty("client") public void setClient(String client) { this.client = client; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java index 87c3a825ba8..20599ecebcf 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Dog extends Animal implements Serializable { private @Valid String breed; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return breed; } + @JsonProperty("breed") public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java index 5496e3c8915..269faf93678 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/DogAllOf.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class DogAllOf implements Serializable { private @Valid String breed; @@ -34,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return breed; } + @JsonProperty("breed") public void setBreed(String breed) { this.breed = breed; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java index fc7770afa09..bf05c76fd9e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java @@ -13,9 +13,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class EnumArrays implements Serializable { @@ -52,7 +54,7 @@ public enum JustSymbolEnum { } private @Valid JustSymbolEnum justSymbol; - + public enum ArrayEnumEnum { FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); @@ -103,6 +105,7 @@ public enum ArrayEnumEnum { return justSymbol; } + @JsonProperty("just_symbol") public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } @@ -123,6 +126,7 @@ public enum ArrayEnumEnum { return arrayEnum; } + @JsonProperty("array_enum") public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java index 6c02f0647c9..34ec3b13e07 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java @@ -12,9 +12,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class EnumTest implements Serializable { @@ -171,6 +173,7 @@ public enum EnumNumberEnum { return enumString; } + @JsonProperty("enum_string") public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } @@ -192,6 +195,7 @@ public enum EnumNumberEnum { return enumStringRequired; } + @JsonProperty("enum_string_required") public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } @@ -212,6 +216,7 @@ public enum EnumNumberEnum { return enumInteger; } + @JsonProperty("enum_integer") public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } @@ -232,6 +237,7 @@ public enum EnumNumberEnum { return enumNumber; } + @JsonProperty("enum_number") public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } @@ -252,6 +258,7 @@ public enum EnumNumberEnum { return outerEnum; } + @JsonProperty("outerEnum") public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index b8ba37d5cdc..05ff7b2ea24 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import org.openapitools.model.ModelFile; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -13,18 +14,20 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class FileSchemaTestClass implements Serializable { - private @Valid java.io.File file; - private @Valid List files = new ArrayList(); + private @Valid ModelFile _file; + private @Valid List files = new ArrayList(); /** **/ - public FileSchemaTestClass file(java.io.File file) { - this.file = file; + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; return this; } @@ -33,17 +36,18 @@ import com.fasterxml.jackson.annotation.JsonValue; @ApiModelProperty(value = "") @JsonProperty("file") - public java.io.File getFile() { - return file; + public ModelFile getFile() { + return _file; } - public void setFile(java.io.File file) { - this.file = file; + @JsonProperty("file") + public void setFile(ModelFile _file) { + this._file = _file; } /** **/ - public FileSchemaTestClass files(List files) { + public FileSchemaTestClass files(List files) { this.files = files; return this; } @@ -53,11 +57,12 @@ import com.fasterxml.jackson.annotation.JsonValue; @ApiModelProperty(value = "") @JsonProperty("files") - public List getFiles() { + public List getFiles() { return files; } - public void setFiles(List files) { + @JsonProperty("files") + public void setFiles(List files) { this.files = files; } @@ -71,13 +76,13 @@ import com.fasterxml.jackson.annotation.JsonValue; return false; } FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && + return Objects.equals(this._file, fileSchemaTestClass._file) && Objects.equals(this.files, fileSchemaTestClass.files); } @Override public int hashCode() { - return Objects.hash(file, files); + return Objects.hash(_file, files); } @Override @@ -85,7 +90,7 @@ import com.fasterxml.jackson.annotation.JsonValue; StringBuilder sb = new StringBuilder(); sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); sb.append(" files: ").append(toIndentedString(files)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java index ca11645f9ae..bbb010c5ff1 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java @@ -16,9 +16,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class FormatTest implements Serializable { private @Valid Integer integer; @@ -54,6 +56,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return integer; } + @JsonProperty("integer") public void setInteger(Integer integer) { this.integer = integer; } @@ -76,6 +79,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return int32; } + @JsonProperty("int32") public void setInt32(Integer int32) { this.int32 = int32; } @@ -96,6 +100,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return int64; } + @JsonProperty("int64") public void setInt64(Long int64) { this.int64 = int64; } @@ -119,6 +124,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return number; } + @JsonProperty("number") public void setNumber(BigDecimal number) { this.number = number; } @@ -141,6 +147,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return _float; } + @JsonProperty("float") public void setFloat(Float _float) { this._float = _float; } @@ -163,6 +170,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return _double; } + @JsonProperty("double") public void setDouble(Double _double) { this._double = _double; } @@ -183,6 +191,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return string; } + @JsonProperty("string") public void setString(String string) { this.string = string; } @@ -204,6 +213,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return _byte; } + @JsonProperty("byte") public void setByte(byte[] _byte) { this._byte = _byte; } @@ -224,6 +234,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return binary; } + @JsonProperty("binary") public void setBinary(File binary) { this.binary = binary; } @@ -245,6 +256,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return date; } + @JsonProperty("date") public void setDate(LocalDate date) { this.date = date; } @@ -265,6 +277,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return dateTime; } + @JsonProperty("dateTime") public void setDateTime(Date dateTime) { this.dateTime = dateTime; } @@ -285,6 +298,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return uuid; } + @JsonProperty("uuid") public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -306,6 +320,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return password; } + @JsonProperty("password") public void setPassword(String password) { this.password = password; } @@ -326,6 +341,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return bigDecimal; } + @JsonProperty("BigDecimal") public void setBigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 6438846d569..db68308cdce 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class HasOnlyReadOnly implements Serializable { private @Valid String bar; @@ -35,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return bar; } + @JsonProperty("bar") public void setBar(String bar) { this.bar = bar; } @@ -55,6 +58,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return foo; } + @JsonProperty("foo") public void setFoo(String foo) { this.foo = foo; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java index a8eff4c21b2..f5c57914a90 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java @@ -14,13 +14,15 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class MapTest implements Serializable { private @Valid Map> mapMapOfString = new HashMap>(); - + public enum InnerEnum { UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); @@ -73,6 +75,7 @@ public enum InnerEnum { return mapMapOfString; } + @JsonProperty("map_map_of_string") public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } @@ -93,6 +96,7 @@ public enum InnerEnum { return mapOfEnumString; } + @JsonProperty("map_of_enum_string") public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } @@ -113,6 +117,7 @@ public enum InnerEnum { return directMap; } + @JsonProperty("direct_map") public void setDirectMap(Map directMap) { this.directMap = directMap; } @@ -133,6 +138,7 @@ public enum InnerEnum { return indirectMap; } + @JsonProperty("indirect_map") public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index aace3762eb9..77464620e9c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -17,9 +17,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { private @Valid UUID uuid; @@ -42,6 +44,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return uuid; } + @JsonProperty("uuid") public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -62,6 +65,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return dateTime; } + @JsonProperty("dateTime") public void setDateTime(Date dateTime) { this.dateTime = dateTime; } @@ -82,6 +86,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return map; } + @JsonProperty("map") public void setMap(Map map) { this.map = map; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java index d96df1aceae..7aeb481a43a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java @@ -11,11 +11,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model name starting with number **/ @ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Model200Response implements Serializable { private @Valid Integer name; @@ -37,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(Integer name) { this.name = name; } @@ -57,6 +60,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return propertyClass; } + @JsonProperty("class") public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java index 952439560b5..d541b6586f3 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ModelApiResponse implements Serializable { private @Valid Integer code; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return code; } + @JsonProperty("code") public void setCode(Integer code) { this.code = code; } @@ -56,6 +59,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return type; } + @JsonProperty("type") public void setType(String type) { this.type = type; } @@ -76,6 +80,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return message; } + @JsonProperty("message") public void setMessage(String message) { this.message = message; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java new file mode 100644 index 00000000000..8ce42cac839 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + **/ +@ApiModel(description = "Must be named `File` for test.") +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ModelFile implements Serializable { + + private @Valid String sourceURI; + + /** + * Test capitalization + **/ + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + + + @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") + public String getSourceURI() { + return sourceURI; + } + + @JsonProperty("sourceURI") + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java new file mode 100644 index 00000000000..f09d013e2dc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelList.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ModelList implements Serializable { + + private @Valid String _123list; + + /** + **/ + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public String get123list() { + return _123list; + } + + @JsonProperty("123-list") + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java index 6d6cb5b806f..836ae092d18 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java @@ -11,11 +11,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing reserved words **/ @ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ModelReturn implements Serializable { private @Valid Integer _return; @@ -36,6 +38,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return _return; } + @JsonProperty("return") public void setReturn(Integer _return) { this._return = _return; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java index 6fd504dbe9d..54d09365aed 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java @@ -11,11 +11,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model name same as property name **/ @ApiModel(description = "Model for testing model name same as property name") +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Name implements Serializable { private @Valid Integer name; @@ -40,6 +42,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(Integer name) { this.name = name; } @@ -60,6 +63,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return snakeCase; } + @JsonProperty("snake_case") public void setSnakeCase(Integer snakeCase) { this.snakeCase = snakeCase; } @@ -80,6 +84,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return property; } + @JsonProperty("property") public void setProperty(String property) { this.property = property; } @@ -100,6 +105,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return _123number; } + @JsonProperty("123Number") public void set123number(Integer _123number) { this._123number = _123number; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java index 07a70cd9da5..9ea507266dc 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java @@ -12,9 +12,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class NumberOnly implements Serializable { private @Valid BigDecimal justNumber; @@ -35,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return justNumber; } + @JsonProperty("JustNumber") public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java index 9929a0d5043..e67d3772f9d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java @@ -12,9 +12,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Order implements Serializable { private @Valid Long id; @@ -73,6 +75,7 @@ public enum StatusEnum { return id; } + @JsonProperty("id") public void setId(Long id) { this.id = id; } @@ -93,6 +96,7 @@ public enum StatusEnum { return petId; } + @JsonProperty("petId") public void setPetId(Long petId) { this.petId = petId; } @@ -113,6 +117,7 @@ public enum StatusEnum { return quantity; } + @JsonProperty("quantity") public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -133,6 +138,7 @@ public enum StatusEnum { return shipDate; } + @JsonProperty("shipDate") public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -154,6 +160,7 @@ public enum StatusEnum { return status; } + @JsonProperty("status") public void setStatus(StatusEnum status) { this.status = status; } @@ -174,6 +181,7 @@ public enum StatusEnum { return complete; } + @JsonProperty("complete") public void setComplete(Boolean complete) { this.complete = complete; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java index 6e34a0e0a80..95ff03416bb 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java @@ -12,9 +12,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class OuterComposite implements Serializable { private @Valid BigDecimal myNumber; @@ -37,6 +39,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return myNumber; } + @JsonProperty("my_number") public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } @@ -57,6 +60,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return myString; } + @JsonProperty("my_string") public void setMyString(String myString) { this.myString = myString; } @@ -77,6 +81,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return myBoolean; } + @JsonProperty("my_boolean") public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java index 63e1d1abbd3..7162d94b3b8 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; @@ -17,9 +18,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Pet implements Serializable { private @Valid Long id; @@ -78,6 +81,7 @@ public enum StatusEnum { return id; } + @JsonProperty("id") public void setId(Long id) { this.id = id; } @@ -98,6 +102,7 @@ public enum StatusEnum { return category; } + @JsonProperty("category") public void setCategory(Category category) { this.category = category; } @@ -119,6 +124,7 @@ public enum StatusEnum { return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } @@ -140,6 +146,8 @@ public enum StatusEnum { return photoUrls; } + @JsonProperty("photoUrls") + @JsonDeserialize(as = LinkedHashSet.class) public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } @@ -160,6 +168,7 @@ public enum StatusEnum { return tags; } + @JsonProperty("tags") public void setTags(List tags) { this.tags = tags; } @@ -181,6 +190,7 @@ public enum StatusEnum { return status; } + @JsonProperty("status") public void setStatus(StatusEnum status) { this.status = status; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 72efcebf52c..71451f9cf68 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class ReadOnlyFirst implements Serializable { private @Valid String bar; @@ -35,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return bar; } + @JsonProperty("bar") public void setBar(String bar) { this.bar = bar; } @@ -55,6 +58,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return baz; } + @JsonProperty("baz") public void setBaz(String baz) { this.baz = baz; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java index ece6b68dc3a..0340c7996ab 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class SpecialModelName implements Serializable { private @Valid Long $specialPropertyName; @@ -34,6 +36,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return $specialPropertyName; } + @JsonProperty("$special[property.name]") public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java index 1c7c5198894..db7d608abd5 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class Tag implements Serializable { private @Valid Long id; @@ -35,6 +37,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return id; } + @JsonProperty("id") public void setId(Long id) { this.id = id; } @@ -55,6 +58,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return name; } + @JsonProperty("name") public void setName(String name) { this.name = name; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 502c22c455e..a093d79a6d6 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class TypeHolderDefault implements Serializable { private @Valid String stringItem = "what"; @@ -42,6 +44,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return stringItem; } + @JsonProperty("string_item") public void setStringItem(String stringItem) { this.stringItem = stringItem; } @@ -63,6 +66,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return numberItem; } + @JsonProperty("number_item") public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } @@ -84,6 +88,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return integerItem; } + @JsonProperty("integer_item") public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } @@ -105,6 +110,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return boolItem; } + @JsonProperty("bool_item") public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } @@ -126,6 +132,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayItem; } + @JsonProperty("array_item") public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java index fb31859dedd..daaffc8af45 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class TypeHolderExample implements Serializable { private @Valid String stringItem; @@ -43,6 +45,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return stringItem; } + @JsonProperty("string_item") public void setStringItem(String stringItem) { this.stringItem = stringItem; } @@ -64,6 +67,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return numberItem; } + @JsonProperty("number_item") public void setNumberItem(BigDecimal numberItem) { this.numberItem = numberItem; } @@ -85,6 +89,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return floatItem; } + @JsonProperty("float_item") public void setFloatItem(Float floatItem) { this.floatItem = floatItem; } @@ -106,6 +111,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return integerItem; } + @JsonProperty("integer_item") public void setIntegerItem(Integer integerItem) { this.integerItem = integerItem; } @@ -127,6 +133,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return boolItem; } + @JsonProperty("bool_item") public void setBoolItem(Boolean boolItem) { this.boolItem = boolItem; } @@ -148,6 +155,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return arrayItem; } + @JsonProperty("array_item") public void setArrayItem(List arrayItem) { this.arrayItem = arrayItem; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java index ad16074f63b..271676fb2e0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java @@ -11,9 +11,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class User implements Serializable { private @Valid Long id; @@ -41,6 +43,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return id; } + @JsonProperty("id") public void setId(Long id) { this.id = id; } @@ -61,6 +64,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return username; } + @JsonProperty("username") public void setUsername(String username) { this.username = username; } @@ -81,6 +85,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return firstName; } + @JsonProperty("firstName") public void setFirstName(String firstName) { this.firstName = firstName; } @@ -101,6 +106,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return lastName; } + @JsonProperty("lastName") public void setLastName(String lastName) { this.lastName = lastName; } @@ -121,6 +127,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return email; } + @JsonProperty("email") public void setEmail(String email) { this.email = email; } @@ -141,6 +148,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return password; } + @JsonProperty("password") public void setPassword(String password) { this.password = password; } @@ -161,6 +169,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return phone; } + @JsonProperty("phone") public void setPhone(String phone) { this.phone = phone; } @@ -182,6 +191,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return userStatus; } + @JsonProperty("userStatus") public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java index 15a5d35673f..241ebb4e1bc 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/XmlItem.java @@ -14,9 +14,11 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class XmlItem implements Serializable { private @Valid String attributeString; @@ -65,6 +67,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return attributeString; } + @JsonProperty("attribute_string") public void setAttributeString(String attributeString) { this.attributeString = attributeString; } @@ -85,6 +88,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return attributeNumber; } + @JsonProperty("attribute_number") public void setAttributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; } @@ -105,6 +109,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return attributeInteger; } + @JsonProperty("attribute_integer") public void setAttributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; } @@ -125,6 +130,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return attributeBoolean; } + @JsonProperty("attribute_boolean") public void setAttributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; } @@ -145,6 +151,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return wrappedArray; } + @JsonProperty("wrapped_array") public void setWrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; } @@ -165,6 +172,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return nameString; } + @JsonProperty("name_string") public void setNameString(String nameString) { this.nameString = nameString; } @@ -185,6 +193,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return nameNumber; } + @JsonProperty("name_number") public void setNameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; } @@ -205,6 +214,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return nameInteger; } + @JsonProperty("name_integer") public void setNameInteger(Integer nameInteger) { this.nameInteger = nameInteger; } @@ -225,6 +235,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return nameBoolean; } + @JsonProperty("name_boolean") public void setNameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; } @@ -245,6 +256,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return nameArray; } + @JsonProperty("name_array") public void setNameArray(List nameArray) { this.nameArray = nameArray; } @@ -265,6 +277,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return nameWrappedArray; } + @JsonProperty("name_wrapped_array") public void setNameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; } @@ -285,6 +298,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixString; } + @JsonProperty("prefix_string") public void setPrefixString(String prefixString) { this.prefixString = prefixString; } @@ -305,6 +319,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNumber; } + @JsonProperty("prefix_number") public void setPrefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; } @@ -325,6 +340,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixInteger; } + @JsonProperty("prefix_integer") public void setPrefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; } @@ -345,6 +361,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixBoolean; } + @JsonProperty("prefix_boolean") public void setPrefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; } @@ -365,6 +382,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixArray; } + @JsonProperty("prefix_array") public void setPrefixArray(List prefixArray) { this.prefixArray = prefixArray; } @@ -385,6 +403,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixWrappedArray; } + @JsonProperty("prefix_wrapped_array") public void setPrefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; } @@ -405,6 +424,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return namespaceString; } + @JsonProperty("namespace_string") public void setNamespaceString(String namespaceString) { this.namespaceString = namespaceString; } @@ -425,6 +445,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return namespaceNumber; } + @JsonProperty("namespace_number") public void setNamespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; } @@ -445,6 +466,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return namespaceInteger; } + @JsonProperty("namespace_integer") public void setNamespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; } @@ -465,6 +487,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return namespaceBoolean; } + @JsonProperty("namespace_boolean") public void setNamespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; } @@ -485,6 +508,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return namespaceArray; } + @JsonProperty("namespace_array") public void setNamespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; } @@ -505,6 +529,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return namespaceWrappedArray; } + @JsonProperty("namespace_wrapped_array") public void setNamespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; } @@ -525,6 +550,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNsString; } + @JsonProperty("prefix_ns_string") public void setPrefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; } @@ -545,6 +571,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNsNumber; } + @JsonProperty("prefix_ns_number") public void setPrefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; } @@ -565,6 +592,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNsInteger; } + @JsonProperty("prefix_ns_integer") public void setPrefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; } @@ -585,6 +613,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNsBoolean; } + @JsonProperty("prefix_ns_boolean") public void setPrefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; } @@ -605,6 +634,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNsArray; } + @JsonProperty("prefix_ns_array") public void setPrefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; } @@ -625,6 +655,7 @@ import com.fasterxml.jackson.annotation.JsonValue; return prefixNsWrappedArray; } + @JsonProperty("prefix_ns_wrapped_array") public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml index 232ac76fcc3..55cc66ba711 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml @@ -204,7 +204,7 @@ 1.19.1 2.9.9 1.7.21 - 4.13 + 4.13.1 4.0.4 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index 9356dcfe7eb..3d86b2b2769 100644 --- a/samples/server/petstore/jaxrs/jersey1/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1/pom.xml @@ -204,7 +204,7 @@ 1.19.1 2.9.9 1.7.21 - 4.13 + 4.13.1 4.0.4 UTF-8 From 604c1c0806726dad439eea1680d84afaf0f81e36 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 26 Jan 2022 16:23:41 +0800 Subject: [PATCH 095/113] update jaxrs cxf, resteasy dependencies (#11414) --- .../src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/cxf/server/pom.mustache | 2 +- .../src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache | 2 +- .../src/main/resources/JavaJaxRS/resteasy/gradle.mustache | 2 +- samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml | 2 +- samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml | 2 +- .../petstore/jaxrs-cxf-test-data/.openapi-generator/FILES | 1 - samples/server/petstore/jaxrs-cxf/pom.xml | 2 +- .../server/petstore/jaxrs-resteasy/default-value/build.gradle | 2 +- samples/server/petstore/jaxrs-resteasy/default/build.gradle | 2 +- samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle | 2 +- samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle | 2 +- samples/server/petstore/jaxrs-resteasy/eap/build.gradle | 2 +- samples/server/petstore/jaxrs-resteasy/java8/build.gradle | 2 +- samples/server/petstore/jaxrs-resteasy/joda/build.gradle | 2 +- 15 files changed, 14 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index c523f0a994c..338527fe489 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -346,7 +346,7 @@ {{/generateSpringBootApplication}} {{/generateSpringApplication}} {{^generateSpringBootApplication}} - 4.13 + 4.13.1 1.2.0 {{/generateSpringBootApplication}} 3.3.0 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 5649020a9ab..752f94497fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -266,7 +266,7 @@ ${java.version} 1.5.22 9.2.9.v20150224 - 4.13 + 4.13.1 1.2.0 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache index b343b8ec954..ca943874af9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache @@ -25,7 +25,7 @@ dependencies { {{#java8}} compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9' {{/java8}} - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache index cd6febf1470..4c383c52c6a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache @@ -25,7 +25,7 @@ dependencies { //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index bb88fe50d58..9643f632d71 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -201,7 +201,7 @@ ${java.version} 1.5.22 9.2.9.v20150224 - 4.13 + 4.13.1 1.2.0 2.0.2 3.3.0 diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index 37380542275..07106478d1f 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -201,7 +201,7 @@ ${java.version} 1.5.22 9.2.9.v20150224 - 4.13 + 4.13.1 1.2.0 2.0.2 3.3.0 diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES index 8a46c3fe211..f6258368299 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/FILES @@ -64,7 +64,6 @@ src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java src/main/resources/ApplicationContext.xml -src/main/resources/test-data.json src/main/webapp/WEB-INF/context.xml src/main/webapp/WEB-INF/web.xml src/test/java/org/openapitools/api/SpringBootApplication.java diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index a4a13cf0922..5f7076fa0c1 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -201,7 +201,7 @@ ${java.version} 1.5.22 9.2.9.v20150224 - 4.13 + 4.13.1 1.2.0 2.0.2 3.3.0 diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/build.gradle b/samples/server/petstore/jaxrs-resteasy/default-value/build.gradle index dd8b11f8b67..e50aba9a14d 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/default-value/build.gradle @@ -23,7 +23,7 @@ dependencies { //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/default/build.gradle b/samples/server/petstore/jaxrs-resteasy/default/build.gradle index dd8b11f8b67..e50aba9a14d 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/default/build.gradle @@ -23,7 +23,7 @@ dependencies { //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle index 68567d57b78..c55a26708d2 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle @@ -17,7 +17,7 @@ dependencies { compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'jakarta.validation:jakarta.validation-api:2.0.2' compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle index 6c0bb712e06..6b89e90c1e3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -18,7 +18,7 @@ dependencies { providedCompile 'jakarta.validation:jakarta.validation-api:2.0.2' compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.9' compile 'joda-time:joda-time:2.7' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle index 6c0bb712e06..6b89e90c1e3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -18,7 +18,7 @@ dependencies { providedCompile 'jakarta.validation:jakarta.validation-api:2.0.2' compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.9' compile 'joda-time:joda-time:2.7' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build.gradle b/samples/server/petstore/jaxrs-resteasy/java8/build.gradle index dd8b11f8b67..e50aba9a14d 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/java8/build.gradle @@ -23,7 +23,7 @@ dependencies { //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle index dd8b11f8b67..e50aba9a14d 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle @@ -23,7 +23,7 @@ dependencies { //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' - testCompile 'junit:junit:4.13', + testCompile 'junit:junit:4.13.1', 'org.hamcrest:hamcrest-core:1.3' } From 34395c31730e5a866224ea4880cda3bd05046d5c Mon Sep 17 00:00:00 2001 From: feech Date: Wed, 26 Jan 2022 08:32:09 +0000 Subject: [PATCH 096/113] Makes the maven plugin to generate Model-tests and API-tests in generated-test-sources (#11294) * added support for independent test-folder * generate updated docs * generate updated docs * generate updated docs * trigger a new CI builds Co-authored-by: William Cheng --- docs/generators/groovy.md | 1 + docs/generators/java-camel.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/spring.md | 1 + .../codegen/DefaultGenerator.java | 10 ++++-- .../languages/AbstractJavaCodegen.java | 32 +++++++++++++++++-- .../codegen/java/AbstractJavaCodegenTest.java | 18 +++++++++++ 23 files changed, 75 insertions(+), 5 deletions(-) diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 06b15957dde..4c2b6f644d5 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -59,6 +59,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/groovy| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 4a8a1392133..c3849943020 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -86,6 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|server title name or client service name| |OpenAPI Spring| |unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| |useBeanValidation|Use BeanValidation API annotations| |true| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 50f1bfb4817..e924a759037 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -61,6 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/gen/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index c1ba0089f6b..0de7278de01 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -65,6 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |test|Specify which test tool to generate files for|
**junit**
Use JUnit as test tool
**spock**
Use Spock as test tool
|junit| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|Client service name| |null| |useBeanValidation|Use BeanValidation API annotations| |true| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index b02b75270d8..79aa36220fd 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -64,6 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| |useTags|use tags for creating interface and controller classnames| |false| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 4e1183c50be..f6b391ea431 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -66,6 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |springBootAdminUri|Spring-Boot URI| |null| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|server title name or client service name| |null| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| |zipkinUri|Zipkin URI| |null| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index b262f6e4442..002dc7eae11 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -66,6 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |/app| |supportAsync|Support Async operations| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|server title name or client service name| |openapi-java-playframework| |useBeanValidation|Use BeanValidation API annotations| |true| |useInterfaces|Makes the controllerImp implements an interface to facilitate automatic completion when updating from version x to y of your spec| |true| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index e8c9d5c33bc..6aa1f1fe2a1 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -61,6 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 24fe9e99f2b..4089bedda4a 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -61,6 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 873382854ae..27ba174790d 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -63,6 +63,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |vertxSwaggerRouterVersion|Specify the version of the swagger router library| |null| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 132437fd9bd..4132f755c12 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -74,6 +74,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |supportStreaming|Support streaming endpoint (beta)| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, libraries| |false| |useBeanValidation|Use BeanValidation API annotations| |false| |useGzipFeature|Send gzip-encoded requests| |false| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 4388a69e60c..9ac40926c75 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -70,6 +70,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/gen/java| |supportAsync|Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| |useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 6d53881cb17..cd9d4fee230 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -61,6 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/gen/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |useBeanValidation|Use BeanValidation API annotations| |false| |useGenericResponse|Use generic response| |false| |useGzipFeatureForTests|Use Gzip Feature for tests| |false| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 65495572e1f..7518926c80c 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -73,6 +73,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |supportMultipleSpringServices|Support generation of Spring services from multiple specifications| |false| |testDataControlFile|JSON file to control test data generation| |null| |testDataFile|JSON file to contain generated test data| |null| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useAnnotatedBasePath|Use @Path annotations for basePath| |false| |useBeanValidation|Use BeanValidation API annotations| |true| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 1818ba5b42e..ca2506a6033 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -68,6 +68,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useAnnotatedBasePath|Use @Path annotations for basePath| |false| |useBeanValidation|Use BeanValidation API annotations| |true| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index aa4bf2ebf96..390aeca70a0 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -65,6 +65,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |supportJava6|Whether to support Java6 with the Jersey1/2 library.| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| |useTags|use tags for creating interface and controller classnames| |false| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index a3ed32580ca..9a63b82d1ce 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -64,6 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| |useSwaggerFeature|Use dynamic Swagger generator| |false| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 6ff30a6051e..fea68a9800c 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -64,6 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| |useTags|use tags for creating interface and controller classnames| |false| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 9c8059ccd14..61aa2962a0c 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -70,6 +70,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |supportAsync|Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| |useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index d778596fbf1..849bd84b8f1 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -79,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|server title name or client service name| |OpenAPI Spring| |unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| |useBeanValidation|Use BeanValidation API annotations| |true| 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 34c6b4116c3..aaa30709e10 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 @@ -351,7 +351,7 @@ public class DefaultGenerator implements Generator { if (modelTestFile.exists()) { this.templateProcessor.skip(modelTestFile.toPath(), "Test files never overwrite an existing file of the same name."); } else { - File written = processTemplateToFile(models, templateName, filename, generateModelTests, CodegenConstants.MODEL_TESTS); + File written = processTemplateToFile(models, templateName, filename, generateModelTests, CodegenConstants.MODEL_TESTS, config.modelTestFileFolder()); if (written != null) { files.add(written); if (config.isEnablePostProcessFile() && !dryRun) { @@ -639,7 +639,7 @@ public class DefaultGenerator implements Generator { if (apiTestFile.exists()) { this.templateProcessor.skip(apiTestFile.toPath(), "Test files never overwrite an existing file of the same name."); } else { - File written = processTemplateToFile(operation, templateName, filename, generateApiTests, CodegenConstants.API_TESTS); + File written = processTemplateToFile(operation, templateName, filename, generateApiTests, CodegenConstants.API_TESTS, config.apiTestFileFolder()); if (written != null) { files.add(written); if (config.isEnablePostProcessFile() && !dryRun) { @@ -1018,11 +1018,15 @@ public class DefaultGenerator implements Generator { } protected File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException { + return processTemplateToFile(templateData, templateName, outputFilename, shouldGenerate, skippedByOption, this.config.getOutputDir()); + } + + private File processTemplateToFile(Map templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption, String intendedOutputDir) throws IOException { String adjustedOutputFilename = outputFilename.replaceAll("//", "/").replace('/', File.separatorChar); File target = new File(adjustedOutputFilename); if (ignoreProcessor.allowsFile(target)) { if (shouldGenerate) { - Path outDir = java.nio.file.Paths.get(this.config.getOutputDir()).toAbsolutePath(); + Path outDir = java.nio.file.Paths.get(intendedOutputDir).toAbsolutePath(); Path absoluteTarget = target.toPath().toAbsolutePath(); if (!absoluteTarget.startsWith(outDir)) { throw new RuntimeException(String.format(Locale.ROOT, "Target files must be generated within the output directory; absoluteTarget=%s outDir=%s", absoluteTarget, outDir)); 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 05cb3233ebf..2933bd3302b 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 @@ -70,6 +70,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive"; public static final String OPENAPI_NULLABLE = "openApiNullable"; public static final String JACKSON = "jackson"; + public static final String TEST_OUTPUT = "testOutput"; + + public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; protected String dateLibrary = "threetenbp"; protected boolean supportAsync = false; @@ -113,6 +116,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected List additionalModelTypeAnnotations = new LinkedList<>(); protected List additionalEnumTypeAnnotations = new LinkedList<>(); protected boolean openApiNullable = true; + protected String outputTestFolder = ""; protected DocumentationProvider documentationProvider; protected AnnotationLibrary annotationLibrary; @@ -262,6 +266,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code snapShotVersionOptions.put("false", "Use a Release Version"); snapShotVersion.setEnum(snapShotVersionOptions); cliOptions.add(snapShotVersion); + cliOptions.add(CliOption.newString(TEST_OUTPUT, "Set output folder for models and APIs tests").defaultValue(DEFAULT_TEST_FOLDER)); if (null != defaultDocumentationProvider()) { CliOption documentationProviderCliOption = new CliOption(DOCUMENTATION_PROVIDER, @@ -638,6 +643,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } else if (dateLibrary.equals("legacy")) { additionalProperties.put("legacyDates", "true"); } + + if (additionalProperties.containsKey(TEST_OUTPUT)) { + setOutputTestFolder(additionalProperties.get(TEST_OUTPUT).toString()); + } } @Override @@ -697,12 +706,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code @Override public String apiTestFileFolder() { - return (outputFolder + File.separator + testFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + return (outputTestFolder + File.separator + testFolder + File.separator + apiPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); } @Override public String modelTestFileFolder() { - return (outputFolder + File.separator + testFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); + return (outputTestFolder + File.separator + testFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); } @Override @@ -1813,6 +1822,25 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.openApiNullable = openApiNullable; } + @Override + public void setOutputDir(String dir) { + super.setOutputDir(dir); + if (this.outputTestFolder.isEmpty()) { + setOutputTestFolder(dir); + } + } + + public String getOutputTestFolder() { + if (outputTestFolder.isEmpty()) { + return DEFAULT_TEST_FOLDER; + } + return outputTestFolder; + } + + public void setOutputTestFolder(String outputTestFolder) { + this.outputTestFolder = outputTestFolder; + } + @Override public DocumentationProvider getDocumentationProvider() { return documentationProvider; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 7016aa95fe2..13160dc8cda 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -350,6 +350,24 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(codegen.modelTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/model".replace('/', File.separatorChar)); } + @Test + public void apiTestFileFolderDirect() { + final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setOutputTestFolder("/User/open.api.tools"); + codegen.setTestFolder("test.folder"); + codegen.setApiPackage("org.openapitools.codegen.api"); + Assert.assertEquals(codegen.apiTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/api".replace('/', File.separatorChar)); + } + + @Test + public void modelTestFileFolderDirect() { + final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + codegen.setOutputTestFolder("/User/open.api.tools"); + codegen.setTestFolder("test.folder"); + codegen.setModelPackage("org.openapitools.codegen.model"); + Assert.assertEquals(codegen.modelTestFileFolder(), "/User/open.api.tools/test.folder/org/openapitools/codegen/model".replace('/', File.separatorChar)); + } + @Test public void modelFileFolder() { final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); From 9f02759ae4a224a5e55c7db6511a854ffe119ad8 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 26 Jan 2022 16:37:39 +0800 Subject: [PATCH 097/113] update doc --- docs/generators/java-micronaut-server.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 1089565806f..93b25d43d68 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -66,6 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |test|Specify which test tool to generate files for|
**junit**
Use JUnit as test tool
**spock**
Use Spock as test tool
|junit| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |title|Client service name| |null| |useAuth|Whether to import authorization and to annotate controller methods accordingly| |true| |useBeanValidation|Use BeanValidation API annotations| |true| From 0bb08a7268185bc5e445c182dbce7e0b2ea6bf89 Mon Sep 17 00:00:00 2001 From: grzegorz-moto <60603738+grzegorz-moto@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:02:21 +0100 Subject: [PATCH 098/113] [kotlin] back ticks escaping of keywords and more (#11166) * fix base class and back-ticks * back-ticks in key word fix * back-ticks fix in kotlin keywords * samples * remove EOL Co-authored-by: ags039 --- .../src/main/resources/kotlin-spring/dataClass.mustache | 4 ++-- .../src/main/resources/kotlin-spring/dataClassOptVar.mustache | 2 +- .../src/main/resources/kotlin-spring/dataClassReqVar.mustache | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index c13105bcf59..17191e94dd5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -11,7 +11,7 @@ {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>dataClassOptVar}}{{^-last}}, {{/-last}}{{/optionalVars}} -) {{/discriminator}}{{#parent}}: {{{.}}}(){{/parent}}{ +) {{/discriminator}}{{#parent}}: {{{.}}}{{/parent}}{ {{#discriminator}} {{#requiredVars}} {{>interfaceReqVar}} @@ -25,7 +25,7 @@ * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{nameInCamelCase}}(val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) { + enum class {{{nameInCamelCase}}}(val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) { {{#allowableValues}}{{#enumVars}} @JsonProperty({{{value}}}) {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index ea669760004..64b91fd260e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -1,4 +1,4 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}} - @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{nameInCamelCase}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 33e838a43fb..d69a07dd85a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,3 +1,3 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}} - @field:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{nameInCamelCase}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}?{{/isReadOnly}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{#isReadOnly}}{{^defaultValue}} = null{{/defaultValue}}{{/isReadOnly}} \ No newline at end of file + @field:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}?{{/isReadOnly}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{#isReadOnly}}{{^defaultValue}} = null{{/defaultValue}}{{/isReadOnly}} \ No newline at end of file From 27d322de56fb480a1c374efeed894de1d08e1703 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 27 Jan 2022 21:14:50 +0800 Subject: [PATCH 099/113] fix isArray, isMap tag in jaxrs spec templates (#11424) --- .../resources/JavaJaxRS/spec/pojo.mustache | 8 +- .../model/AdditionalPropertiesClass.java | 128 ++++++++++++++++ .../model/ArrayOfArrayOfNumberOnly.java | 16 ++ .../openapitools/model/ArrayOfNumberOnly.java | 16 ++ .../org/openapitools/model/ArrayTest.java | 48 ++++++ .../org/openapitools/model/EnumArrays.java | 16 ++ .../model/FileSchemaTestClass.java | 16 ++ .../java/org/openapitools/model/MapTest.java | 64 ++++++++ ...ropertiesAndAdditionalPropertiesClass.java | 16 ++ .../gen/java/org/openapitools/model/Pet.java | 32 ++++ .../openapitools/model/TypeHolderDefault.java | 16 ++ .../openapitools/model/TypeHolderExample.java | 16 ++ .../java/org/openapitools/model/XmlItem.java | 144 ++++++++++++++++++ .../model/AdditionalPropertiesClass.java | 128 ++++++++++++++++ .../model/ArrayOfArrayOfNumberOnly.java | 16 ++ .../openapitools/model/ArrayOfNumberOnly.java | 16 ++ .../org/openapitools/model/ArrayTest.java | 48 ++++++ .../org/openapitools/model/EnumArrays.java | 16 ++ .../model/FileSchemaTestClass.java | 16 ++ .../java/org/openapitools/model/MapTest.java | 64 ++++++++ ...ropertiesAndAdditionalPropertiesClass.java | 16 ++ .../gen/java/org/openapitools/model/Pet.java | 32 ++++ .../openapitools/model/TypeHolderDefault.java | 16 ++ .../openapitools/model/TypeHolderExample.java | 16 ++ .../java/org/openapitools/model/XmlItem.java | 144 ++++++++++++++++++ 25 files changed, 1060 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 9d0793fe775..4e9af1007bd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -55,7 +55,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.{{name}} = {{name}}; } - {{#isListContainer}} + {{#isArray}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -72,8 +72,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; return this; } - {{/isListContainer}} - {{#isMapContainer}} + {{/isArray}} + {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -90,7 +90,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; return this; } - {{/isMapContainer}} + {{/isMap}} {{/vars}} @Override diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 61bec1b6ff4..4ebb303b837 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,6 +55,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapString = mapString; } + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap(); + } + + this.mapString.put(key, mapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { + if (mapStringItem != null && this.mapString != null) { + this.mapString.remove(mapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapNumber(Map mapNumber) { @@ -76,6 +92,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapNumber = mapNumber; } + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap(); + } + + this.mapNumber.put(key, mapNumberItem); + return this; + } + + public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { + if (mapNumberItem != null && this.mapNumber != null) { + this.mapNumber.remove(mapNumberItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapInteger(Map mapInteger) { @@ -97,6 +129,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapInteger = mapInteger; } + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap(); + } + + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { + if (mapIntegerItem != null && this.mapInteger != null) { + this.mapInteger.remove(mapIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { @@ -118,6 +166,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap(); + } + + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { + if (mapBooleanItem != null && this.mapBoolean != null) { + this.mapBoolean.remove(mapBooleanItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { @@ -139,6 +203,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap>(); + } + + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { + if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { + this.mapArrayInteger.remove(mapArrayIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { @@ -160,6 +240,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap>(); + } + + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { + if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(mapArrayAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapString(Map> mapMapString) { @@ -181,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapString = mapMapString; } + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap>(); + } + + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { + if (mapMapStringItem != null && this.mapMapString != null) { + this.mapMapString.remove(mapMapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { @@ -202,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap>(); + } + + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { + if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { + this.mapMapAnytype.remove(mapMapAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass anytype1(Object anytype1) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cbca7de2f69..e4dc1fd6837 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayNumber = arrayArrayNumber; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) { + if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) { + this.arrayArrayNumber.remove(arrayArrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ad7cc3db32e..19e29e9703b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayNumber = arrayNumber; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + + this.arrayNumber.add(arrayNumberItem); + return this; + } + + public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) { + if (arrayNumberItem != null && this.arrayNumber != null) { + this.arrayNumber.remove(arrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java index f2b7469f65c..bda8bb29dc8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java @@ -46,6 +46,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayOfString = arrayOfString; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) { + if (arrayOfStringItem != null && this.arrayOfString != null) { + this.arrayOfString.remove(arrayOfStringItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @@ -67,6 +83,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) { + this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { @@ -88,6 +120,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + public ArrayTest removeArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) { + this.arrayArrayOfModel.remove(arrayArrayOfModelItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java index bf05c76fd9e..f9f302e48cc 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,6 +131,22 @@ public enum ArrayEnumEnum { this.arrayEnum = arrayEnum; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + + this.arrayEnum.add(arrayEnumItem); + return this; + } + + public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (arrayEnumItem != null && this.arrayEnum != null) { + this.arrayEnum.remove(arrayEnumItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 05ff7b2ea24..6828ddc9bd4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -66,6 +66,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.files = files; } + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + + this.files.add(filesItem); + return this; + } + + public FileSchemaTestClass removeFilesItem(ModelFile filesItem) { + if (filesItem != null && this.files != null) { + this.files.remove(filesItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index f5c57914a90..fe54c2dbaf1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -80,6 +80,22 @@ public enum InnerEnum { this.mapMapOfString = mapMapOfString; } + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { + if (mapMapOfStringItem != null && this.mapMapOfString != null) { + this.mapMapOfString.remove(mapMapOfStringItem); + } + + return this; + } /** **/ public MapTest mapOfEnumString(Map mapOfEnumString) { @@ -101,6 +117,22 @@ public enum InnerEnum { this.mapOfEnumString = mapOfEnumString; } + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { + if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { + this.mapOfEnumString.remove(mapOfEnumStringItem); + } + + return this; + } /** **/ public MapTest directMap(Map directMap) { @@ -122,6 +154,22 @@ public enum InnerEnum { this.directMap = directMap; } + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + + this.directMap.put(key, directMapItem); + return this; + } + + public MapTest removeDirectMapItem(Boolean directMapItem) { + if (directMapItem != null && this.directMap != null) { + this.directMap.remove(directMapItem); + } + + return this; + } /** **/ public MapTest indirectMap(Map indirectMap) { @@ -143,6 +191,22 @@ public enum InnerEnum { this.indirectMap = indirectMap; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + + this.indirectMap.put(key, indirectMapItem); + return this; + } + + public MapTest removeIndirectMapItem(Boolean indirectMapItem) { + if (indirectMapItem != null && this.indirectMap != null) { + this.indirectMap.remove(indirectMapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 77464620e9c..54bbb7ca2f0 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -91,6 +91,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.map = map; } + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + + this.map.put(key, mapItem); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { + if (mapItem != null && this.map != null) { + this.map.remove(mapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index 7162d94b3b8..b35574db4cd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -152,6 +152,22 @@ public enum StatusEnum { this.photoUrls = photoUrls; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet(); + } + + this.photoUrls.add(photoUrlsItem); + return this; + } + + public Pet removePhotoUrlsItem(String photoUrlsItem) { + if (photoUrlsItem != null && this.photoUrls != null) { + this.photoUrls.remove(photoUrlsItem); + } + + return this; + } /** **/ public Pet tags(List tags) { @@ -173,6 +189,22 @@ public enum StatusEnum { this.tags = tags; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + + this.tags.add(tagsItem); + return this; + } + + public Pet removeTagsItem(Tag tagsItem) { + if (tagsItem != null && this.tags != null) { + this.tags.remove(tagsItem); + } + + return this; + } /** * pet status in the store **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a093d79a6d6..1d7658a94fa 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -137,6 +137,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java index daaffc8af45..cdb7058acec 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -160,6 +160,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java index 241ebb4e1bc..8e593b39392 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/XmlItem.java @@ -156,6 +156,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.wrappedArray = wrappedArray; } + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList(); + } + + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + public XmlItem removeWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArrayItem != null && this.wrappedArray != null) { + this.wrappedArray.remove(wrappedArrayItem); + } + + return this; + } /** **/ public XmlItem nameString(String nameString) { @@ -261,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameArray = nameArray; } + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList(); + } + + this.nameArray.add(nameArrayItem); + return this; + } + + public XmlItem removeNameArrayItem(Integer nameArrayItem) { + if (nameArrayItem != null && this.nameArray != null) { + this.nameArray.remove(nameArrayItem); + } + + return this; + } /** **/ public XmlItem nameWrappedArray(List nameWrappedArray) { @@ -282,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameWrappedArray = nameWrappedArray; } + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList(); + } + + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + public XmlItem removeNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArrayItem != null && this.nameWrappedArray != null) { + this.nameWrappedArray.remove(nameWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixString(String prefixString) { @@ -387,6 +435,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixArray = prefixArray; } + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList(); + } + + this.prefixArray.add(prefixArrayItem); + return this; + } + + public XmlItem removePrefixArrayItem(Integer prefixArrayItem) { + if (prefixArrayItem != null && this.prefixArray != null) { + this.prefixArray.remove(prefixArrayItem); + } + + return this; + } /** **/ public XmlItem prefixWrappedArray(List prefixWrappedArray) { @@ -408,6 +472,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList(); + } + + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + public XmlItem removePrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArrayItem != null && this.prefixWrappedArray != null) { + this.prefixWrappedArray.remove(prefixWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceString(String namespaceString) { @@ -513,6 +593,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceArray = namespaceArray; } + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList(); + } + + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + public XmlItem removeNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArrayItem != null && this.namespaceArray != null) { + this.namespaceArray.remove(namespaceArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { @@ -534,6 +630,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList(); + } + + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + public XmlItem removeNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArrayItem != null && this.namespaceWrappedArray != null) { + this.namespaceWrappedArray.remove(namespaceWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsString(String prefixNsString) { @@ -639,6 +751,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsArray = prefixNsArray; } + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList(); + } + + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + public XmlItem removePrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArrayItem != null && this.prefixNsArray != null) { + this.prefixNsArray.remove(prefixNsArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { @@ -660,6 +788,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsWrappedArray = prefixNsWrappedArray; } + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList(); + } + + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + public XmlItem removePrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArrayItem != null && this.prefixNsWrappedArray != null) { + this.prefixNsWrappedArray.remove(prefixNsWrappedArrayItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 61bec1b6ff4..4ebb303b837 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -55,6 +55,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapString = mapString; } + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap(); + } + + this.mapString.put(key, mapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { + if (mapStringItem != null && this.mapString != null) { + this.mapString.remove(mapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapNumber(Map mapNumber) { @@ -76,6 +92,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapNumber = mapNumber; } + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap(); + } + + this.mapNumber.put(key, mapNumberItem); + return this; + } + + public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { + if (mapNumberItem != null && this.mapNumber != null) { + this.mapNumber.remove(mapNumberItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapInteger(Map mapInteger) { @@ -97,6 +129,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapInteger = mapInteger; } + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap(); + } + + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { + if (mapIntegerItem != null && this.mapInteger != null) { + this.mapInteger.remove(mapIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { @@ -118,6 +166,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapBoolean = mapBoolean; } + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap(); + } + + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { + if (mapBooleanItem != null && this.mapBoolean != null) { + this.mapBoolean.remove(mapBooleanItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { @@ -139,6 +203,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayInteger = mapArrayInteger; } + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap>(); + } + + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { + if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { + this.mapArrayInteger.remove(mapArrayIntegerItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { @@ -160,6 +240,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapArrayAnytype = mapArrayAnytype; } + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap>(); + } + + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { + if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(mapArrayAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapString(Map> mapMapString) { @@ -181,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapString = mapMapString; } + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap>(); + } + + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { + if (mapMapStringItem != null && this.mapMapString != null) { + this.mapMapString.remove(mapMapStringItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { @@ -202,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.mapMapAnytype = mapMapAnytype; } + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap>(); + } + + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { + if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { + this.mapMapAnytype.remove(mapMapAnytypeItem); + } + + return this; + } /** **/ public AdditionalPropertiesClass anytype1(Object anytype1) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cbca7de2f69..e4dc1fd6837 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayNumber = arrayArrayNumber; } + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) { + if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) { + this.arrayArrayNumber.remove(arrayArrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ad7cc3db32e..19e29e9703b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -44,6 +44,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayNumber = arrayNumber; } + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + + this.arrayNumber.add(arrayNumberItem); + return this; + } + + public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) { + if (arrayNumberItem != null && this.arrayNumber != null) { + this.arrayNumber.remove(arrayNumberItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java index f2b7469f65c..bda8bb29dc8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java @@ -46,6 +46,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayOfString = arrayOfString; } + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) { + if (arrayOfStringItem != null && this.arrayOfString != null) { + this.arrayOfString.remove(arrayOfStringItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { @@ -67,6 +83,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfInteger = arrayArrayOfInteger; } + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) { + this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem); + } + + return this; + } /** **/ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { @@ -88,6 +120,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayArrayOfModel = arrayArrayOfModel; } + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + public ArrayTest removeArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) { + this.arrayArrayOfModel.remove(arrayArrayOfModelItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java index bf05c76fd9e..f9f302e48cc 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java @@ -131,6 +131,22 @@ public enum ArrayEnumEnum { this.arrayEnum = arrayEnum; } + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + + this.arrayEnum.add(arrayEnumItem); + return this; + } + + public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (arrayEnumItem != null && this.arrayEnum != null) { + this.arrayEnum.remove(arrayEnumItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 05ff7b2ea24..6828ddc9bd4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -66,6 +66,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.files = files; } + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + + this.files.add(filesItem); + return this; + } + + public FileSchemaTestClass removeFilesItem(ModelFile filesItem) { + if (filesItem != null && this.files != null) { + this.files.remove(filesItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index f5c57914a90..fe54c2dbaf1 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -80,6 +80,22 @@ public enum InnerEnum { this.mapMapOfString = mapMapOfString; } + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { + if (mapMapOfStringItem != null && this.mapMapOfString != null) { + this.mapMapOfString.remove(mapMapOfStringItem); + } + + return this; + } /** **/ public MapTest mapOfEnumString(Map mapOfEnumString) { @@ -101,6 +117,22 @@ public enum InnerEnum { this.mapOfEnumString = mapOfEnumString; } + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { + if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { + this.mapOfEnumString.remove(mapOfEnumStringItem); + } + + return this; + } /** **/ public MapTest directMap(Map directMap) { @@ -122,6 +154,22 @@ public enum InnerEnum { this.directMap = directMap; } + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + + this.directMap.put(key, directMapItem); + return this; + } + + public MapTest removeDirectMapItem(Boolean directMapItem) { + if (directMapItem != null && this.directMap != null) { + this.directMap.remove(directMapItem); + } + + return this; + } /** **/ public MapTest indirectMap(Map indirectMap) { @@ -143,6 +191,22 @@ public enum InnerEnum { this.indirectMap = indirectMap; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + + this.indirectMap.put(key, indirectMapItem); + return this; + } + + public MapTest removeIndirectMapItem(Boolean indirectMapItem) { + if (indirectMapItem != null && this.indirectMap != null) { + this.indirectMap.remove(indirectMapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 77464620e9c..54bbb7ca2f0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -91,6 +91,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.map = map; } + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + + this.map.put(key, mapItem); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { + if (mapItem != null && this.map != null) { + this.map.remove(mapItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 7162d94b3b8..b35574db4cd 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -152,6 +152,22 @@ public enum StatusEnum { this.photoUrls = photoUrls; } + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet(); + } + + this.photoUrls.add(photoUrlsItem); + return this; + } + + public Pet removePhotoUrlsItem(String photoUrlsItem) { + if (photoUrlsItem != null && this.photoUrls != null) { + this.photoUrls.remove(photoUrlsItem); + } + + return this; + } /** **/ public Pet tags(List tags) { @@ -173,6 +189,22 @@ public enum StatusEnum { this.tags = tags; } + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + + this.tags.add(tagsItem); + return this; + } + + public Pet removeTagsItem(Tag tagsItem) { + if (tagsItem != null && this.tags != null) { + this.tags.remove(tagsItem); + } + + return this; + } /** * pet status in the store **/ diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java index a093d79a6d6..1d7658a94fa 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -137,6 +137,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java index daaffc8af45..cdb7058acec 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -160,6 +160,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.arrayItem = arrayItem; } + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList(); + } + + this.arrayItem.add(arrayItemItem); + return this; + } + + public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) { + if (arrayItemItem != null && this.arrayItem != null) { + this.arrayItem.remove(arrayItemItem); + } + + return this; + } @Override public boolean equals(Object o) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java index 241ebb4e1bc..8e593b39392 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java @@ -156,6 +156,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.wrappedArray = wrappedArray; } + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList(); + } + + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + public XmlItem removeWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArrayItem != null && this.wrappedArray != null) { + this.wrappedArray.remove(wrappedArrayItem); + } + + return this; + } /** **/ public XmlItem nameString(String nameString) { @@ -261,6 +277,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameArray = nameArray; } + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList(); + } + + this.nameArray.add(nameArrayItem); + return this; + } + + public XmlItem removeNameArrayItem(Integer nameArrayItem) { + if (nameArrayItem != null && this.nameArray != null) { + this.nameArray.remove(nameArrayItem); + } + + return this; + } /** **/ public XmlItem nameWrappedArray(List nameWrappedArray) { @@ -282,6 +314,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.nameWrappedArray = nameWrappedArray; } + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList(); + } + + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + public XmlItem removeNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArrayItem != null && this.nameWrappedArray != null) { + this.nameWrappedArray.remove(nameWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixString(String prefixString) { @@ -387,6 +435,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixArray = prefixArray; } + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList(); + } + + this.prefixArray.add(prefixArrayItem); + return this; + } + + public XmlItem removePrefixArrayItem(Integer prefixArrayItem) { + if (prefixArrayItem != null && this.prefixArray != null) { + this.prefixArray.remove(prefixArrayItem); + } + + return this; + } /** **/ public XmlItem prefixWrappedArray(List prefixWrappedArray) { @@ -408,6 +472,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixWrappedArray = prefixWrappedArray; } + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList(); + } + + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + public XmlItem removePrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArrayItem != null && this.prefixWrappedArray != null) { + this.prefixWrappedArray.remove(prefixWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceString(String namespaceString) { @@ -513,6 +593,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceArray = namespaceArray; } + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList(); + } + + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + public XmlItem removeNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArrayItem != null && this.namespaceArray != null) { + this.namespaceArray.remove(namespaceArrayItem); + } + + return this; + } /** **/ public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { @@ -534,6 +630,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.namespaceWrappedArray = namespaceWrappedArray; } + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList(); + } + + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + public XmlItem removeNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArrayItem != null && this.namespaceWrappedArray != null) { + this.namespaceWrappedArray.remove(namespaceWrappedArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsString(String prefixNsString) { @@ -639,6 +751,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsArray = prefixNsArray; } + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList(); + } + + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + public XmlItem removePrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArrayItem != null && this.prefixNsArray != null) { + this.prefixNsArray.remove(prefixNsArrayItem); + } + + return this; + } /** **/ public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { @@ -660,6 +788,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; this.prefixNsWrappedArray = prefixNsWrappedArray; } + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList(); + } + + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + public XmlItem removePrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArrayItem != null && this.prefixNsWrappedArray != null) { + this.prefixNsWrappedArray.remove(prefixNsWrappedArrayItem); + } + + return this; + } @Override public boolean equals(Object o) { From ff7c2bdb591dd8fb6dd1c39dbe88367dbea4042d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 27 Jan 2022 21:17:41 +0800 Subject: [PATCH 100/113] comment out groovy test --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 94336ceb9a2..332c899e1ad 100644 --- a/pom.xml +++ b/pom.xml @@ -1354,7 +1354,8 @@ - samples/client/petstore/groovy + samples/client/petstore/scala-akka samples/client/petstore/scala-sttp samples/client/petstore/scala-httpclient From aed513f65dc086ba7fa2dbc2791acd9fc45cd91e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 28 Jan 2022 10:56:30 +0800 Subject: [PATCH 101/113] [TS][nestjs] fix isListContainer with isArray (#11425) * fix isListContainer with isArray in ts nextjs * update samples --- .../typescript-nestjs/api.service.mustache | 24 +++++++++---------- .../builds/default/api/pet.service.ts | 8 +++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache index b95a4fa6e0e..ddea339cf17 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -72,7 +72,7 @@ export class {{classname}} { {{#hasQueryParams}} let queryParameters = {}; {{#queryParams}} - {{#isListContainer}} + {{#isArray}} if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { @@ -83,8 +83,8 @@ export class {{classname}} { queryParameters['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']); {{/isCollectionFormatMulti}} } - {{/isListContainer}} - {{^isListContainer}} + {{/isArray}} + {{^isArray}} if ({{paramName}} !== undefined && {{paramName}} !== null) { {{#isDateTime}} queryParameters['{{baseName}}'] = {{paramName}}.toISOString(); @@ -93,22 +93,22 @@ export class {{classname}} { queryParameters['{{baseName}}'] = {{paramName}}; {{/isDateTime}} } - {{/isListContainer}} + {{/isArray}} {{/queryParams}} {{/hasQueryParams}} let headers = this.defaultHeaders; {{#headerParams}} - {{#isListContainer}} + {{#isArray}} if ({{paramName}}) { headers['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']); } - {{/isListContainer}} - {{^isListContainer}} + {{/isArray}} + {{^isArray}} if ({{paramName}} !== undefined && {{paramName}} !== null) { headers['{{baseName}}'] = String({{paramName}}); } - {{/isListContainer}} + {{/isArray}} {{/headerParams}} {{#authMethods}} @@ -188,7 +188,7 @@ export class {{classname}} { } {{#formParams}} - {{#isListContainer}} + {{#isArray}} if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { @@ -199,12 +199,12 @@ export class {{classname}} { formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); {{/isCollectionFormatMulti}} } - {{/isListContainer}} - {{^isListContainer}} + {{/isArray}} + {{^isArray}} if ({{paramName}} !== undefined) { formParams.append('{{baseName}}', {{paramName}}); } - {{/isListContainer}} + {{/isArray}} {{/formParams}} {{/hasFormParams}} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts index d3300f3906a..5fa20c944db 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts @@ -153,8 +153,8 @@ export class PetService { } let queryParameters = {}; - if (status !== undefined && status !== null) { - queryParameters['status'] = status; + if (status) { + queryParameters['status'] = status.join(COLLECTION_FORMATS['csv']); } let headers = this.defaultHeaders; @@ -203,8 +203,8 @@ export class PetService { } let queryParameters = {}; - if (tags !== undefined && tags !== null) { - queryParameters['tags'] = tags; + if (tags) { + queryParameters['tags'] = tags.join(COLLECTION_FORMATS['csv']); } let headers = this.defaultHeaders; From 24366be0db4d6baf9da7a426803a645804c79922 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Thu, 27 Jan 2022 23:05:36 -0500 Subject: [PATCH 102/113] [csharp-netcore] Adding generic host library (#10627) * added generichost library * added templates * added an event, improved docs, added logging * adding event args file * fixed hard coded package name * added an AddTokens overload for a single token * changed api clients to singletons to support the event registration * build samples * log exceptions while executing api responded event * nrt bug fixes, dangling comma fix * resolving comments * removed debugging lines * refactored token provider * rate limit provider now default * updated readme, added ConfigureAwait(false) * DI fixes * removed a hard coded project name * fixed nrt bugs * improved NRT and .net 3.1 support * renamed projectName to apiName, added cli option * trying to avoid conflict * set GenerateAssemlbyInfo to true * created docs/scripts folder * moved ApiTestsBase.cs to not get overwritten * test fixes and improvements * fixed licenseId bug, updated readme * build samples * export docs * removed new language features * added support for .net standard 2.0 * added git_push.ps1 * fixed bug in git_push.sh due to the new directory, prompting user for commit message * moved documentation folders * fixed bug when apiKey in query * bug fix --- docs/generators/csharp-netcore.md | 3 +- .../codegen/CodegenConstants.java | 2 + .../languages/CSharpNetCoreClientCodegen.java | 173 ++++- .../resources/csharp-netcore/api_doc.mustache | 2 +- .../generichost/ApiException.mustache | 44 ++ .../generichost/ApiKeyToken.mustache | 59 ++ .../generichost/ApiResponseEventArgs.mustache | 47 ++ .../generichost/ApiResponse`1.mustache | 97 +++ .../generichost/ApiTestsBase.mustache | 47 ++ .../libraries/generichost/BasicToken.mustache | 44 ++ .../generichost/BearerToken.mustache | 39 + .../generichost/ClientUtils.mustache | 360 ++++++++++ .../DependencyInjectionTests.mustache | 158 ++++ .../generichost/HostConfiguration.mustache | 124 ++++ .../HttpSigningConfiguration.mustache | 676 ++++++++++++++++++ .../generichost/HttpSigningToken.mustache | 43 ++ .../libraries/generichost/IApi.mustache | 21 + .../libraries/generichost/OAuthToken.mustache | 39 + .../libraries/generichost/README.mustache | 214 ++++++ .../generichost/RateLimitProvider`1.mustache | 106 +++ .../libraries/generichost/TokenBase.mustache | 71 ++ .../generichost/TokenContainer`1.mustache | 37 + .../generichost/TokenProvider`1.mustache | 36 + .../libraries/generichost/api.mustache | 391 ++++++++++ .../libraries/generichost/api_test.mustache | 46 ++ .../generichost/git_push.ps1.mustache | 75 ++ .../generichost/git_push.sh.mustache | 49 ++ .../csharp-netcore/modelAnyOf.mustache | 2 + .../csharp-netcore/modelOneOf.mustache | 2 + .../csharp-netcore/model_doc.mustache | 2 +- .../csharp-netcore/netcore_project.mustache | 12 +- .../netcore_testproject.mustache | 3 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- 40 files changed, 3011 insertions(+), 29 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponseEventArgs.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiTestsBase.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DependencyInjectionTests.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.ps1.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.sh.mustache diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index d693fdf9e44..17bc2cfa974 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -19,12 +19,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiName|Must be a valid C# class name. Only used in Generic Host library. Default: Api| |Api| |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| |conditionalSerialization|Serialize only those properties which are initialized by user, accepted values are true or false, default value is false.| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| -|library|HTTP library template (sub-template) to use|
**httpclient**
HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. May subject to breaking changes without further notice.)
**restsharp**
RestSharp (https://github.com/restsharp/RestSharp)
|restsharp| +|library|HTTP library template (sub-template) to use|
**generichost**
HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) (Experimental. Subject to breaking changes without notice.)
**httpclient**
HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. Subject to breaking changes without notice.)
**restsharp**
RestSharp (https://github.com/restsharp/RestSharp)
|restsharp| |licenseId|The identifier of the license| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index ffbd0c5e0a4..27c47456bc0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -35,6 +35,8 @@ public class CodegenConstants { public static final String SKIP_FORM_MODEL = "skipFormModel"; /* /end System Properties */ + public static final String API_NAME = "apiName"; + public static final String API_PACKAGE = "apiPackage"; public static final String API_PACKAGE_DESC = "package for generated api classes"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index e211deb48ab..67cfd2f1cfa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -39,7 +39,9 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @SuppressWarnings("Duplicates") -public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { +public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { + protected String apiName = "Api"; + // Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget protected static final String MCS_NET_VERSION_KEY = "x-mcs-sdk"; protected static final String SUPPORTS_UWP = "supportsUWP"; @@ -50,6 +52,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // HTTP libraries protected static final String RESTSHARP = "restsharp"; protected static final String HTTPCLIENT = "httpclient"; + protected static final String GENERICHOST = "generichost"; // Project Variable, determined from target framework. Not intended to be user-settable. protected static final String TARGET_FRAMEWORK_IDENTIFIER = "targetFrameworkIdentifier"; @@ -172,6 +175,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { "C# package name (convention: Title.Case).", this.packageName); + addOption(CodegenConstants.API_NAME, + "Must be a valid C# class name. Only used in Generic Host library. Default: " + this.apiName, + this.apiName); + addOption(CodegenConstants.PACKAGE_VERSION, "C# package version.", this.packageVersion); @@ -269,8 +276,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { this.optionalEmitDefaultValuesFlag); addSwitch(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION, - CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION_DESC, - this.conditionalSerialization); + CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION_DESC, + this.conditionalSerialization); addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, CodegenConstants.OPTIONAL_PROJECT_FILE_DESC, @@ -310,8 +317,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { regexModifiers.put('s', "Singleline"); regexModifiers.put('x', "IgnorePatternWhitespace"); + supportedLibraries.put(GENERICHOST, "HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) " + + "(Experimental. Subject to breaking changes without notice.)"); supportedLibraries.put(HTTPCLIENT, "HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) " - + "(Experimental. May subject to breaking changes without further notice.)"); + + "(Experimental. Subject to breaking changes without notice.)"); supportedLibraries.put(RESTSHARP, "RestSharp (https://github.com/restsharp/RestSharp)"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use"); @@ -324,7 +333,11 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { @Override public String apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); + if (GENERICHOST.equals(getLibrary())){ + return (outputFolder + "/" + apiDocPath + File.separatorChar + "apis").replace('/', File.separatorChar); + }else{ + return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); + } } @Override @@ -454,7 +467,11 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { @Override public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); + if (GENERICHOST.equals(getLibrary())){ + return (outputFolder + "/" + modelDocPath + File.separator + "models").replace('/', File.separatorChar); + }else{ + return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); + } } @Override @@ -559,6 +576,16 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); } + if (additionalProperties.containsKey((CodegenConstants.LICENSE_ID))) { + setLicenseId((String) additionalProperties.get(CodegenConstants.LICENSE_ID)); + } + + if (additionalProperties.containsKey(CodegenConstants.API_NAME)) { + setApiName((String) additionalProperties.get(CodegenConstants.API_NAME)); + } else { + additionalProperties.put(CodegenConstants.API_NAME, apiName); + } + if (isEmpty(apiPackage)) { setApiPackage("Api"); } @@ -568,7 +595,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { clientPackage = "Client"; - if (RESTSHARP.equals(getLibrary())) { + if (GENERICHOST.equals(getLibrary())){ + setLibrary(GENERICHOST); + additionalProperties.put("useGenericHost", true); + } else if (RESTSHARP.equals(getLibrary())) { additionalProperties.put("useRestSharp", true); needsCustomHttpMethod = true; } else if (HTTPCLIENT.equals(getLibrary())) { @@ -670,11 +700,59 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { binRelativePath += "vendor"; additionalProperties.put("binRelativePath", binRelativePath); + // Only write out test related files if excludeTests is unset or explicitly set to false (see start of this method) + if (Boolean.FALSE.equals(excludeTests.get())) { + modelTestTemplateFiles.put("model_test.mustache", ".cs"); + apiTestTemplateFiles.put("api_test.mustache", ".cs"); + } + if(HTTPCLIENT.equals(getLibrary())) { supportingFiles.add(new SupportingFile("FileParameter.mustache", clientPackageDir, "FileParameter.cs")); typeMapping.put("file", "FileParameter"); + addRestSharpSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + } + else if (GENERICHOST.equals(getLibrary())){ + addGenericHostSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); + additionalProperties.put("apiDocPath", apiDocPath + File.separatorChar + "apis"); + additionalProperties.put("modelDocPath", modelDocPath + File.separatorChar + "models"); + } + else{ + addRestSharpSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir); + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); } + addTestInstructions(); + } + + private void addTestInstructions(){ + if (GENERICHOST.equals(getLibrary())){ + additionalProperties.put("testInstructions", + "/* *********************************************************************************" + + "\n* Follow these manual steps to construct tests." + + "\n* This file will not be overwritten." + + "\n* *********************************************************************************" + + "\n* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly." + + "\n* Take care not to commit credentials to any repository." + + "\n*" + + "\n* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients." + + "\n* To mock the client, use the generic AddApiHttpClients." + + "\n* To mock the server, change the client's BaseAddress." + + "\n*" + + "\n* 3. Locate the test you want below" + + "\n* - remove the skip property from the Fact attribute" + + "\n* - set the value of any variables if necessary" + + "\n*" + + "\n* 4. Run the tests and ensure they work." + + "\n*" + + "\n*/"); + } + } + + public void addRestSharpSupportingFiles(final String clientPackageDir, final String packageFolder, + final AtomicReference excludeTests, final String testPackageFolder, final String testPackageName, final String modelPackageDir){ supportingFiles.add(new SupportingFile("IApiAccessor.mustache", clientPackageDir, "IApiAccessor.cs")); supportingFiles.add(new SupportingFile("Configuration.mustache", clientPackageDir, "Configuration.cs")); supportingFiles.add(new SupportingFile("ApiClient.mustache", clientPackageDir, "ApiClient.cs")); @@ -708,12 +786,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("GlobalConfiguration.mustache", clientPackageDir, "GlobalConfiguration.cs")); - // Only write out test related files if excludeTests is unset or explicitly set to false (see start of this method) - if (Boolean.FALSE.equals(excludeTests.get())) { - modelTestTemplateFiles.put("model_test.mustache", ".cs"); - apiTestTemplateFiles.put("api_test.mustache", ".cs"); - } - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); @@ -727,9 +799,64 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); supportingFiles.add(new SupportingFile("AbstractOpenAPISchema.mustache", modelPackageDir, "AbstractOpenAPISchema.cs")); + } - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); + public void addGenericHostSupportingFiles(final String clientPackageDir, final String packageFolder, + final AtomicReference excludeTests, final String testPackageFolder, final String testPackageName, final String modelPackageDir){ + supportingFiles.add(new SupportingFile("TokenProvider`1.mustache", clientPackageDir, "TokenProvider`1.cs")); + supportingFiles.add(new SupportingFile("RateLimitProvider`1.mustache", clientPackageDir, "RateLimitProvider`1.cs")); + supportingFiles.add(new SupportingFile("TokenContainer`1.mustache", clientPackageDir, "TokenContainer`1.cs")); + supportingFiles.add(new SupportingFile("TokenBase.mustache", clientPackageDir, "TokenBase.cs")); + supportingFiles.add(new SupportingFile("ApiException.mustache", clientPackageDir, "ApiException.cs")); + supportingFiles.add(new SupportingFile("ApiResponse`1.mustache", clientPackageDir, "ApiResponse`1.cs")); + supportingFiles.add(new SupportingFile("ClientUtils.mustache", clientPackageDir, "ClientUtils.cs")); + supportingFiles.add(new SupportingFile("HostConfiguration.mustache", clientPackageDir, "HostConfiguration.cs")); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "docs" + File.separator + "scripts", "git_push.sh")); + supportingFiles.add(new SupportingFile("git_push.ps1.mustache", "docs" + File.separator + "scripts", "git_push.ps1")); + // TODO: supportingFiles.add(new SupportingFile("generate.ps1.mustache", "docs" + File.separator + "scripts", "generate.ps1")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("Solution.mustache", "", packageName + ".sln")); + supportingFiles.add(new SupportingFile("netcore_project.mustache", packageFolder, packageName + ".csproj")); + supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); + supportingFiles.add(new SupportingFile("AbstractOpenAPISchema.mustache", modelPackageDir, "AbstractOpenAPISchema.cs")); + supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs")); + supportingFiles.add(new SupportingFile("ApiResponseEventArgs.mustache", clientPackageDir, "ApiResponseEventArgs.cs")); + supportingFiles.add(new SupportingFile("IApi.mustache", clientPackageDir, getInterfacePrefix() + "Api.cs")); + + String apiTestFolder = testFolder + File.separator + testPackageName() + File.separator + apiPackage(); + + if (Boolean.FALSE.equals(excludeTests.get())) { + supportingFiles.add(new SupportingFile("netcore_testproject.mustache", testPackageFolder, testPackageName + ".csproj")); + supportingFiles.add(new SupportingFile("DependencyInjectionTests.mustache", apiTestFolder, "DependencyInjectionTests.cs")); + + // do not overwrite test file that already exists + File apiTestsBaseFile = new File(apiTestFileFolder() + File.separator + "ApiTestsBase.cs"); + if (!apiTestsBaseFile.exists()) { + supportingFiles.add(new SupportingFile("ApiTestsBase.mustache", apiTestFolder, "ApiTestsBase.cs")); + } + } + + if (ProcessUtils.hasHttpSignatureMethods(openAPI)) { + supportingFiles.add(new SupportingFile("HttpSigningConfiguration.mustache", clientPackageDir, "HttpSigningConfiguration.cs")); + supportingFiles.add(new SupportingFile("HttpSigningToken.mustache", clientPackageDir, "HttpSigningToken.cs")); + } + + if (ProcessUtils.hasHttpBasicMethods(openAPI)) { + supportingFiles.add(new SupportingFile("BasicToken.mustache", clientPackageDir, "BasicToken.cs")); + } + + if (ProcessUtils.hasOAuthMethods(openAPI)) { + supportingFiles.add(new SupportingFile("OAuthToken.mustache", clientPackageDir, "OAuthToken.cs")); + } + + if (ProcessUtils.hasHttpBearerMethods(openAPI)) { + supportingFiles.add(new SupportingFile("BearerToken.mustache", clientPackageDir, "BearerToken.cs")); + } + + if (ProcessUtils.hasApiKeyMethods(openAPI)) { + supportingFiles.add(new SupportingFile("ApiKeyToken.mustache", clientPackageDir, "ApiKeyToken.cs")); + } } public void setNetStandard(Boolean netStandard) { @@ -756,11 +883,24 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { this.packageGuid = packageGuid; } + // TODO: this does the same as super @Override public void setPackageName(String packageName) { this.packageName = packageName; } + /** + * Sets the api name. This value must be a valid class name. + * @param apiName The api name + */ + public void setApiName(String apiName) { + if (!"".equals(apiName) && (Boolean.FALSE.equals(apiName.matches("^[a-zA-Z0-9_]*$")) || Boolean.FALSE.equals(apiName.matches("^[a-zA-Z].*")))){ + throw new RuntimeException("Invalid project name " + apiName + ". May only contain alphanumeric characaters or underscore and start with a letter."); + } + this.apiName = apiName; + } + + // TODO: this does the same as super @Override public void setPackageVersion(String packageVersion) { this.packageVersion = packageVersion; @@ -1068,6 +1208,9 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { properties.putIfAbsent(MCS_NET_VERSION_KEY, "4.6-api"); properties.put(NET_STANDARD, strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.isNetStandard))); + for (FrameworkStrategy frameworkStrategy : frameworkStrategies) { + properties.put(frameworkStrategy.name, strategies.stream().anyMatch(s -> s.name.equals(frameworkStrategy.name))); + } } /** diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache index 1286829ad40..3a3870510c9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache @@ -128,7 +128,7 @@ Name | Type | Description | Notes {{/responses}} {{/responses.0}} -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[[Back to top]](#) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache new file mode 100644 index 00000000000..77e95ca3d14 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiException.mustache @@ -0,0 +1,44 @@ +// +{{>partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// API Exception + /// + {{>visibility}} class ApiException : Exception + { + /// + /// The reason the api request failed + /// + public string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ReasonPhrase { get; } + + /// + /// The HttpStatusCode + /// + public System.Net.HttpStatusCode StatusCode { get; } + + /// + /// The raw data returned by the api + /// + public string RawContent { get; } + + /// + /// Construct the ApiException from parts of the reponse + /// + /// + /// + /// + public ApiException(string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} reasonPhrase, System.Net.HttpStatusCode statusCode, string rawContent) : base(reasonPhrase ?? rawContent) + { + ReasonPhrase = reasonPhrase; + + StatusCode = statusCode; + + RawContent = rawContent; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache new file mode 100644 index 00000000000..98434c3b25a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiKeyToken.mustache @@ -0,0 +1,59 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// A token constructed from an apiKey. + /// + public class ApiKeyToken : TokenBase + { + private string _raw; + + /// + /// Constructs an ApiKeyToken object. + /// + /// + /// + /// + public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + { + _raw = $"{ prefix }{ value }"; + } + + /// + /// Places the token in the cookie. + /// + /// + /// + public virtual void UseInCookie(System.Net.Http.HttpRequestMessage request, string cookieName) + { + request.Headers.Add("Cookie", $"{ cookieName }=_raw"); + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Add(headerName, _raw); + } + + /// + /// Places the token in the query. + /// + /// + /// + /// + /// + public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) + { + parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}; + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponseEventArgs.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponseEventArgs.mustache new file mode 100644 index 00000000000..5ff16199326 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponseEventArgs.mustache @@ -0,0 +1,47 @@ +using System; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// Useful for tracking server health. + /// + public class ApiResponseEventArgs : EventArgs + { + /// + /// The time the request was sent. + /// + public DateTime RequestedAt { get; } + /// + /// The time the response was received. + /// + public DateTime ReceivedAt { get; } + /// + /// The HttpStatusCode received. + /// + public HttpStatusCode HttpStatus { get; } + /// + /// The path requested. + /// + public string Path { get; } + /// + /// The elapsed time from request to response. + /// + public TimeSpan ToTimeSpan => this.ReceivedAt - this.RequestedAt; + + /// + /// The event args used to track server health. + /// + /// + /// + /// + /// + public ApiResponseEventArgs(DateTime requestedAt, DateTime receivedAt, HttpStatusCode httpStatus, string path) + { + RequestedAt = requestedAt; + ReceivedAt = receivedAt; + HttpStatus = httpStatus; + Path = path; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache new file mode 100644 index 00000000000..ce8b308e9ca --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiResponse`1.mustache @@ -0,0 +1,97 @@ +// +{{>partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Collections.Generic; +using System.Net; +using Newtonsoft.Json; + +namespace {{packageName}}.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + {{>visibility}} partial class ApiResponse : IApiResponse + { + #region Properties + + /// + /// The deserialized content + /// + {{! .net 3.1 does not support unconstrained nullable T }} + public T{{#nullableReferenceTypes}}{{^netcoreapp3.1}}?{{/netcoreapp3.1}}{{/nullableReferenceTypes}} Content { get; set; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The raw data + /// + public string RawContent { get; } + + /// + /// The IsSuccessStatusCode from the api response + /// + public bool IsSuccessStatusCode { get; } + + /// + /// The reason phrase contained in the api response + /// + public string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ReasonPhrase { get; } + + /// + /// The headers contained in the api response + /// + public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + + #endregion Properties + + /// + /// Construct the reponse using an HttpResponseMessage + /// + /// + /// + public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent) + { + StatusCode = response.StatusCode; + Headers = response.Headers; + IsSuccessStatusCode = response.IsSuccessStatusCode; + ReasonPhrase = response.ReasonPhrase; + RawContent = rawContent; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiTestsBase.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiTestsBase.mustache new file mode 100644 index 00000000000..57dd3c7edee --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ApiTestsBase.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using Microsoft.Extensions.Hosting; +using {{packageName}}.Client;{{#hasImport}} +using {{packageName}}.{{modelPackage}};{{/hasImport}} + + +{{{testInstructions}}} + + +namespace {{packageName}}.Test.Api +{ + /// + /// Base class for API tests + /// + public class ApiTestsBase + { + protected readonly IHost _host; + + public ApiTestsBase(string[] args) + { + _host = CreateHostBuilder(args).Build(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, options) => + { + {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerToken bearerToken = new BearerToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicToken basicToken = new BasicToken(context.Configuration[""], context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OAuthToken oauthToken = new OAuthToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken);{{/hasOAuthMethods}} + }); + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache new file mode 100644 index 00000000000..78fce754c17 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BasicToken.mustache @@ -0,0 +1,44 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.Client +{ + /// + /// A token constructed from a username and password. + /// + public class BasicToken : TokenBase + { + private string _username; + + private string _password; + + /// + /// Constructs a BasicToken object. + /// + /// + /// + /// + public BasicToken(string username, string password, TimeSpan? timeout = null) : base(timeout) + { + _username = username; + + _password = password; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password)); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache new file mode 100644 index 00000000000..0e6a8dbdf23 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/BearerToken.mustache @@ -0,0 +1,39 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.Client +{ + /// + /// A token constructed from a token from a bearer token. + /// + public class BearerToken : TokenBase + { + private string _raw; + + /// + /// Constructs a BearerToken object. + /// + /// + /// + public BearerToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache new file mode 100644 index 00000000000..b3b398425e4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/ClientUtils.mustache @@ -0,0 +1,360 @@ +{{>partial_header}} + +using System; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection;{{#supportsRetry}} +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly;{{/supportsRetry}} +using System.Net.Http; +using {{packageName}}.Api;{{#useCompareNetObjects}} +using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} + +namespace {{packageName}}.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + {{#useCompareNetObjects}} + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static constructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + {{/useCompareNetObjects}} + + /// + /// A delegate for events. + /// + /// + /// + /// + /// + public delegate void EventHandler(object sender, T e) where T : EventArgs; + + /// + /// Custom JSON serializer + /// + public static Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; set; } = new Newtonsoft.Json.JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore, + ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver + { + NamingStrategy = new Newtonsoft.Json.Serialization.CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// The DateTime serialization format. + /// Formatted string. + public static string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ParameterToString(object obj, string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} format = ISO8601_DATETIME_FORMAT) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString(format); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString(format); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is System.Collections.ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// 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) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + + /// + /// The base path of the API + /// + public const string BASE_ADDRESS = "{{{basePath}}}"; + + /// + /// The scheme of the API + /// + public const string SCHEME = "{{{scheme}}}"; + + /// + /// The context path of the API + /// + public const string CONTEXT_PATH = "{{contextPath}}"; + + /// + /// The host of the API + /// + public const string HOST = "{{{host}}}"; + + /// + /// The format to use for DateTime serialization + /// + public const string ISO8601_DATETIME_FORMAT = "o"; + + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, config); + + Add{{apiName}}(services, config); + }); + + return builder; + } + + /// + /// Add the api to your host builder. + /// + /// + /// + public static void Add{{apiName}}(this IServiceCollection services, Action options) + { + HostConfiguration config = new HostConfiguration(services); + options(config); + Add{{apiName}}(services, config); + } + + private static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.Add{{apiName}}HttpClients(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + }{{#supportsRetry}} + + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circiut breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak);{{/supportsRetry}} + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DependencyInjectionTests.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DependencyInjectionTests.mustache new file mode 100644 index 00000000000..ac4a4d8e2d1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/DependencyInjectionTests.mustache @@ -0,0 +1,158 @@ +{{>partial_header}} +using System; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Collections.Generic; +using System.Security.Cryptography; +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +using Xunit; + +namespace {{packageName}}.Test.Api +{ + /// + /// Tests the dependency injection. + /// + public class DependencyInjectionTest + { + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).Configure{{apiName}}((context, options) => + { + {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken);{{/hasOAuthMethods}} + }) + .Build(); + + private readonly IHost _hostUsingConfigureWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).Configure{{apiName}}((context, options) => + { + {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken);{{/hasOAuthMethods}} + options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }) + .Build(); + + private readonly IHost _hostUsingAddWithoutAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.Add{{apiName}}(options => + { + {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken);{{/hasOAuthMethods}} + }); + }) + .Build(); + + private readonly IHost _hostUsingAddWithAClient = + Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + { + services.Add{{apiName}}(options => + { + {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken); + {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken); + {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken); + {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken); + {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken);{{/hasOAuthMethods}} + options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); + }); + }) + .Build(); + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the configure method + /// + [Fact] + public void ConfigureApiWithoutAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + + /// + /// Test dependency injection when using the add method + /// + [Fact] + public void AddApiWithoutAClientTest() + { + {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} + + {{/-last}}{{/apis}}{{/apiInfo}} + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache new file mode 100644 index 00000000000..24530537f96 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HostConfiguration.mustache @@ -0,0 +1,124 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.Api; + +namespace {{packageName}}.Client +{ + /// + /// Provides hosting configuration for {{packageName}} + /// + public class HostConfiguration + { + private readonly IServiceCollection _services; + internal bool HttpClientsAdded { get; private set; } + + /// + /// Instantiates the class + /// + /// + public HostConfiguration(IServiceCollection services) + { + _services = services;{{#apiInfo}}{{#apis}} + services.AddSingleton<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}T{{classname}}{{^-last}}, {{/-last}}{{/apis}}> + ( + Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} client = null, Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} builder = null){{#apis}} + where T{{classname}} : class, {{interfacePrefix}}{{classname}}{{/apis}} + { + if (client == null) + client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + + List builders = new List(); + + {{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, T{{classname}}>(client)); + {{/apis}}{{/apiInfo}} + if (builder != null) + foreach (IHttpClientBuilder instance in builders) + builder(instance); + + HttpClientsAdded = true; + + return this; + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration Add{{apiName}}HttpClients( + Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} client = null, Action{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} builder = null) + { + Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}{{classname}}{{^-last}}, {{/-last}}{{/apis}}{{/apiInfo}}>(client, builder); + + return this; + } + + /// + /// Configures the JsonSerializerSettings + /// + /// + /// + public HostConfiguration ConfigureJsonOptions(Action options) + { + options(Client.ClientUtils.JsonSerializerSettings); + + return this; + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(TTokenBase token) where TTokenBase : TokenBase + { + return AddTokens(new TTokenBase[]{ token }); + } + + /// + /// Adds tokens to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration AddTokens(IEnumerable tokens) where TTokenBase : TokenBase + { + TokenContainer container = new TokenContainer(tokens); + _services.AddSingleton(services => container); + + return this; + } + + /// + /// Adds a token provider to your IServiceCollection + /// + /// + /// + /// + public HostConfiguration UseProvider() + where TTokenProvider : TokenProvider + where TTokenBase : TokenBase + { + _services.AddSingleton(); + _services.AddSingleton>(services => services.GetRequiredService()); + + return this; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache new file mode 100644 index 00000000000..23b2d9149a1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningConfiguration.mustache @@ -0,0 +1,676 @@ +// +{{>partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace {{packageName}}.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + #region + /// + /// Create an instance + /// + public HttpSigningConfiguration(string keyId, string keyFilePath, SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} keyPassPhrase, List httpSigningHeader, HashAlgorithmName hashAlgorithm, string signingAlgorithm, int signatureValidityPeriod) + { + KeyId = keyId; + KeyFilePath = keyFilePath; + KeyPassPhrase = keyPassPhrase; + HttpSigningHeader = httpSigningHeader; + HashAlgorithm = hashAlgorithm; + SigningAlgorithm = signingAlgorithm; + SignatureValidityPeriod = signatureValidityPeriod; + } + #endregion + + #region Properties + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } = HashAlgorithmName.SHA256; + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + #endregion + + #region enum + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + #endregion + + #region Methods + /// + /// Gets the Headers for HttpSigning + /// + /// + /// + /// + internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken? cancellationToken = null) + { + if (request.RequestUri == null) + throw new NullReferenceException("The request URI was null"); + + const string HEADER_REQUEST_TARGET = "(request-target)"; + + // The time when the HTTP signature expires. The API server should reject HTTP requests that have expired. + const string HEADER_EXPIRES = "(expires)"; + + //The 'Date' header. + const string HEADER_DATE = "Date"; + + //The 'Host' header. + const string HEADER_HOST = "Host"; + + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + + var httpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + HttpSigningHeader.Add("(created)"); + + var dateTime = DateTime.Now; + string digest = String.Empty; + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + + foreach (var header in HttpSigningHeader) + if (header.Equals(HEADER_REQUEST_TARGET)) + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + httpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + httpSignatureHeader.Add(header.ToLower(), request.RequestUri.ToString()); + HttpSignedRequestHeader.Add(HEADER_HOST, request.RequestUri.ToString()); + } + else if (header.Equals(HEADER_CREATED)) + httpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, digest); + httpSignatureHeader.Add(header.ToLower(), digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in request.Headers) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + httpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + + if (!isHeaderFound) + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + + var headersKeysString = String.Join(" ", httpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in httpSignatureHeader) + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + //Concatinate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + headerSignatureStr = GetRSASignature(signatureStringHash); + + else if (keyType == PrivateKeyType.ECDSA) + headerSignatureStr = GetECDSASignature(signatureStringHash); + + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (httpSignatureHeader.ContainsKey(HEADER_CREATED)) + authorizationHeaderValue += string.Format(",created={0}", httpSignatureHeader[HEADER_CREATED]); + + if (httpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + authorizationHeaderValue += string.Format(",expires={0}", httpSignatureHeader[HEADER_EXPIRES]); + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(string hashName, string stringToBeHashed) + { + var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + var stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + if (KeyPassPhrase == null) + throw new NullReferenceException($"{ nameof(KeyPassPhrase) } was null."); + + RSA{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + + if (rsa == null) + return string.Empty; + else if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + if (!File.Exists(KeyFilePath)) + { + throw new Exception("key file path does not exist."); + } + + var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var keyStr = File.ReadAllText(KeyFilePath); + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + +#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + + string ptrToStringUni = Marshal.PtrToStringUni(unmanagedString) ?? throw new NullReferenceException(); + + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(ptrToStringUni), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + else + { + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + } + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; +#else + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); +#endif + + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + rBytes.Add(signedBytes[i]); + + for (int i = 32; i < 64; i++) + sBytes.Add(signedBytes[i]); + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r lenth, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} GetRSAProviderFromPemFile(String pemfile, SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} keyPassPharse = null) + { + const String pempubheader = "-----BEGIN PUBLIC KEY-----"; + const String pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} pemkey = null; + + if (!File.Exists(pemfile)) + throw new Exception("private key file does not exist."); + + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + isPrivateKeyFile = false; + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + + if (pemkey == null) + return null; + + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ConvertPrivateKeyToBytes(String instr, SecureString{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} keyPassPharse = null) + { + const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; + String pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + return null; + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + String pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.StartsWith("Proc-Type: 4,ENCRYPTED")) // TODO: what do we do here if ReadLine is null? + return null; + + String saltline = str.ReadLine(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}; // TODO: what do we do here if ReadLine is null? + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + return null; + + String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + + if (!(str.ReadLine() == "")) + return null; + + //------ remaining b64 data is encrypted RSA key ---- + String encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 fromat + return null; + } + + // TODO: what do we do here if keyPassPharse is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + return null; + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + + return rsakey; + } + } + + private RSACryptoServiceProvider{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + binr.ReadByte(); //advance 1 byte + else if (twobytes == 0x8230) + binr.ReadInt16(); //advance 2 bytes + else + return null; + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + return null; + + bt = binr.ReadByte(); + if (bt != 0x00) + return null; + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + return 0; + + bt = binr.ReadByte(); + + if (bt == 0x81) + count = binr.ReadByte(); // data size in next byte + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + count = bt; // we already have the data size + + while (binr.ReadByte() == 0x00) + //remove high order zeros in data + count -= 1; + + binr.BaseStream.Seek(-1, SeekOrigin.Current); + + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- concatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = new MD5CryptoServiceProvider(); + byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + result = data00; //initialize + else + { + Array.Copy(result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}, hashtarget, result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.Length); // TODO: what do we do if result is null here? + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}, 0, result{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.Length); // TODO: what do we do if result is null here? + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[]{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + throw new Exception("Key file path does not exist."); + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + keyType = PrivateKeyType.RSA; + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + keyType = PrivateKeyType.ECDSA; + + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + throw new Exception("Either the key is invalid or key is not supported"); + + return keyType; + } + #endregion + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache new file mode 100644 index 00000000000..ca47cca24da --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/HttpSigningToken.mustache @@ -0,0 +1,43 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.Client +{ + /// + /// A token constructed from an HttpSigningConfiguration + /// + public class HttpSignatureToken : TokenBase + { + private HttpSigningConfiguration _configuration; + + /// + /// Constructs an HttpSignatureToken object. + /// + /// + /// + public HttpSignatureToken(HttpSigningConfiguration configuration, TimeSpan? timeout = null) : base(timeout) + { + _configuration = configuration; + } + + /// + /// Places the token in the header. + /// + /// + /// + /// + public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken? cancellationToken = null) + { + var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); + + foreach (var signedHeader in signedHeaders) + request.Headers.Add(signedHeader.Key, signedHeader.Value); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache new file mode 100644 index 00000000000..78856d47816 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/IApi.mustache @@ -0,0 +1,21 @@ +using System.Net.Http; + +namespace {{packageName}}.Client +{ + /// + /// Any Api client + /// + public interface {{interfacePrefix}}Api + { + /// + /// The HttpClient + /// + HttpClient HttpClient { get; } + + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + event ClientUtils.EventHandler{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ApiResponded; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache new file mode 100644 index 00000000000..d15a01cf9d3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/OAuthToken.mustache @@ -0,0 +1,39 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace {{packageName}}.Client +{ + /// + /// A token constructed with OAuth. + /// + public class OAuthToken : TokenBase + { + private string _raw; + + /// + /// Consturcts an OAuthToken object. + /// + /// + /// + public OAuthToken(string value, TimeSpan? timeout = null) : base(timeout) + { + _raw = value; + } + + /// + /// Places the token in the header. + /// + /// + /// + public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + { + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache new file mode 100644 index 00000000000..608e3fa8654 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/README.mustache @@ -0,0 +1,214 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName={{apiName}}', + 'targetFramework={{targetFramework}}', + 'validatable={{validatable}}', + 'nullableReferenceTypes={{nullableReferenceTypes}}', + 'hideGenerationTimestamp={{hideGenerationTimestamp}}', + 'packageVersion={{packageVersion}}', + 'packageAuthors={{packageAuthors}}', + 'packageCompany={{packageCompany}}', + 'packageCopyright={{packageCopyright}}', + 'packageDescription={{packageDescription}}',{{#licenseId}} + 'licenseId={{.}}',{{/licenseId}} + 'packageName={{packageName}}', + 'packageTags={{packageTags}}', + 'packageTitle={{packageTitle}}' +) -join "," + +$global = @( + 'apiDocs={{generateApiDocs}}', + 'modelDocs={{generateModelDocs}}', + 'apiTests={{generateApiTests}}', + 'modelTests={{generateModelTests}}' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "{{gitHost}}" ` + --git-repo-id "{{gitRepoId}}" ` + --git-user-id "{{gitUserId}}" ` + --release-note "{{releaseNote}}" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.Api; +using {{packageName}}.Client; +using {{packageName}}.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} + var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();{{#operations}}{{#-first}}{{#operation}}{{#-first}} + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> foo = await api.{{operationId}}WithHttpInfoAsync("todo");{{/-first}}{{/operation}}{{/-first}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, options) => + { + {{#authMethods}}// the type of token here depends on the api security specifications + ApiKeyToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + {{/authMethods}}options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.Add{{apiName}}HttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later +- [Polly](https://www.nuget.org/packages/Polly/) - 7.2.2 or later{{/supportsRetry}} +- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later{{#useCompareNetObjects}} +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} + + +## Documentation for Models + +{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} +{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} + + +## Documentation for Authorization + +{{^authMethods}}All endpoints do not require authorization.{{/authMethods}}{{#authMethods}}{{#-last}}Authentication schemes defined for the API:{{/-last}}{{/authMethods}}{{#authMethods}} + + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}{{/isApiKey}}{{#isBasicBasic}} +- **Type**: HTTP basic authentication{{/isBasicBasic}}{{#isBasicBearer}} +- **Type**: Bearer Authentication{{/isBasicBearer}}{{#isOAuth}} +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} +- {{scope}}: {{description}}{{/scopes}}{{/isOAuth}}{{/authMethods}} + +## Build +- SDK version: {{packageVersion}}{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}}{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} + +## Api Information +- appName: {{appName}} +- appVersion: {{appVersion}} +- appDescription: {{appDescription}} + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: {{generateAliasAsModel}} +- supportingFiles: {{supportingFiles}} +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: {{generateApiDocs}} +- modelDocs: {{generateModelDocs}} +- apiTests: {{generateApiTests}} +- modelTests: {{generateModelTests}} +- withXml: {{withXml}} + +## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} +- apiName: {{apiName}} +- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} +- conditionalSerialization: {{conditionalSerialization}} +- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} +- gitHost: {{gitHost}} +- gitRepoId: {{gitRepoId}} +- gitUserId: {{gitUserId}} +- hideGenerationTimestamp: {{hideGenerationTimestamp}} +- interfacePrefix: {{interfacePrefix}} +- library: {{library}} +- licenseId: {{licenseId}} +- modelPropertyNaming: {{modelPropertyNaming}} +- netCoreProjectFile: {{netCoreProjectFile}} +- nonPublicApi: {{nonPublicApi}} +- nullableReferenceTypes: {{nullableReferenceTypes}} +- optionalAssemblyInfo: {{optionalAssemblyInfo}} +- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} +- optionalMethodArgument: {{optionalMethodArgument}} +- optionalProjectFile: {{optionalProjectFile}} +- packageAuthors: {{packageAuthors}} +- packageCompany: {{packageCompany}} +- packageCopyright: {{packageCopyright}} +- packageDescription: {{packageDescription}} +- packageGuid: {{packageGuid}} +- packageName: {{packageName}} +- packageTags: {{packageTags}} +- packageTitle: {{packageTitle}} +- packageVersion: {{packageVersion}} +- releaseNote: {{releaseNote}} +- returnICollection: {{returnICollection}} +- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} +- sourceFolder: {{sourceFolder}} +- targetFramework: {{targetFramework}} +- useCollection: {{useCollection}} +- useDateTimeOffset: {{useDateTimeOffset}} +- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} +- validatable: {{validatable}}{{#infoUrl}} +For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache new file mode 100644 index 00000000000..3a778c0aeec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/RateLimitProvider`1.mustache @@ -0,0 +1,106 @@ +// +{{>partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System;{{^netStandard}} +using System.Threading.Channels;{{/netStandard}}{{#netStandard}} +using System.Collections.Concurrent; +using System.Linq; +using System.Threading; +using System.Threading.Tasks;{{/netStandard}} + +namespace {{packageName}}.Client {{^netStandard}} +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal Channel AvailableTokens { get; } + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite + }; + + AvailableTokens = Channel.CreateBounded(options); + + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => AvailableTokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) + => await AvailableTokens.Reader.ReadAsync(cancellation.GetValueOrDefault()).ConfigureAwait(false); + } +} {{/netStandard}}{{#netStandard}} +{ + /// + /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. + /// + /// + public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + { + internal ConcurrentDictionary AvailableTokens = new ConcurrentDictionary(); + private SemaphoreSlim _semaphore; + + /// + /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. + /// + /// + public RateLimitProvider(TokenContainer container) : base(container.Tokens) + { + _semaphore = new SemaphoreSlim(1, 1); + + foreach(TTokenBase token in _tokens) + token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); + + for (int i = 0; i < _tokens.Length; i++) + { + _tokens[i].TokenBecameAvailable += ((sender) => + { + TTokenBase token = (TTokenBase)sender; + + AvailableTokens.TryAdd(token, token); + }); + } + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) + { + await _semaphore.WaitAsync().ConfigureAwait(false); + + try + { + TTokenBase result = null; + + while (result == null) + { + TTokenBase tokenToRemove = AvailableTokens.FirstOrDefault().Value; + + if (tokenToRemove != null && AvailableTokens.TryRemove(tokenToRemove, out result)) + return result; + + await Task.Delay(40).ConfigureAwait(false); + + tokenToRemove = AvailableTokens.FirstOrDefault().Value; + } + + return result; + } + finally + { + _semaphore.Release(); + } + } + } +} {{/netStandard}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache new file mode 100644 index 00000000000..0b8db5d10ae --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenBase.mustache @@ -0,0 +1,71 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// The base for all tokens. + /// + public abstract class TokenBase + { + private DateTime _nextAvailable = DateTime.UtcNow; + private object _nextAvailableLock = new object(); + private readonly System.Timers.Timer _timer = new System.Timers.Timer(); + + + internal TimeSpan? Timeout { get; set; } + internal delegate void TokenBecameAvailableEventHandler(object sender); + internal event TokenBecameAvailableEventHandler{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} TokenBecameAvailable; + + + /// + /// Initialize a TokenBase object. + /// + /// + internal TokenBase(TimeSpan? timeout = null) + { + Timeout = timeout; + + if (Timeout != null) + StartTimer(Timeout.Value); + } + + + /// + /// Starts the token's timer + /// + /// + internal void StartTimer(TimeSpan timeout) + { + Timeout = timeout; + _timer.Interval = Timeout.Value.TotalMilliseconds; + _timer.Elapsed += OnTimer; + _timer.AutoReset = true; + _timer.Start(); + } + + /// + /// Returns true while the token is rate limited. + /// + public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + + /// + /// Triggered when the server returns status code TooManyRequests + /// Once triggered the local timeout will be extended an arbitrary length of time. + /// + public void BeginRateLimit() + { + lock(_nextAvailableLock) + _nextAvailable = DateTime.UtcNow.AddSeconds(5); + } + + private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + { + if (TokenBecameAvailable != null && !IsRateLimited) + TokenBecameAvailable.Invoke(this); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache new file mode 100644 index 00000000000..113f9206fd1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenContainer`1.mustache @@ -0,0 +1,37 @@ +// +{{partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System.Linq; +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// A container for a collection of tokens. + /// + /// + public sealed class TokenContainer where TTokenBase : TokenBase + { + /// + /// The collection of tokens + /// + public List Tokens { get; } = new List(); + + /// + /// Instantiates a TokenContainer + /// + public TokenContainer() + { + } + + /// + /// Instantiates a TokenContainer + /// + /// + public TokenContainer(System.Collections.Generic.IEnumerable tokens) + { + Tokens = tokens.ToList(); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache new file mode 100644 index 00000000000..d8b467a30bf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/TokenProvider`1.mustache @@ -0,0 +1,36 @@ +// +{{>partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Linq; +using System.Collections.Generic; +using {{packageName}}.Client; + +namespace {{packageName}} +{ + /// + /// A class which will provide tokens. + /// + public abstract class TokenProvider where TTokenBase : TokenBase + { + /// + /// The array of tokens. + /// + protected TTokenBase[] _tokens; + + internal abstract System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null); + + /// + /// Instantiates a TokenProvider. + /// + /// + public TokenProvider(IEnumerable tokens) + { + _tokens = tokens.ToArray(); + + if (_tokens.Length == 0) + throw new ArgumentException("You did not provide any tokens."); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache new file mode 100644 index 00000000000..880952325e6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api.mustache @@ -0,0 +1,391 @@ +// +{{>partial_header}} +{{#nullableReferenceTypes}}#nullable enable{{/nullableReferenceTypes}} + +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using System.Net.Http; +using System.Net.Http.Headers; +using {{packageName}}.Client; +{{#hasImport}} +using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApi + { + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>> + Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}> + Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{#nullableReferenceTypes}} + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}?> + Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{/nullableReferenceTypes}}{{^-last}} + + {{/-last}}{{/operation}} + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + /// + /// An event to track the health of the server. + /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// + public event ClientUtils.EventHandler{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} ApiResponded; + + /// + /// The logger + /// + public ILogger<{{classname}}> Logger { get; } + + /// + /// The HttpClient + /// + public HttpClient HttpClient { get; }{{#hasApiKeyMethods}} + + /// + /// A token provider of type + /// + public TokenProvider ApiKeyProvider { get; }{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + + /// + /// A token provider of type + /// + public TokenProvider BearerTokenProvider { get; }{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + + /// + /// A token provider of type + /// + public TokenProvider BasicTokenProvider { get; }{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + + /// + /// A token provider of type + /// + public TokenProvider HttpSignatureTokenProvider { get; }{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + + /// + /// A token provider of type + /// + public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(ILogger<{{classname}}> logger, HttpClient httpClient{{#hasApiKeyMethods}}, + TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, + TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + TokenProvider oauthTokenProvider{{/hasOAuthMethods}}) + { + Logger = logger; + HttpClient = httpClient;{{#hasApiKeyMethods}} + ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} + BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} + BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} + HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} + OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}} + } + {{#operation}} + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + + {{^nullableReferenceTypes}}{{#returnTypeIsPrimitive}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + {{/returnTypeIsPrimitive}}{{/nullableReferenceTypes}}if (result.Content == null){{^nullableReferenceTypes}}{{#returnTypeIsPrimitive}} + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/returnTypeIsPrimitive}}{{/nullableReferenceTypes}} + throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); + + return result.Content; + }{{#nullableReferenceTypes}} + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} result = null; + try + { + result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + }{{/nullableReferenceTypes}}{{^nullableReferenceTypes}}{{^returnTypeIsPrimitive}} +{{! Note that this method is a copy paste of above due to NRT complexities }} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> + public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + { + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} result = null; + try + { + result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + } + + return result != null && result.IsSuccessStatusCode + ? result.Content + : null; + } + {{/returnTypeIsPrimitive}}{{/nullableReferenceTypes}} + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + { + try + { + {{#hasRequiredParams}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/hasRequiredParams}}{{#allParams}}{{#required}}{{#nullableReferenceTypes}} + + if ({{paramName}} == null) + throw new ArgumentNullException(nameof({{paramName}}));{{/nullableReferenceTypes}}{{^nullableReferenceTypes}}{{^vendorExtensions.x-csharp-value-type}} + + if ({{paramName}} == null) + throw new ArgumentNullException(nameof({{paramName}}));{{/vendorExtensions.x-csharp-value-type}}{{/nullableReferenceTypes}}{{/required}}{{/allParams}}{{#hasRequiredParams}} + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + + {{/hasRequiredParams}}using (HttpRequestMessage request = new HttpRequestMessage()) + { + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Host = HttpClient.BaseAddress{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.Host; + uriBuilder.Scheme = ClientUtils.SCHEME; + uriBuilder.Path = ClientUtils.CONTEXT_PATH + "{{path}}";{{#pathParams}}{{#required}} + uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString()));{{/required}}{{^required}} + + if ({{paramName}} != null) + uriBuilder.Path = uriBuilder.Path + $"/{ Uri.EscapeDataString({{paramName}}).ToString()) }"; + {{/required}}{{/pathParams}}{{#queryParams}}{{#-first}} + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/-first}}{{/queryParams}}{{^queryParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} + + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{#required}}{{#-first}} + + {{! all the redundant tags here are to get the spacing just right }} + {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}); + {{/required}}{{/queryParams}}{{#queryParams}}{{#-first}} + {{/-first}}{{/queryParams}}{{#queryParams}}{{^required}}if ({{paramName}} != null) + parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}); + + {{/required}}{{#-last}}uriBuilder.Query = parseQueryString.ToString();{{/-last}}{{/queryParams}}{{#headerParams}}{{#required}} + + request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}));{{/required}}{{^required}} + + if ({{paramName}} != null) + request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}));{{/required}}{{/headerParams}}{{#formParams}}{{#-first}} + + MultipartContent multipartContent = new MultipartContent(); + + request.Content = multipartContent; + + List> formParams = new List>(); + + multipartContent.Add(new FormUrlEncodedContent(formParams));{{/-first}}{{^isFile}}{{#required}} + + formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{^required}} + + if ({{paramName}} != null) + formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{/isFile}}{{#isFile}}{{#required}} + + multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{^required}} + + if ({{paramName}} != null) + multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{/isFile}}{{/formParams}}{{#bodyParam}} + + if (({{paramName}} as object) is System.IO.Stream stream) + request.Content = new StreamContent(stream); + else + request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject({{paramName}}, ClientUtils.JsonSerializerSettings));{{/bodyParam}}{{#authMethods}}{{#-first}} + + List tokens = new List();{{/-first}}{{#isApiKey}} + + ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(apiKey);{{#isKeyInHeader}} + + apiKey.UseInHeader(request, "{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}} + + apiKey.UseInQuery(request, uriBuilder, parseQueryString, "{{keyParamName}}"); + + uriBuilder.Query = parseQueryString.ToString();{{/isKeyInQuery}}{{#isKeyInCookie}} + + apiKey.UseInCookie(request, parseQueryString, "{{keyParamName}}"); + + uriBuilder.Query = parseQueryString.ToString();{{/isKeyInCookie}}{{/isApiKey}}{{/authMethods}} + + {{! below line must be after any UseInQuery calls, but before using the HttpSignatureToken}} + request.RequestUri = uriBuilder.Uri;{{#authMethods}}{{#isBasicBasic}} + + BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(basicToken); + + basicToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBasic}}{{#isBasicBearer}} + + BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(bearerToken); + + bearerToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBearer}}{{#isOAuth}} + + OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(oauthToken); + + oauthToken.UseInHeader(request, "{{keyParamName}}");{{/isOAuth}}{{#isHttpSignature}} + + HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + + tokens.Add(signatureToken); + + string requestBody = await request.Content{{#nullableReferenceTypes}}!{{/nullableReferenceTypes}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + + signatureToken.UseInHeader(request, requestBody, cancellationToken);{{/isHttpSignature}}{{/authMethods}}{{#consumes}}{{#-first}} + + string[] contentTypes = new string[] { + {{/-first}}"{{{mediaType}}}"{{^-last}}, + {{/-last}}{{#-last}} + };{{/-last}}{{/consumes}}{{#consumes}}{{#-first}} + + string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentType != null) + request.Content.Headers.Add("ContentType", contentType);{{/-first}}{{/consumes}}{{#produces}}{{#-first}} + + string[] accepts = new string[] { {{/-first}}{{/produces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, + {{/-last}}{{/produces}}{{#produces}}{{#-last}} + };{{/-last}}{{/produces}}{{#produces}}{{#-first}} + + string{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}} accept = ClientUtils.SelectHeaderAccept(accepts); + + if (accept != null) + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); + {{/-first}}{{/produces}}{{^netStandard}} + request.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}};{{/netStandard}}{{#netStandard}} + request.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}");{{/netStandard}} {{! early standard versions do not have HttpMethod.Patch }} + + using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) + { + DateTime requestedAt = DateTime.UtcNow; + + string responseContent = await responseMessage.Content.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + + if (ApiResponded != null) + { + try + { + ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "{{path}}")); + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while invoking ApiResponded."); + } + } + + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}> apiResponse = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{#nullableReferenceTypes}}?{{/nullableReferenceTypes}}>(responseMessage, responseContent); + + if (apiResponse.IsSuccessStatusCode) + apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);{{#authMethods}} + else if (apiResponse.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase token in tokens) + token.BeginRateLimit();{{/authMethods}} + + return apiResponse; + } + } + } + catch(Exception e) + { + Logger.LogError(e, "An error occured while sending the request to the server."); + throw; + } + } + {{/operation}} + } + {{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api_test.mustache new file mode 100644 index 00000000000..b64731f81dd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/api_test.mustache @@ -0,0 +1,46 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}};{{#hasImport}} +using {{packageName}}.{{modelPackage}};{{/hasImport}} + + +{{{testInstructions}}} + + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + public sealed class {{classname}}Tests : ApiTestsBase + { + private readonly {{interfacePrefix}}{{classname}} _instance; + + public {{classname}}Tests(): base(Array.Empty()) + { + _instance = _host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + } + + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Fact (Skip = "not implemented")] + public async Task {{operationId}}AsyncTest() + { + {{#allParams}} + {{{dataType}}} {{paramName}} = default; + {{/allParams}} + {{#returnType}}var response = {{/returnType}}await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Assert.IsType<{{{.}}}>(response);{{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.ps1.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.ps1.mustache new file mode 100644 index 00000000000..0f4084ef817 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.ps1.mustache @@ -0,0 +1,75 @@ +param( + [Parameter()][Alias("g")][String]$GitHost = "{{{gitHost}}}", + [Parameter()][Alias("u")][String]$GitUserId = "{{{gitUserId}}}", + [Parameter()][Alias("r")][String]$GitRepoId = "{{{gitRepoId}}}", + [Parameter()][Alias("m")][string]$Message = "{{{releaseNote}}}", + [Parameter()][Alias("h")][switch]$Help +) + +function Publish-ToGitHost{ + if ([string]::IsNullOrWhiteSpace($Message) -or $Message -eq "Minor update"){ + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + $Message = Read-Host -Prompt "Please provide a commit message or press enter" + $Message = if([string]::IsNullOrWhiteSpace($Message)) { "no message provided" } else { $Message } + } + + git init + git add . + git commit -am "${Message}" + $branchName=$(git rev-parse --abbrev-ref HEAD) + $gitRemote=$(git remote) + + if([string]::IsNullOrWhiteSpace($gitRemote)){ + git remote add origin https://${GitHost}/${GitUserId}/${GitRepoId}.git + } + + Write-Output "Pulling from https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git pull origin $branchName --ff-only + + if ($LastExitCode -ne 0){ + if (${GitHost} -eq "github.com"){ + Write-Output "The ${GitRepoId} repository may not exist yet. Creating it now with the GitHub CLI." + gh auth login --hostname github.com --web + gh repo create $GitRepoId --private + # sleep 2 seconds to ensure git finishes creation of the repo + Start-Sleep -Seconds 2 + } + else{ + throw "There was an issue pulling the origin branch. The remote repository may not exist yet." + } + } + + Write-Output "Pushing to https://${GitHost}/${GitUserId}/${GitRepoId}.git" + git push origin $branchName +} + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 3.0 + +if ($Help){ + Write-Output " + This script will initialize a git repository, then add and commit all files. + The local repository will then be pushed to your prefered git provider. + If the remote repository does not exist yet and you are using GitHub, + the repository will be created for you provided you have the GitHub CLI installed. + + Parameters: + -g | -GitHost -> ex: github.com + -m | -Message -> the git commit message + -r | -GitRepoId -> the name of the repository + -u | -GitUserId -> your user id + " + + return +} + +$rootPath=Resolve-Path -Path $PSScriptRoot/../.. + +Push-Location $rootPath + +try { + Publish-ToGitHost $GitHost $GitUserId $GitRepoId $Message +} +finally{ + Pop-Location +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.sh.mustache new file mode 100644 index 00000000000..3d4b710dc03 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/git_push.sh.mustache @@ -0,0 +1,49 @@ +#!/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-petstore-perl "minor update" "gitlab.com" + +git_user_id=${1:-{{{gitUserId}}}} +git_repo_id=${2:-{{{gitRepoId}}}} +release_note=${3:-{{{releaseNote}}}} +git_host=${4:-{{{gitHost}}}} + +starting_directory=$(pwd) +script_root="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $script_root +cd ../.. + +if [ "$release_note" = "" ] || [ "$release_note" = "Minor update" ]; then + # it seems unlikely that we would want our git commit message to be the default, so lets prompt the user + echo "Please provide a commit message or press enter" + read user_input + release_note=$user_input + if [ "$release_note" = "" ]; then + release_note="no message provided" + fi +fi + +git init +git add . +git commit -am "$release_note" +branch_name=$(git rev-parse --abbrev-ref HEAD) +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 + +echo "[INFO] Pulling from https://${git_host}/${git_user_id}/${git_repo_id}.git" +git pull origin $branch_name --ff-only + +echo "[INFO] Pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin $branch_name + +cd $starting_directory diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache index 7c3b0cc2d94..f216a991130 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache @@ -171,6 +171,7 @@ } } + {{#validatable}} /// /// To validate all properties of the instance /// @@ -180,6 +181,7 @@ { yield break; } + {{/validatable}} } /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache index d99b82a1e9e..f60d3cf10f3 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache @@ -216,6 +216,7 @@ } } + {{#validatable}} /// /// To validate all properties of the instance /// @@ -225,6 +226,7 @@ { yield break; } + {{/validatable}} } /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/model_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/model_doc.mustache index babf25481c4..3c7f8b2db81 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/model_doc.mustache @@ -16,7 +16,7 @@ Name | Type | Description | Notes {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index cdb95110a9e..1a544ad8bb1 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -1,7 +1,8 @@ - - false + {{#useGenericHost}} + true {{/useGenericHost}}{{^useGenericHost}} + false{{/useGenericHost}} {{targetFramework}} {{packageName}} {{packageName}} @@ -33,6 +34,13 @@ {{#useRestSharp}} {{/useRestSharp}} + {{#useGenericHost}} + + + {{#supportsRetry}} + + {{/supportsRetry}} + {{/useGenericHost}} {{#supportsRetry}} {{/supportsRetry}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index b20a94c76c1..d0162788433 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -4,7 +4,8 @@ {{testPackageName}} {{testPackageName}} {{testTargetFramework}} - false + false{{#nullableReferenceTypes}} + annotations{{/nullableReferenceTypes}} diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj index c445b1abb7c..ea3a254a4d2 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false netstandard2.0 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj index c445b1abb7c..ea3a254a4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false netstandard2.0 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 0b425a6b53a..2d4de6e7ccc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false netstandard2.0 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 74dc32216c8..5e0f256b4cc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false net47 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj index d2fb8de6981..40cff9b3c47 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false net5.0 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index c445b1abb7c..ea3a254a4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false netstandard2.0 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 19789c35952..97a88c1cbe3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false netcoreapp2.0 Org.OpenAPITools Org.OpenAPITools diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index eaf3365f5f6..6310b388e6e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -1,7 +1,7 @@ - false + false netstandard2.1;netcoreapp3.0 Org.OpenAPITools Org.OpenAPITools From b2bb5d071e296adff31dca8a72fd2f558538b502 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 28 Jan 2022 06:01:32 -0500 Subject: [PATCH 103/113] [typescript] Adding Custom Agent Support for fetch call (#11400) * add custom agent support * samples * more samples * merge master files * only enable custom agent on nodejs not browser * samples again * samples * samples once more --- .../resources/typescript/http/http.mustache | 19 +++++++++++++++++++ .../typescript/http/isomorphic-fetch.mustache | 3 +++ .../typescript/builds/default/http/http.ts | 11 +++++++++++ .../builds/default/http/isomorphic-fetch.ts | 1 + .../typescript/builds/inversify/http/http.ts | 11 +++++++++++ .../builds/inversify/http/isomorphic-fetch.ts | 1 + .../builds/object_params/http/http.ts | 11 +++++++++++ .../object_params/http/isomorphic-fetch.ts | 1 + 8 files changed, 58 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache index 2f71d86109f..2f66d4b8996 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache @@ -3,6 +3,8 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; +import * as http from 'http'; +import * as https from 'https'; {{/node}} {{/platforms}} {{#platforms}} @@ -113,6 +115,11 @@ export class RequestContext { private headers: { [key: string]: string } = {}; private body: RequestBody = undefined; private url: URLParse; + {{#platforms}} + {{#node}} + private agent: http.Agent | https.Agent | undefined = undefined; + {{/node}} + {{/platforms}} /** * Creates the request context using a http method and request resource url @@ -185,6 +192,18 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } + {{#platforms}} + {{#node}} + + public setAgent(agent: http.Agent | https.Agent) { + this.agent = agent; + } + + public getAgent(): http.Agent | https.Agent | undefined { + return this.agent; + } + {{/node}} + {{/platforms}} } export interface ResponseBody { diff --git a/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache b/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache index 7646836694b..57b1ae594f6 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache @@ -20,6 +20,9 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { body: body as any, headers: request.getHeaders(), {{#platforms}} + {{#node}} + agent: request.getAgent(), + {{/node}} {{#browser}} credentials: "same-origin" {{/browser}} diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts index a623aef1278..3b6e1461d92 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts @@ -1,6 +1,8 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; +import * as http from 'http'; +import * as https from 'https'; // typings of url-parse are incorrect... // @ts-ignore import * as URLParse from "url-parse"; @@ -50,6 +52,7 @@ export class RequestContext { private headers: { [key: string]: string } = {}; private body: RequestBody = undefined; private url: URLParse; + private agent: http.Agent | https.Agent | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -122,6 +125,14 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } + + public setAgent(agent: http.Agent | https.Agent) { + this.agent = agent; + } + + public getAgent(): http.Agent | https.Agent | undefined { + return this.agent; + } } export interface ResponseBody { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts index ed390df7ce1..26d267cfc06 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts @@ -12,6 +12,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { method: method, body: body as any, headers: request.getHeaders(), + agent: request.getAgent(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index a623aef1278..3b6e1461d92 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -1,6 +1,8 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; +import * as http from 'http'; +import * as https from 'https'; // typings of url-parse are incorrect... // @ts-ignore import * as URLParse from "url-parse"; @@ -50,6 +52,7 @@ export class RequestContext { private headers: { [key: string]: string } = {}; private body: RequestBody = undefined; private url: URLParse; + private agent: http.Agent | https.Agent | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -122,6 +125,14 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } + + public setAgent(agent: http.Agent | https.Agent) { + this.agent = agent; + } + + public getAgent(): http.Agent | https.Agent | undefined { + return this.agent; + } } export interface ResponseBody { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts index ed390df7ce1..26d267cfc06 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts @@ -12,6 +12,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { method: method, body: body as any, headers: request.getHeaders(), + agent: request.getAgent(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index a623aef1278..3b6e1461d92 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -1,6 +1,8 @@ // TODO: evaluate if we can easily get rid of this library import * as FormData from "form-data"; import { URLSearchParams } from 'url'; +import * as http from 'http'; +import * as https from 'https'; // typings of url-parse are incorrect... // @ts-ignore import * as URLParse from "url-parse"; @@ -50,6 +52,7 @@ export class RequestContext { private headers: { [key: string]: string } = {}; private body: RequestBody = undefined; private url: URLParse; + private agent: http.Agent | https.Agent | undefined = undefined; /** * Creates the request context using a http method and request resource url @@ -122,6 +125,14 @@ export class RequestContext { public setHeaderParam(key: string, value: string): void { this.headers[key] = value; } + + public setAgent(agent: http.Agent | https.Agent) { + this.agent = agent; + } + + public getAgent(): http.Agent | https.Agent | undefined { + return this.agent; + } } export interface ResponseBody { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts index ed390df7ce1..26d267cfc06 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts @@ -12,6 +12,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { method: method, body: body as any, headers: request.getHeaders(), + agent: request.getAgent(), }).then((resp: any) => { const headers: { [name: string]: string } = {}; resp.headers.forEach((value: string, name: string) => { From 7dad57c8b62818a7f3fb9f53718b7e92c1d339c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Lepp=C3=A4?= Date: Sat, 29 Jan 2022 04:37:51 +0200 Subject: [PATCH 104/113] [kotlin-server][jax-rs] Added support for JAX-RS library into Kotlin Server generator (#10830) * Added templates for Kotlin JAX-RS server * Fixed Kotlin Server JAX-RS template directory * Added support for Kotlin Server JAX-RS library * Added support using coroutines with Kotlin server JAX-RS library * Added sample for Kotlin server JAX-RS library * Added support for returnResponse option into Kotlin server JAX-RS library * Fixed issue with optional parameters in Kotlin JAX-RS spec * Fixed oneOf issue in Kotlin jaxrs-spec generator * Added better documentation to Kotlin Server JAX-RS options * Updated kotlin-server.md * Updated kotlin-server jaxrs-spec samples * Fixed issue with Kotlin JAX-RS spec and reserved names * Regenerated samples --- bin/configs/kotlin-server-jaxrs-spec.yaml | 7 ++ docs/generators/kotlin-server.md | 6 +- .../languages/KotlinServerCodegen.java | 82 ++++++++++++++--- .../additionalModelTypeAnnotations.mustache | 2 + .../libraries/jaxrs-spec/api.mustache | 31 +++++++ .../jaxrs-spec/apiInterface.mustache | 13 +++ .../libraries/jaxrs-spec/apiMethod.mustache | 16 ++++ .../jaxrs-spec/beanValidation.mustache | 5 ++ .../jaxrs-spec/beanValidationCore.mustache | 20 +++++ .../beanValidationHeaderParams.mustache | 1 + .../beanValidationPathParams.mustache | 1 + .../beanValidationQueryParams.mustache | 1 + .../libraries/jaxrs-spec/bodyParams.mustache | 1 + .../jaxrs-spec/build.gradle.mustache | 57 ++++++++++++ .../jaxrs-spec/cookieParams.mustache | 1 + .../libraries/jaxrs-spec/data_class.mustache | 73 +++++++++++++++ .../jaxrs-spec/data_class_opt_var.mustache | 6 ++ .../jaxrs-spec/data_class_req_var.mustache | 6 ++ .../libraries/jaxrs-spec/enum_class.mustache | 58 ++++++++++++ .../libraries/jaxrs-spec/enum_doc.mustache | 7 ++ .../libraries/jaxrs-spec/formParams.mustache | 1 + .../jaxrs-spec/generatedAnnotation.mustache | 1 + .../libraries/jaxrs-spec/gradle.properties | 1 + .../jaxrs-spec/headerParams.mustache | 1 + .../libraries/jaxrs-spec/model.mustache | 14 +++ .../libraries/jaxrs-spec/model_doc.mustache | 3 + .../libraries/jaxrs-spec/oneof_model.mustache | 3 + .../libraries/jaxrs-spec/pathParams.mustache | 1 + .../libraries/jaxrs-spec/queryParams.mustache | 1 + .../jaxrs-spec/.openapi-generator-ignore | 23 +++++ .../jaxrs-spec/.openapi-generator/FILES | 13 +++ .../jaxrs-spec/.openapi-generator/VERSION | 1 + .../kotlin-server/jaxrs-spec/README.md | 89 +++++++++++++++++++ .../kotlin-server/jaxrs-spec/build.gradle | 51 +++++++++++ .../jaxrs-spec/gradle.properties | 1 + .../kotlin-server/jaxrs-spec/settings.gradle | 1 + .../org/openapitools/server/apis/PetApi.kt | 66 ++++++++++++++ .../org/openapitools/server/apis/StoreApi.kt | 40 +++++++++ .../org/openapitools/server/apis/UserApi.kt | 59 ++++++++++++ .../openapitools/server/models/ApiResponse.kt | 33 +++++++ .../openapitools/server/models/Category.kt | 34 +++++++ .../server/models/ModelApiResponse.kt | 39 ++++++++ .../org/openapitools/server/models/Order.kt | 67 ++++++++++++++ .../org/openapitools/server/models/Pet.kt | 69 ++++++++++++++ .../org/openapitools/server/models/Tag.kt | 34 +++++++ .../org/openapitools/server/models/User.kt | 65 ++++++++++++++ 46 files changed, 1092 insertions(+), 13 deletions(-) create mode 100644 bin/configs/kotlin-server-jaxrs-spec.yaml create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/additionalModelTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiInterface.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiMethod.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidation.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationCore.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationHeaderParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationPathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationQueryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/generatedAnnotation.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/gradle.properties create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/oneof_model.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator-ignore create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/FILES create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/VERSION create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/README.md create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/gradle.properties create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/settings.gradle create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/PetApi.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/UserApi.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Category.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Order.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Pet.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Tag.kt create mode 100644 samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/User.kt diff --git a/bin/configs/kotlin-server-jaxrs-spec.yaml b/bin/configs/kotlin-server-jaxrs-spec.yaml new file mode 100644 index 00000000000..11d4fcec7a8 --- /dev/null +++ b/bin/configs/kotlin-server-jaxrs-spec.yaml @@ -0,0 +1,7 @@ +generatorName: kotlin-server +outputDir: samples/server/petstore/kotlin-server/jaxrs-spec +library: jaxrs-spec +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-server +additionalProperties: + useCoroutines: "true" diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 4d79d17024f..9fa866983a4 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -30,15 +30,19 @@ These options may be applied as additional-properties (cli) or configOptions (pl |featureLocations|Generates routes in a typed way, for both: constructing URLs and reading the parameters.| |true| |featureMetrics|Enables metrics feature.| |true| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| -|library|library template (sub-template)|
**ktor**
ktor framework
|ktor| +|interfaceOnly|Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.| |false| +|library|library template (sub-template)|
**ktor**
ktor framework
**jaxrs-spec**
JAX-RS spec only
|ktor| |modelMutable|Create mutable models| |false| |packageName|Generated artifact package name.| |org.openapitools.server| |parcelizeModels|toggle "@Parcelize" for generated models| |null| +|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true. This option is currently supported only when using jaxrs-spec library.| |false| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |sourceFolder|source folder for generated code| |src/main/kotlin| +|useBeanValidation|Use BeanValidation API annotations. This option is currently supported only when using jaxrs-spec library.| |false| +|useCoroutines|Whether to use the Coroutines. This option is currently supported only when using jaxrs-spec library.| |false| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java index 3caa91e404d..d1b1d1d57fb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java @@ -23,6 +23,7 @@ import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.meta.features.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,9 +34,14 @@ import java.util.EnumSet; import java.util.List; import java.util.Map; -public class KotlinServerCodegen extends AbstractKotlinCodegen { +public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanValidationFeatures { + + public static final String INTERFACE_ONLY = "interfaceOnly"; + public static final String USE_COROUTINES = "useCoroutines"; + public static final String RETURN_RESPONSE = "returnResponse"; public static final String DEFAULT_LIBRARY = Constants.KTOR; private final Logger LOGGER = LoggerFactory.getLogger(KotlinServerCodegen.class); + private Boolean autoHeadFeatureEnabled = true; private Boolean conditionalHeadersFeatureEnabled = false; private Boolean hstsFeatureEnabled = true; @@ -43,6 +49,10 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { private Boolean compressionFeatureEnabled = true; private Boolean locationsFeatureEnabled = true; private Boolean metricsFeatureEnabled = true; + private boolean interfaceOnly = false; + private boolean useBeanValidation = false; + private boolean useCoroutines = false; + private boolean returnResponse = false; // This is here to potentially warn the user when an option is not supported by the target framework. private Map> optionsSupportedPerFramework = new ImmutableMap.Builder>() @@ -102,6 +112,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { modelPackage = packageName + ".models"; supportedLibraries.put(Constants.KTOR, "ktor framework"); + supportedLibraries.put(Constants.JAXRS_SPEC, "JAX-RS spec only"); // TODO: Configurable server engine. Defaults to netty in build.gradle. CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC); @@ -117,6 +128,11 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { addSwitch(Constants.COMPRESSION, Constants.COMPRESSION_DESC, getCompressionFeatureEnabled()); addSwitch(Constants.LOCATIONS, Constants.LOCATIONS_DESC, getLocationsFeatureEnabled()); addSwitch(Constants.METRICS, Constants.METRICS_DESC, getMetricsFeatureEnabled()); + + cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.").defaultValue(String.valueOf(interfaceOnly))); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations. This option is currently supported only when using jaxrs-spec library.", useBeanValidation)); + cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines. This option is currently supported only when using jaxrs-spec library.")); + cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true. This option is currently supported only when using jaxrs-spec library.").defaultValue(String.valueOf(returnResponse))); } public Boolean getAutoHeadFeatureEnabled() { @@ -191,6 +207,37 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { public void processOpts() { super.processOpts(); + if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) { + this.setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY)); + } + + if (additionalProperties.containsKey(INTERFACE_ONLY)) { + interfaceOnly = Boolean.parseBoolean(additionalProperties.get(INTERFACE_ONLY).toString()); + if (!interfaceOnly) { + additionalProperties.remove(INTERFACE_ONLY); + } + } + + if (additionalProperties.containsKey(USE_COROUTINES)) { + useCoroutines = Boolean.parseBoolean(additionalProperties.get(USE_COROUTINES).toString()); + if (!useCoroutines) { + additionalProperties.remove(USE_COROUTINES); + } + } + + if (additionalProperties.containsKey(RETURN_RESPONSE)) { + returnResponse = Boolean.parseBoolean(additionalProperties.get(RETURN_RESPONSE).toString()); + if (!returnResponse) { + additionalProperties.remove(RETURN_RESPONSE); + } + } + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + // set default library to "ktor" if (StringUtils.isEmpty(library)) { this.setLibrary(DEFAULT_LIBRARY); @@ -245,29 +292,40 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { String resourcesFolder = "src/main/resources"; // not sure this can be user configurable. supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); + + if (library.equals(Constants.KTOR)) { + supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); + } supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); supportingFiles.add(new SupportingFile("gradle.properties", "", "gradle.properties")); - supportingFiles.add(new SupportingFile("AppMain.kt.mustache", packageFolder, "AppMain.kt")); - supportingFiles.add(new SupportingFile("Configuration.kt.mustache", packageFolder, "Configuration.kt")); + if (library.equals(Constants.KTOR)) { + supportingFiles.add(new SupportingFile("AppMain.kt.mustache", packageFolder, "AppMain.kt")); + supportingFiles.add(new SupportingFile("Configuration.kt.mustache", packageFolder, "Configuration.kt")); - if (generateApis && locationsFeatureEnabled) { - supportingFiles.add(new SupportingFile("Paths.kt.mustache", packageFolder, "Paths.kt")); + if (generateApis && locationsFeatureEnabled) { + supportingFiles.add(new SupportingFile("Paths.kt.mustache", packageFolder, "Paths.kt")); + } + + supportingFiles.add(new SupportingFile("application.conf.mustache", resourcesFolder, "application.conf")); + supportingFiles.add(new SupportingFile("logback.xml", resourcesFolder, "logback.xml")); + + final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", File.separator); + + supportingFiles.add(new SupportingFile("ApiKeyAuth.kt.mustache", infrastructureFolder, "ApiKeyAuth.kt")); } + } - supportingFiles.add(new SupportingFile("application.conf.mustache", resourcesFolder, "application.conf")); - supportingFiles.add(new SupportingFile("logback.xml", resourcesFolder, "logback.xml")); - - final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", File.separator); - - supportingFiles.add(new SupportingFile("ApiKeyAuth.kt.mustache", infrastructureFolder, "ApiKeyAuth.kt")); + @Override + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; } public static class Constants { public final static String KTOR = "ktor"; + public final static String JAXRS_SPEC = "jaxrs-spec"; public final static String AUTOMATIC_HEAD_REQUESTS = "featureAutoHead"; public final static String AUTOMATIC_HEAD_REQUESTS_DESC = "Automatically provide responses to HEAD requests for existing routes that have the GET verb defined."; public final static String CONDITIONAL_HEADERS = "featureConditionalHeaders"; diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/additionalModelTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/additionalModelTypeAnnotations.mustache new file mode 100644 index 00000000000..f4871c02cc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/additionalModelTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/api.mustache new file mode 100644 index 00000000000..2d716bd7fdf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/api.mustache @@ -0,0 +1,31 @@ +package {{package}}; + +{{#imports}}import {{import}} +{{/imports}} + +import javax.ws.rs.* +import javax.ws.rs.core.Response + +{{#useSwaggerAnnotations}} +import io.swagger.annotations.* +{{/useSwaggerAnnotations}} + +import java.io.InputStream +import java.util.Map +import java.util.List +{{#useBeanValidation}}import javax.validation.constraints.* +import javax.validation.Valid{{/useBeanValidation}} + +{{#useSwaggerAnnotations}} +@Api(description = "the {{{baseName}}} API"){{/useSwaggerAnnotations}}{{#hasConsumes}} +@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} +@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} +@Path("/") +{{>generatedAnnotation}}{{#interfaceOnly}}interface{{/interfaceOnly}}{{^interfaceOnly}}class{{/interfaceOnly}} {{classname}} { +{{#operations}} +{{#operation}} + +{{#interfaceOnly}}{{>apiInterface}}{{/interfaceOnly}}{{^interfaceOnly}}{{>apiMethod}}{{/interfaceOnly}} +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiInterface.mustache new file mode 100644 index 00000000000..d64ab757938 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiInterface.mustache @@ -0,0 +1,13 @@ + @{{httpMethod}} + @Path("{{{path}}}"){{#hasConsumes}} + @Consumes({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}){{/hasConsumes}}{{#hasProduces}} + @Produces({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}){{/hasProduces}}{{#useSwaggerAnnotations}} + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { + {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, + {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} + {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} + {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} + {{#useCoroutines}}suspend {{/useCoroutines}}fun {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}){{#returnResponse}}: Response{{/returnResponse}}{{^returnResponse}}{{#returnType}}: {{{returnType}}}{{/returnType}}{{/returnResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiMethod.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiMethod.mustache new file mode 100644 index 00000000000..bfe70607f17 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/apiMethod.mustache @@ -0,0 +1,16 @@ + @{{httpMethod}}{{#subresourceOperation}} + @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} + @Consumes({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}){{/hasConsumes}}{{#hasProduces}} + @Produces({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}){{/hasProduces}}{{#useSwaggerAnnotations}} + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { + {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, + {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} + {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} + {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} + }){{/useSwaggerAnnotations}} + {{#useCoroutines}}suspend {{/useCoroutines}}fun {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}): Response { + return Response.ok().entity("magic!").build(); + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidation.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidation.mustache new file mode 100644 index 00000000000..ef7ab3fb7a9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidation.mustache @@ -0,0 +1,5 @@ + @Valid +{{#required}} + @NotNull +{{/required}} +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationCore.mustache new file mode 100644 index 00000000000..d6e2f13b457 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationHeaderParams.mustache new file mode 100644 index 00000000000..c4ff01d7e55 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationHeaderParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationPathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationPathParams.mustache new file mode 100644 index 00000000000..051bd53c0a5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..c4ff01d7e55 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/bodyParams.mustache new file mode 100644 index 00000000000..ba9197f35a4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{#useBeanValidation}}@Valid {{#required}}{{^isNullable}}@NotNull {{/isNullable}}{{/required}}{{/useBeanValidation}} {{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache new file mode 100644 index 00000000000..639084ec35b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/build.gradle.mustache @@ -0,0 +1,57 @@ +group "{{groupId}}" +version "{{artifactVersion}}" + +wrapper { + gradleVersion = "6.9" + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = "1.4.32" + ext.jakarta_ws_rs_version = "2.1.6" + ext.swagger_annotations_version = "1.5.3" + ext.jakarta_annotations_version = "1.3.5" + ext.jackson_version = "2.9.9" +{{#useBeanValidation}} + ext.beanvalidation_version = "2.0.2" +{{/useBeanValidation}} + repositories { + maven { url "https://repo1.maven.org/maven2" } + maven { url "https://plugins.gradle.org/m2/" } + } + dependencies { + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + } +} + +apply plugin: "java" +apply plugin: "kotlin" +apply plugin: "application" + +sourceCompatibility = 1.8 + +compileKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +compileTestKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +repositories { + maven { setUrl("https://repo1.maven.org/maven2") } +} + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") + implementation("ch.qos.logback:logback-classic:1.2.1") + implementation("jakarta.ws.rs:jakarta.ws.rs-api:$jakarta_ws_rs_version") + implementation("jakarta.annotation:jakarta.annotation-api:$jakarta_annotations_version") + implementation("io.swagger:swagger-annotations:$swagger_annotations_version") + implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version") +{{#useBeanValidation}} + implementation("jakarta.validation:jakarta.validation-api:$beanvalidation_version") +{{/useBeanValidation}} + testImplementation("junit:junit:4.13.2") +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache new file mode 100644 index 00000000000..eda2d526ebd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache new file mode 100644 index 00000000000..c0fdd457ba7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache @@ -0,0 +1,73 @@ +import com.fasterxml.jackson.annotation.JsonProperty +{{#kotlinx_serialization}} +import {{#serializableModel}}kotlinx.serialization.Serializable as KSerializable{{/serializableModel}}{{^serializableModel}}kotlinx.serialization.Serializable{{/serializableModel}} +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +{{#hasEnums}} +{{/hasEnums}} +{{/kotlinx_serialization}} +{{#parcelizeModels}} +import android.os.Parcelable +import kotlinx.parcelize.Parcelize +{{/parcelizeModels}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} +/** + * {{{description}}} + * +{{#allVars}} + * @param {{{name}}} {{{description}}} +{{/allVars}} + */ +{{#parcelizeModels}} +@Parcelize +{{/parcelizeModels}} +{{#multiplatform}}{{^discriminator}}@Serializable{{/discriminator}}{{/multiplatform}}{{#kotlinx_serialization}}{{#serializableModel}}@KSerializable{{/serializableModel}}{{^serializableModel}}@Serializable{{/serializableModel}}{{/kotlinx_serialization}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}}{{#jackson}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{/jackson}} +{{#isDeprecated}} +@Deprecated(message = "This schema is deprecated.") +{{/isDeprecated}} +{{>additionalModelTypeAnnotations}} +{{#nonPublicApi}}internal {{/nonPublicApi}}{{#discriminator}}interface{{/discriminator}}{{^discriminator}}data class{{/discriminator}} {{classname}}{{^discriminator}} ( + +{{#allVars}} +{{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}} + +{{/allVars}} +){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { +{{/vendorExtensions.x-has-data-class-body}} +{{#serializableModel}} + {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { + private const val serialVersionUID: Long = 123 + } +{{/serializableModel}} +{{#discriminator}}{{#vars}}{{#required}} +{{>interface_req_var}}{{/required}}{{^required}} +{{>interface_opt_var}}{{/required}}{{/vars}}{{/discriminator}} +{{#hasEnums}} +{{#vars}} +{{#isEnum}} + /** + * {{{description}}} + * + * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + */ + {{#kotlinx_serialization}} + {{#serializableModel}}@KSerializable{{/serializableModel}}{{^serializableModel}}@Serializable{{/serializableModel}} + {{/kotlinx_serialization}} + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{#allowableValues}} + {{#enumVars}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/kotlinx_serialization}} + {{/enumVars}} + {{/allowableValues}} + } +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +{{#vendorExtensions.x-has-data-class-body}} +} +{{/vendorExtensions.x-has-data-class-body}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache new file mode 100644 index 00000000000..d99ccd902fa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache @@ -0,0 +1,6 @@ +{{#description}} + /* {{{.}}} */ +{{/description}} + + @JsonProperty("{{{baseName}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache new file mode 100644 index 00000000000..5c69ae13e51 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache @@ -0,0 +1,6 @@ +{{#description}} + /* {{{.}}} */ +{{/description}} + + @JsonProperty("{{{baseName}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache new file mode 100644 index 00000000000..005b9daa596 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_class.mustache @@ -0,0 +1,58 @@ +import com.fasterxml.jackson.annotation.JsonProperty +{{#kotlinx_serialization}} +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +{{/kotlinx_serialization}} + +/** + * {{{description}}} + * + * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} + */ +{{#kotlinx_serialization}}@Serializable{{/kotlinx_serialization}} +{{>additionalModelTypeAnnotations}} +{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}) { +{{#allowableValues}}{{#enumVars}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) + {{/kotlinx_serialization}} + {{#isArray}} + {{#isList}} + {{&name}}(listOf({{{value}}})){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/isList}} + {{^isList}} + {{&name}}(arrayOf({{{value}}})){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/isList}} + {{/isArray}} + {{^isArray}} + {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/isArray}} +{{/enumVars}}{{/allowableValues}} + /** + * Override toString() to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): String = value{{^isString}}.toString(){{/isString}} + + companion object { + /** + * Converts the provided [data] to a [String] on success, null otherwise. + */ + fun encode(data: Any?): kotlin.String? = if (data is {{classname}}) "$data" else null + + /** + * Returns a valid [{{classname}}] for [data], null otherwise. + */ + @OptIn(ExperimentalStdlibApi::class) + fun decode(data: Any?): {{classname}}? = data?.let { + val normalizedData = "$it".lowercase() + values().firstOrNull { value -> + it == value || normalizedData == "$value".lowercase() + } + } + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_doc.mustache new file mode 100644 index 00000000000..fcb3d7e61aa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/enum_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} + * `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/formParams.mustache new file mode 100644 index 00000000000..5427f037ae0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{^isFile}}@FormParam(value = "{{baseName}}") {{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{/isFile}}{{#isFile}} @FormParam(value = "{{baseName}}") {{paramName}}InputStream: InputStream{{^required}}?{{/required}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/generatedAnnotation.mustache new file mode 100644 index 00000000000..624b44019ad --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/generatedAnnotation.mustache @@ -0,0 +1 @@ +@javax.annotation.Generated(value = arrayOf("{{generatorClass}}"){{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/gradle.properties b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/gradle.properties new file mode 100644 index 00000000000..5f1ed7bbe02 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache new file mode 100644 index 00000000000..980d55c7e51 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model.mustache new file mode 100644 index 00000000000..03eecdc64ac --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model.mustache @@ -0,0 +1,14 @@ +{{>licenseInfo}} +package {{modelPackage}} + +{{#imports}}import {{import}} +{{/imports}} +{{#useBeanValidation}} +import javax.validation.constraints.* +import javax.validation.Valid +{{/useBeanValidation}} +{{#models}} +{{#model}} +{{#isEnum}}{{>enum_class}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{>oneof_model}}{{/oneOf}}{{^oneOf}}{{#isAlias}}typealias {{classname}} = {{{dataType}}}{{/isAlias}}{{^isAlias}}{{>data_class}}{{/isAlias}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model_doc.mustache new file mode 100644 index 00000000000..e3b71842118 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/model_doc.mustache @@ -0,0 +1,3 @@ +{{#models}}{{#model}} +{{#isEnum}}{{>enum_doc}}{{/isEnum}}{{^isEnum}}{{>class_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/oneof_model.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/oneof_model.mustache new file mode 100644 index 00000000000..83c841f5600 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/oneof_model.mustache @@ -0,0 +1,3 @@ +{{#-first}} +typealias {{classname}} = Any +{{/-first}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache new file mode 100644 index 00000000000..7839f91302b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache new file mode 100644 index 00000000000..91a0dfdb664 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{/isQueryParam}} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator-ignore b/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/.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/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/FILES b/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/FILES new file mode 100644 index 00000000000..8311b1e0d0a --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/FILES @@ -0,0 +1,13 @@ +README.md +build.gradle +gradle.properties +settings.gradle +src/main/kotlin/org/openapitools/server/apis/PetApi.kt +src/main/kotlin/org/openapitools/server/apis/StoreApi.kt +src/main/kotlin/org/openapitools/server/apis/UserApi.kt +src/main/kotlin/org/openapitools/server/models/Category.kt +src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/server/models/Order.kt +src/main/kotlin/org/openapitools/server/models/Pet.kt +src/main/kotlin/org/openapitools/server/models/Tag.kt +src/main/kotlin/org/openapitools/server/models/User.kt diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/README.md b/samples/server/petstore/kotlin-server/jaxrs-spec/README.md new file mode 100644 index 00000000000..d5e7ab18e68 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/README.md @@ -0,0 +1,89 @@ +# org.openapitools.server - Kotlin Server library for OpenAPI Petstore + +## Requires + +* Kotlin 1.4.31 +* Gradle 6.8.2 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*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 +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | 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/{orderId} | 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 + + - [org.openapitools.server.models.Category](docs/Category.md) + - [org.openapitools.server.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.server.models.Order](docs/Order.md) + - [org.openapitools.server.models.Pet](docs/Pet.md) + - [org.openapitools.server.models.Tag](docs/Tag.md) + - [org.openapitools.server.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### 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 + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle b/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle new file mode 100644 index 00000000000..b85cf730367 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/build.gradle @@ -0,0 +1,51 @@ +group "org.openapitools" +version "1.0.0" + +wrapper { + gradleVersion = "6.9" + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = "1.4.32" + ext.jakarta_ws_rs_version = "2.1.6" + ext.swagger_annotations_version = "1.5.3" + ext.jakarta_annotations_version = "1.3.5" + ext.jackson_version = "2.9.9" + repositories { + maven { url "https://repo1.maven.org/maven2" } + maven { url "https://plugins.gradle.org/m2/" } + } + dependencies { + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + } +} + +apply plugin: "java" +apply plugin: "kotlin" +apply plugin: "application" + +sourceCompatibility = 1.8 + +compileKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +compileTestKotlin { + kotlinOptions.jvmTarget = "1.8" +} + +repositories { + maven { setUrl("https://repo1.maven.org/maven2") } +} + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") + implementation("ch.qos.logback:logback-classic:1.2.1") + implementation("jakarta.ws.rs:jakarta.ws.rs-api:$jakarta_ws_rs_version") + implementation("jakarta.annotation:jakarta.annotation-api:$jakarta_annotations_version") + implementation("io.swagger:swagger-annotations:$swagger_annotations_version") + implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version") + implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version") + testImplementation("junit:junit:4.13.2") +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/gradle.properties b/samples/server/petstore/kotlin-server/jaxrs-spec/gradle.properties new file mode 100644 index 00000000000..5f1ed7bbe02 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/gradle.properties @@ -0,0 +1 @@ +org.gradle.caching=true \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/settings.gradle b/samples/server/petstore/kotlin-server/jaxrs-spec/settings.gradle new file mode 100644 index 00000000000..a09a58efab1 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'kotlin-server' \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/PetApi.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/PetApi.kt new file mode 100644 index 00000000000..eb94d6065e6 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/PetApi.kt @@ -0,0 +1,66 @@ +package org.openapitools.server.apis; + +import org.openapitools.server.models.ModelApiResponse +import org.openapitools.server.models.Pet + +import javax.ws.rs.* +import javax.ws.rs.core.Response + + +import java.io.InputStream +import java.util.Map +import java.util.List + + + +@Path("/") +@javax.annotation.Generated(value = arrayOf("org.openapitools.codegen.languages.KotlinServerCodegen"))class PetApi { + + @POST + @Consumes("application/json", "application/xml") + suspend fun addPet( body: Pet): Response { + return Response.ok().entity("magic!").build(); + } + + @DELETE + suspend fun deletePet(@PathParam("petId") petId: kotlin.Long,@HeaderParam("api_key") apiKey: kotlin.String?): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/xml", "application/json") + suspend fun findPetsByStatus(@QueryParam("status") status: kotlin.collections.List): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/xml", "application/json") + suspend fun findPetsByTags(@QueryParam("tags") tags: kotlin.collections.List): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/xml", "application/json") + suspend fun getPetById(@PathParam("petId") petId: kotlin.Long): Response { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Consumes("application/json", "application/xml") + suspend fun updatePet( body: Pet): Response { + return Response.ok().entity("magic!").build(); + } + + @POST + @Consumes("application/x-www-form-urlencoded") + suspend fun updatePetWithForm(@PathParam("petId") petId: kotlin.Long,@FormParam(value = "name") name: kotlin.String?,@FormParam(value = "status") status: kotlin.String?): Response { + return Response.ok().entity("magic!").build(); + } + + @POST + @Consumes("multipart/form-data") + @Produces("application/json") + suspend fun uploadFile(@PathParam("petId") petId: kotlin.Long,@FormParam(value = "additionalMetadata") additionalMetadata: kotlin.String?, @FormParam(value = "file") fileInputStream: InputStream?): Response { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt new file mode 100644 index 00000000000..f297a11661d --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt @@ -0,0 +1,40 @@ +package org.openapitools.server.apis; + +import org.openapitools.server.models.Order + +import javax.ws.rs.* +import javax.ws.rs.core.Response + + +import java.io.InputStream +import java.util.Map +import java.util.List + + + +@Path("/") +@javax.annotation.Generated(value = arrayOf("org.openapitools.codegen.languages.KotlinServerCodegen"))class StoreApi { + + @DELETE + suspend fun deleteOrder(@PathParam("orderId") orderId: kotlin.String): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/json") + suspend fun getInventory(): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/xml", "application/json") + suspend fun getOrderById(@PathParam("orderId") orderId: kotlin.Long): Response { + return Response.ok().entity("magic!").build(); + } + + @POST + @Produces("application/xml", "application/json") + suspend fun placeOrder( body: Order): Response { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/UserApi.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/UserApi.kt new file mode 100644 index 00000000000..f824ebc217a --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/apis/UserApi.kt @@ -0,0 +1,59 @@ +package org.openapitools.server.apis; + +import org.openapitools.server.models.User + +import javax.ws.rs.* +import javax.ws.rs.core.Response + + +import java.io.InputStream +import java.util.Map +import java.util.List + + + +@Path("/") +@javax.annotation.Generated(value = arrayOf("org.openapitools.codegen.languages.KotlinServerCodegen"))class UserApi { + + @POST + suspend fun createUser( body: User): Response { + return Response.ok().entity("magic!").build(); + } + + @POST + suspend fun createUsersWithArrayInput( body: kotlin.collections.List): Response { + return Response.ok().entity("magic!").build(); + } + + @POST + suspend fun createUsersWithListInput( body: kotlin.collections.List): Response { + return Response.ok().entity("magic!").build(); + } + + @DELETE + suspend fun deleteUser(@PathParam("username") username: kotlin.String): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/xml", "application/json") + suspend fun getUserByName(@PathParam("username") username: kotlin.String): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + @Produces("application/xml", "application/json") + suspend fun loginUser(@QueryParam("username") username: kotlin.String,@QueryParam("password") password: kotlin.String): Response { + return Response.ok().entity("magic!").build(); + } + + @GET + suspend fun logoutUser(): Response { + return Response.ok().entity("magic!").build(); + } + + @PUT + suspend fun updateUser(@PathParam("username") username: kotlin.String, body: User): Response { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt new file mode 100644 index 00000000000..974c9589a7f --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt @@ -0,0 +1,33 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import com.fasterxml.jackson.annotation.JsonProperty +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + + +data class ApiResponse ( + + val code: kotlin.Int? = null, + + val type: kotlin.String? = null, + + val message: kotlin.String? = null + +) + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Category.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Category.kt new file mode 100644 index 00000000000..9a39acd8aea --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Category.kt @@ -0,0 +1,34 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import com.fasterxml.jackson.annotation.JsonProperty +/** + * A category for a pet + * + * @param id + * @param name + */ + + +data class Category ( + + + @JsonProperty("id") + val id: kotlin.Long? = null, + + + @JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt new file mode 100644 index 00000000000..531f364e2f7 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import com.fasterxml.jackson.annotation.JsonProperty +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + + +data class ModelApiResponse ( + + + @JsonProperty("code") + val code: kotlin.Int? = null, + + + @JsonProperty("type") + val type: kotlin.String? = null, + + + @JsonProperty("message") + val message: kotlin.String? = null + +) + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Order.kt new file mode 100644 index 00000000000..d4a39a2c2bb --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import com.fasterxml.jackson.annotation.JsonProperty +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + + +data class Order ( + + + @JsonProperty("id") + val id: kotlin.Long? = null, + + + @JsonProperty("petId") + val petId: kotlin.Long? = null, + + + @JsonProperty("quantity") + val quantity: kotlin.Int? = null, + + + @JsonProperty("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + + @JsonProperty("status") + val status: Order.Status? = null, + + + @JsonProperty("complete") + val complete: kotlin.Boolean? = false + +) { + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "placed") placed("placed"), + @JsonProperty(value = "approved") approved("approved"), + @JsonProperty(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Pet.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Pet.kt new file mode 100644 index 00000000000..826d87a7303 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Pet.kt @@ -0,0 +1,69 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import org.openapitools.server.models.Category +import org.openapitools.server.models.Tag +import com.fasterxml.jackson.annotation.JsonProperty +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + + +data class Pet ( + + + @JsonProperty("name") + val name: kotlin.String, + + + @JsonProperty("photoUrls") + val photoUrls: kotlin.collections.List, + + + @JsonProperty("id") + val id: kotlin.Long? = null, + + + @JsonProperty("category") + val category: Category? = null, + + + @JsonProperty("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + + @JsonProperty("status") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"); + } +} + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Tag.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Tag.kt new file mode 100644 index 00000000000..ded0e6fab03 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/Tag.kt @@ -0,0 +1,34 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import com.fasterxml.jackson.annotation.JsonProperty +/** + * A tag for a pet + * + * @param id + * @param name + */ + + +data class Tag ( + + + @JsonProperty("id") + val id: kotlin.Long? = null, + + + @JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/User.kt b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/User.kt new file mode 100644 index 00000000000..4d0dcec6691 --- /dev/null +++ b/samples/server/petstore/kotlin-server/jaxrs-spec/src/main/kotlin/org/openapitools/server/models/User.kt @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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.server.models + +import com.fasterxml.jackson.annotation.JsonProperty +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + + +data class User ( + + + @JsonProperty("id") + val id: kotlin.Long? = null, + + + @JsonProperty("username") + val username: kotlin.String? = null, + + + @JsonProperty("firstName") + val firstName: kotlin.String? = null, + + + @JsonProperty("lastName") + val lastName: kotlin.String? = null, + + + @JsonProperty("email") + val email: kotlin.String? = null, + + + @JsonProperty("password") + val password: kotlin.String? = null, + + + @JsonProperty("phone") + val phone: kotlin.String? = null, + + /* User Status */ + + @JsonProperty("userStatus") + val userStatus: kotlin.Int? = null + +) + From 3f0f92fb653d11eee6bb7d5f59e3d1c10c57040c Mon Sep 17 00:00:00 2001 From: Chao Yang Date: Fri, 28 Jan 2022 20:55:44 -0600 Subject: [PATCH 105/113] [crystal][client] Make optional properties nillable in models (#10723) * Add nillable data types to models Only REQUIRED and NOT NULLABLE variables can NOT have type Nil All OPTIONAL and NULLABLE-REQUIRED variables have type Nil Only NULLABLE-REQUIRED variables should emit keys with null values when they are serialized, json example: property name : String? = nil; the json representation for this property is {"name": null} For all OPTIONAL variables having Nil values, their variable keys would be skipped during serialization. The json representation for OPTIONAL property name : String? = nil; would be: {} * Fix failed tests in samples/client/petstore/crystal/spec/api/pet_api_spec.cr * Remove isNullable from model template * No need to check nillability of required property For any required property, assigning nil value to it will result in compilation error The datatype simply can not hold value nil, so there's no need to check it * Place required vars first in initializor * Refresh generated sample code for crystal client * Required properties are not nillable * Fix compilation error of undefined method equal? Crystal lang doesn't have method equal? We should use method same? instead of ruby's equal? method Reference: https://crystal-lang.org/api/master/Reference.html#same?(other:Reference):Bool-instance-method * Add tests for add_pet api endpoint with only required parameters Setting Pet optional properties to nil values is allowed by add_pet api endpoint * Add helper method to test compilation errors * Add tests to Pet model Test model initializations Test compilation error when model is initialized without required properties * Test required properties in json deserialization for Pet model --- .../crystal/partial_model_generic.mustache | 45 ++++++++----------- .../resources/crystal/spec_helper.mustache | 10 ++++- .../crystal/pet_compilation_error_spec.cr | 11 +++++ .../petstore/crystal/spec/api/pet_api_spec.cr | 39 +++++++++++----- .../petstore/crystal/spec/models/pet_spec.cr | 44 ++++++++++++++++-- .../petstore/crystal/spec/models/tag_spec.cr | 15 +++++++ .../petstore/crystal/spec/spec_helper.cr | 10 ++++- .../src/petstore/models/api_response.cr | 15 ++++--- .../crystal/src/petstore/models/category.cr | 11 ++--- .../crystal/src/petstore/models/order.cr | 27 +++++------ .../crystal/src/petstore/models/pet.cr | 40 +++++++---------- .../crystal/src/petstore/models/tag.cr | 11 ++--- .../crystal/src/petstore/models/user.cr | 35 ++++++++------- 13 files changed, 200 insertions(+), 113 deletions(-) create mode 100644 samples/client/petstore/crystal/pet_compilation_error_spec.cr diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache index 4f2de178b0e..8e09ec2aba3 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache @@ -4,14 +4,28 @@ class {{classname}}{{#parent}} < {{{.}}}{{/parent}} include JSON::Serializable - {{#vars}} + {{#hasRequired}} + # Required properties + {{/hasRequired}} + {{#requiredVars}} {{#description}} # {{{.}}} {{/description}} - @[JSON::Field(key: "{{{baseName}}}", type: {{{dataType}}}{{#defaultValue}}, default: {{{defaultValue}}}{{/defaultValue}}{{#isNullable}}, nillable: true, emit_null: true{{/isNullable}})] + @[JSON::Field(key: "{{{baseName}}}", type: {{{dataType}}}{{#defaultValue}}, default: {{{defaultValue}}}{{/defaultValue}}, nillable: false, emit_null: false)] property {{{name}}} : {{{dataType}}} - {{/vars}} + {{/requiredVars}} + {{#hasOptional}} + # Optional properties + {{/hasOptional}} + {{#optionalVars}} + {{#description}} + # {{{.}}} + {{/description}} + @[JSON::Field(key: "{{{baseName}}}", type: {{{dataType}}}?{{#defaultValue}}, default: {{{defaultValue}}}{{/defaultValue}}, nillable: true, emit_null: false)] + property {{{name}}} : {{{dataType}}}? + + {{/optionalVars}} {{#hasEnums}} class EnumAttributeValidator getter datatype : String @@ -74,7 +88,7 @@ {{/discriminator}} # Initializes the object # @param [Hash] attributes Model attributes in the form of hash - def initialize({{#vars}}@{{{name}}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/vars}}) + def initialize({{#requiredVars}}@{{{name}}} : {{{dataType}}}{{^-last}}, {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}@{{{name}}} : {{{dataType}}}?{{^-last}}, {{/-last}}{{/optionalVars}}) end # Show invalid properties with the reasons. Usually used together with valid? @@ -82,14 +96,6 @@ def list_invalid_properties invalid_properties = {{^parent}}Array(String).new{{/parent}}{{#parent}}super{{/parent}} {{#vars}} - {{^isNullable}} - {{#required}} - if @{{{name}}}.nil? - invalid_properties.push("invalid value for \"{{{name}}}\", {{{name}}} cannot be nil.") - end - - {{/required}} - {{/isNullable}} {{#hasValidation}} {{#maxLength}} if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.size > {{{maxLength}}} @@ -143,11 +149,6 @@ # @return true if the model is valid def valid? {{#vars}} - {{^isNullable}} - {{#required}} - return false if @{{{name}}}.nil? - {{/required}} - {{/isNullable}} {{#isEnum}} {{^isContainer}} {{{name}}}_validator = EnumAttributeValidator.new("{{{dataType}}}", [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]) @@ -217,14 +218,6 @@ # Custom attribute writer method with validation # @param [Object] {{{name}}} Value to be assigned def {{{name}}}=({{{name}}}) - {{^isNullable}} - {{#required}} - if {{{name}}}.nil? - raise ArgumentError.new("{{{name}}} cannot be nil") - end - - {{/required}} - {{/isNullable}} {{#maxLength}} if {{^required}}!{{{name}}}.nil? && {{/required}}{{{name}}}.to_s.size > {{{maxLength}}} raise ArgumentError.new("invalid value for \"{{{name}}}\", the character length must be smaller than or equal to {{{maxLength}}}.") @@ -277,7 +270,7 @@ # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class{{#vars}} && {{name}} == o.{{name}}{{/vars}}{{#parent}} && super(o){{/parent}} end diff --git a/modules/openapi-generator/src/main/resources/crystal/spec_helper.mustache b/modules/openapi-generator/src/main/resources/crystal/spec_helper.mustache index 9facafa4a93..56675bb6876 100644 --- a/modules/openapi-generator/src/main/resources/crystal/spec_helper.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/spec_helper.mustache @@ -3,4 +3,12 @@ # load modules require "spec" require "json" -require "../src/{{{shardName}}}" \ No newline at end of file +require "../src/{{{shardName}}}" + +def assert_compilation_error(path : String, message : String) : Nil + buffer = IO::Memory.new + result = Process.run("crystal", ["run", "--no-color", "--no-codegen", path], error: buffer) + result.success?.should be_false + buffer.to_s.should contain message + buffer.close +end diff --git a/samples/client/petstore/crystal/pet_compilation_error_spec.cr b/samples/client/petstore/crystal/pet_compilation_error_spec.cr new file mode 100644 index 00000000000..519cb5b73e3 --- /dev/null +++ b/samples/client/petstore/crystal/pet_compilation_error_spec.cr @@ -0,0 +1,11 @@ +require "./spec/spec_helper" +require "json" +require "time" + +describe Petstore::Pet do + describe "test an instance of Pet" do + it "should fail to compile if any required properties is missing" do + pet = Petstore::Pet.new(id: nil, category: nil, name: nil, photo_urls: Array(String).new, tags: nil, status: nil) + end + end +end diff --git a/samples/client/petstore/crystal/spec/api/pet_api_spec.cr b/samples/client/petstore/crystal/spec/api/pet_api_spec.cr index 5c5f56295ac..5eb508ebd72 100644 --- a/samples/client/petstore/crystal/spec/api/pet_api_spec.cr +++ b/samples/client/petstore/crystal/spec/api/pet_api_spec.cr @@ -29,8 +29,28 @@ describe "PetApi" do # @param [Hash] opts the optional parameters # @return [Pet] describe "add_pet test" do - it "should work" do + it "should work with only required attributes" do # assertion here. ref: https://crystal-lang.org/reference/guides/testing.html + + config = Petstore::Configuration.new + config.access_token = "yyy" + config.api_key[:api_key] = "xxx" + config.api_key_prefix[:api_key] = "Token" + + api_client = Petstore::ApiClient.new(config) + + api_instance = Petstore::PetApi.new(api_client) + + pet_name = "new pet" + new_pet = Petstore::Pet.new(id: nil, category: nil, name: pet_name, photo_urls: Array(String).new, tags: nil, status: nil) + + pet = api_instance.add_pet(new_pet) + pet.id.should_not be_nil + pet.category.should be_nil + pet.name.should eq pet_name + pet.photo_urls.should eq Array(String).new + pet.status.should be_nil + pet.tags.should eq Array(Petstore::Tag).new end end @@ -89,20 +109,17 @@ describe "PetApi" do api_instance = Petstore::PetApi.new(api_client) - # create a pet to start with - pet_id = Int64.new(91829) - pet = Petstore::Pet.new(id: pet_id, category: Petstore::Category.new(id: pet_id + 10, name: "crystal category"), name: "crystal", photo_urls: ["https://crystal-lang.org"], tags: [Petstore::Tag.new(id: pet_id + 100, name: "crystal tag")], status: "available") - - api_instance.add_pet(pet) + new_pet = Petstore::Pet.new(id: nil, category: nil, name: "crystal", photo_urls: Array(String).new, tags: nil, status: nil) + pet = api_instance.add_pet(new_pet) + pet_id = pet.id.not_nil! result = api_instance.get_pet_by_id(pet_id: pet_id) result.id.should eq pet_id - result.category.id.should eq pet_id + 10 - result.category.name.should eq "crystal category" + result.category.should be_nil result.name.should eq "crystal" - result.photo_urls.should eq ["https://crystal-lang.org"] - result.status.should eq "available" - result.tags[0].id.should eq pet_id + 100 + result.photo_urls.should eq Array(String).new + result.status.should be_nil + result.tags.should eq Array(Petstore::Tag).new end end diff --git a/samples/client/petstore/crystal/spec/models/pet_spec.cr b/samples/client/petstore/crystal/spec/models/pet_spec.cr index d3eaf60dfc1..16117449db5 100644 --- a/samples/client/petstore/crystal/spec/models/pet_spec.cr +++ b/samples/client/petstore/crystal/spec/models/pet_spec.cr @@ -18,11 +18,49 @@ require "time" describe Petstore::Pet do describe "test an instance of Pet" do - it "should create an instance of Pet" do - #instance = Petstore::Pet.new - #expect(instance).to be_instance_of(Petstore::Pet) + it "should fail to compile if any required properties is missing" do + assert_compilation_error(path: "./pet_compilation_error_spec.cr", message: "Error: no overload matches 'Petstore::Pet.new', id: Nil, category: Nil, name: Nil, photo_urls: Array(String), tags: Nil, status: Nil") + end + + it "should create an instance of Pet with only required properties" do + pet = Petstore::Pet.new(id: nil, category: nil, name: "new pet", photo_urls: Array(String).new, tags: nil, status: nil) + pet.should be_a(Petstore::Pet) + end + + it "should create an instance of Pet with all properties" do + pet_id = 12345_i64 + pet = Petstore::Pet.new(id: pet_id, category: Petstore::Category.new(id: pet_id + 10, name: "crystal category"), name: "crystal", photo_urls: ["https://crystal-lang.org"], tags: [Petstore::Tag.new(id: pet_id + 100, name: "crystal tag")], status: "available") + pet.should be_a(Petstore::Pet) end end + + describe "#from_json" do + it "should instantiate a new instance from json string with required properties" do + pet = Petstore::Pet.from_json("{\"name\": \"json pet\", \"photoUrls\": []}") + pet.should be_a(Petstore::Pet) + pet.name.should eq "json pet" + pet.photo_urls.should eq Array(String).new + end + + it "should raise error when instantiating a new instance from json string with missing required properties" do + expect_raises(JSON::SerializableError, "Missing JSON attribute: name") do + Petstore::Pet.from_json("{\"photoUrls\": []}") + end + expect_raises(JSON::SerializableError, "Missing JSON attribute: photoUrls") do + Petstore::Pet.from_json("{\"name\": \"json pet\"}") + end + end + + it "should raise error when instantiating a new instance from json string with required properties set to null value" do + expect_raises(JSON::SerializableError, "Expected String but was Null") do + Petstore::Pet.from_json("{\"name\": null, \"photoUrls\": []}") + end + expect_raises(JSON::SerializableError, "Expected BeginArray but was Null") do + Petstore::Pet.from_json("{\"name\": \"json pet\", \"photoUrls\": null}") + end + end + end + describe "test attribute 'id'" do it "should work" do # assertion here. ref: https://crystal-lang.org/reference/guides/testing.html diff --git a/samples/client/petstore/crystal/spec/models/tag_spec.cr b/samples/client/petstore/crystal/spec/models/tag_spec.cr index f79e12657fc..64a05f292ce 100644 --- a/samples/client/petstore/crystal/spec/models/tag_spec.cr +++ b/samples/client/petstore/crystal/spec/models/tag_spec.cr @@ -23,6 +23,21 @@ describe Petstore::Tag do #expect(instance).to be_instance_of(Petstore::Tag) end end + + describe "test equality of Tag instances" do + it "should equal to itself" do + tag1 = Petstore::Tag.new(id: 0, name: "same") + tag2 = tag1 + (tag1 == tag2).should be_true + end + + it "should equal to another instance with same attributes" do + tag1 = Petstore::Tag.new(id: 0, name: "tag") + tag2 = Petstore::Tag.new(id: 0, name: "tag") + (tag1 == tag2).should be_true + end + end + describe "test attribute 'id'" do it "should work" do # assertion here. ref: https://crystal-lang.org/reference/guides/testing.html diff --git a/samples/client/petstore/crystal/spec/spec_helper.cr b/samples/client/petstore/crystal/spec/spec_helper.cr index c6eb4e7a603..7349161df1e 100644 --- a/samples/client/petstore/crystal/spec/spec_helper.cr +++ b/samples/client/petstore/crystal/spec/spec_helper.cr @@ -11,4 +11,12 @@ # load modules require "spec" require "json" -require "../src/petstore" \ No newline at end of file +require "../src/petstore" + +def assert_compilation_error(path : String, message : String) : Nil + buffer = IO::Memory.new + result = Process.run("crystal", ["run", "--no-color", "--no-codegen", path], error: buffer) + result.success?.should be_false + buffer.to_s.should contain message + buffer.close +end diff --git a/samples/client/petstore/crystal/src/petstore/models/api_response.cr b/samples/client/petstore/crystal/src/petstore/models/api_response.cr index be551134907..7a0719b6615 100644 --- a/samples/client/petstore/crystal/src/petstore/models/api_response.cr +++ b/samples/client/petstore/crystal/src/petstore/models/api_response.cr @@ -16,14 +16,15 @@ module Petstore class ApiResponse include JSON::Serializable - @[JSON::Field(key: "code", type: Int32)] - property code : Int32 + # Optional properties + @[JSON::Field(key: "code", type: Int32?, nillable: true, emit_null: false)] + property code : Int32? - @[JSON::Field(key: "type", type: String)] - property _type : String + @[JSON::Field(key: "type", type: String?, nillable: true, emit_null: false)] + property _type : String? - @[JSON::Field(key: "message", type: String)] - property message : String + @[JSON::Field(key: "message", type: String?, nillable: true, emit_null: false)] + property message : String? # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -46,7 +47,7 @@ module Petstore # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class && code == o.code && _type == o._type && diff --git a/samples/client/petstore/crystal/src/petstore/models/category.cr b/samples/client/petstore/crystal/src/petstore/models/category.cr index 55c64154d97..65dd3f8cdd0 100644 --- a/samples/client/petstore/crystal/src/petstore/models/category.cr +++ b/samples/client/petstore/crystal/src/petstore/models/category.cr @@ -16,11 +16,12 @@ module Petstore class Category include JSON::Serializable - @[JSON::Field(key: "id", type: Int64)] - property id : Int64 + # Optional properties + @[JSON::Field(key: "id", type: Int64?, nillable: true, emit_null: false)] + property id : Int64? - @[JSON::Field(key: "name", type: String)] - property name : String + @[JSON::Field(key: "name", type: String?, nillable: true, emit_null: false)] + property name : String? # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -60,7 +61,7 @@ module Petstore # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class && id == o.id && name == o.name diff --git a/samples/client/petstore/crystal/src/petstore/models/order.cr b/samples/client/petstore/crystal/src/petstore/models/order.cr index 5d00ea6688f..0536a0c3de6 100644 --- a/samples/client/petstore/crystal/src/petstore/models/order.cr +++ b/samples/client/petstore/crystal/src/petstore/models/order.cr @@ -16,24 +16,25 @@ module Petstore class Order include JSON::Serializable - @[JSON::Field(key: "id", type: Int64)] - property id : Int64 + # Optional properties + @[JSON::Field(key: "id", type: Int64?, nillable: true, emit_null: false)] + property id : Int64? - @[JSON::Field(key: "petId", type: Int64)] - property pet_id : Int64 + @[JSON::Field(key: "petId", type: Int64?, nillable: true, emit_null: false)] + property pet_id : Int64? - @[JSON::Field(key: "quantity", type: Int32)] - property quantity : Int32 + @[JSON::Field(key: "quantity", type: Int32?, nillable: true, emit_null: false)] + property quantity : Int32? - @[JSON::Field(key: "shipDate", type: Time)] - property ship_date : Time + @[JSON::Field(key: "shipDate", type: Time?, nillable: true, emit_null: false)] + property ship_date : Time? # Order Status - @[JSON::Field(key: "status", type: String)] - property status : String + @[JSON::Field(key: "status", type: String?, nillable: true, emit_null: false)] + property status : String? - @[JSON::Field(key: "complete", type: Bool, default: false)] - property complete : Bool + @[JSON::Field(key: "complete", type: Bool?, default: false, nillable: true, emit_null: false)] + property complete : Bool? class EnumAttributeValidator getter datatype : String @@ -91,7 +92,7 @@ module Petstore # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class && id == o.id && pet_id == o.pet_id && diff --git a/samples/client/petstore/crystal/src/petstore/models/pet.cr b/samples/client/petstore/crystal/src/petstore/models/pet.cr index cdac65776d7..8edf5789c9a 100644 --- a/samples/client/petstore/crystal/src/petstore/models/pet.cr +++ b/samples/client/petstore/crystal/src/petstore/models/pet.cr @@ -16,24 +16,26 @@ module Petstore class Pet include JSON::Serializable - @[JSON::Field(key: "id", type: Int64)] - property id : Int64 - - @[JSON::Field(key: "category", type: Category)] - property category : Category - - @[JSON::Field(key: "name", type: String)] + # Required properties + @[JSON::Field(key: "name", type: String, nillable: false, emit_null: false)] property name : String - @[JSON::Field(key: "photoUrls", type: Array(String))] + @[JSON::Field(key: "photoUrls", type: Array(String), nillable: false, emit_null: false)] property photo_urls : Array(String) - @[JSON::Field(key: "tags", type: Array(Tag))] - property tags : Array(Tag) + # Optional properties + @[JSON::Field(key: "id", type: Int64?, nillable: true, emit_null: false)] + property id : Int64? + + @[JSON::Field(key: "category", type: Category?, nillable: true, emit_null: false)] + property category : Category? + + @[JSON::Field(key: "tags", type: Array(Tag)?, nillable: true, emit_null: false)] + property tags : Array(Tag)? # pet status in the store - @[JSON::Field(key: "status", type: String)] - property status : String + @[JSON::Field(key: "status", type: String?, nillable: true, emit_null: false)] + property status : String? class EnumAttributeValidator getter datatype : String @@ -60,29 +62,19 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash - def initialize(@id : Int64?, @category : Category?, @name : String, @photo_urls : Array(String), @tags : Array(Tag)?, @status : String?) + def initialize(@name : String, @photo_urls : Array(String), @id : Int64?, @category : Category?, @tags : Array(Tag)?, @status : String?) 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(String).new - if @name.nil? - invalid_properties.push("invalid value for \"name\", name cannot be nil.") - end - - if @photo_urls.nil? - invalid_properties.push("invalid value for \"photo_urls\", photo_urls 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 @name.nil? - return false if @photo_urls.nil? status_validator = EnumAttributeValidator.new("String", ["available", "pending", "sold"]) return false unless status_validator.valid?(@status) true @@ -101,7 +93,7 @@ module Petstore # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class && id == o.id && category == o.category && diff --git a/samples/client/petstore/crystal/src/petstore/models/tag.cr b/samples/client/petstore/crystal/src/petstore/models/tag.cr index bd293329185..cd5e7ed2989 100644 --- a/samples/client/petstore/crystal/src/petstore/models/tag.cr +++ b/samples/client/petstore/crystal/src/petstore/models/tag.cr @@ -16,11 +16,12 @@ module Petstore class Tag include JSON::Serializable - @[JSON::Field(key: "id", type: Int64)] - property id : Int64 + # Optional properties + @[JSON::Field(key: "id", type: Int64?, nillable: true, emit_null: false)] + property id : Int64? - @[JSON::Field(key: "name", type: String)] - property name : String + @[JSON::Field(key: "name", type: String?, nillable: true, emit_null: false)] + property name : String? # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -43,7 +44,7 @@ module Petstore # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class && id == o.id && name == o.name diff --git a/samples/client/petstore/crystal/src/petstore/models/user.cr b/samples/client/petstore/crystal/src/petstore/models/user.cr index 47430b4452a..a80b2574d2c 100644 --- a/samples/client/petstore/crystal/src/petstore/models/user.cr +++ b/samples/client/petstore/crystal/src/petstore/models/user.cr @@ -16,30 +16,31 @@ module Petstore class User include JSON::Serializable - @[JSON::Field(key: "id", type: Int64)] - property id : Int64 + # Optional properties + @[JSON::Field(key: "id", type: Int64?, nillable: true, emit_null: false)] + property id : Int64? - @[JSON::Field(key: "username", type: String)] - property username : String + @[JSON::Field(key: "username", type: String?, nillable: true, emit_null: false)] + property username : String? - @[JSON::Field(key: "firstName", type: String)] - property first_name : String + @[JSON::Field(key: "firstName", type: String?, nillable: true, emit_null: false)] + property first_name : String? - @[JSON::Field(key: "lastName", type: String)] - property last_name : String + @[JSON::Field(key: "lastName", type: String?, nillable: true, emit_null: false)] + property last_name : String? - @[JSON::Field(key: "email", type: String)] - property email : String + @[JSON::Field(key: "email", type: String?, nillable: true, emit_null: false)] + property email : String? - @[JSON::Field(key: "password", type: String)] - property password : String + @[JSON::Field(key: "password", type: String?, nillable: true, emit_null: false)] + property password : String? - @[JSON::Field(key: "phone", type: String)] - property phone : String + @[JSON::Field(key: "phone", type: String?, nillable: true, emit_null: false)] + property phone : String? # User Status - @[JSON::Field(key: "userStatus", type: Int32)] - property user_status : Int32 + @[JSON::Field(key: "userStatus", type: Int32?, nillable: true, emit_null: false)] + property user_status : Int32? # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -62,7 +63,7 @@ module Petstore # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) - return true if self.equal?(o) + return true if self.same?(o) self.class == o.class && id == o.id && username == o.username && From d8f70b33908b80750dd58018f38561e01383aae4 Mon Sep 17 00:00:00 2001 From: Chao Yang Date: Fri, 28 Jan 2022 21:02:50 -0600 Subject: [PATCH 106/113] Fix crystal code gen null pointer exception error (#11437) Checks if codegenParameter.items is null in constructExampleCode --- .../codegen/languages/CrystalClientCodegen.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index d4c83e5d5f0..19fa27e7acf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -595,8 +595,14 @@ public class CrystalClientCodegen extends DefaultCodegen { private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, HashMap processedModelMap) { if (codegenParameter.isArray) { // array + if (codegenParameter.items == null) { + return "[]"; + } return "[" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + "]"; } else if (codegenParameter.isMap) { + if (codegenParameter.items == null) { + return "{}"; + } return "{ key: " + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + "}"; } else if (codegenParameter.isPrimitiveType) { // primitive type if (codegenParameter.isEnum) { From b901f11e85a01e8ce1a83e531e57ecffe855c936 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 29 Jan 2022 14:01:27 +0800 Subject: [PATCH 107/113] use encode_path instead in crystal (#11439) --- README.md | 1 + .../src/main/resources/crystal/api.mustache | 2 +- .../client/petstore/crystal/src/petstore/api/pet_api.cr | 8 ++++---- .../client/petstore/crystal/src/petstore/api/store_api.cr | 4 ++-- .../client/petstore/crystal/src/petstore/api/user_api.cr | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6a23fc7554a..52ce37403e8 100644 --- a/README.md +++ b/README.md @@ -1052,6 +1052,7 @@ If you want to join the committee, please kindly apply by sending an email to te | C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) | | C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) | | Clojure | | +| Crystal | @cyangle (2021/01) | | Dart | @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08) | | Eiffel | @jvelilla (2017/09) | | Elixir | @mrmstn (2018/12) | diff --git a/modules/openapi-generator/src/main/resources/crystal/api.mustache b/modules/openapi-generator/src/main/resources/crystal/api.mustache index 28758d68a5f..c39d99bf0fe 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api.mustache @@ -125,7 +125,7 @@ module {{moduleName}} {{/hasValidation}} {{/allParams}} # resource path - local_var_path = "{{{path}}}"{{#pathParams}}.sub("{" + "{{baseName}}" + "}", URI.encode({{paramName}}.to_s){{^strictSpecBehavior}}.gsub("%2F", "/"){{/strictSpecBehavior}}){{/pathParams}} + local_var_path = "{{{path}}}"{{#pathParams}}.sub("{" + "{{baseName}}" + "}", URI.encode_path({{paramName}}.to_s){{^strictSpecBehavior}}.gsub("%2F", "/"){{/strictSpecBehavior}}){{/pathParams}} # query parameters query_params = Hash(String, String).new diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index a808853db0c..e4c825e6795 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -96,7 +96,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.delete_pet") end # resource path - local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/")) + local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new @@ -274,7 +274,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id") end # resource path - local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/")) + local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new @@ -390,7 +390,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form") end # resource path - local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/")) + local_var_path = "/pet/{petId}".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new @@ -449,7 +449,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'pet_id' when calling PetApi.upload_file") end # resource path - local_var_path = "/pet/{petId}/uploadImage".sub("{" + "petId" + "}", URI.encode(pet_id.to_s).gsub("%2F", "/")) + local_var_path = "/pet/{petId}/uploadImage".sub("{" + "petId" + "}", URI.encode_path(pet_id.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index 633b3ca71fd..c653a8714a3 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -39,7 +39,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'order_id' when calling StoreApi.delete_order") end # resource path - local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode(order_id.to_s).gsub("%2F", "/")) + local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode_path(order_id.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new @@ -157,7 +157,7 @@ module Petstore end # resource path - local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode(order_id.to_s).gsub("%2F", "/")) + local_var_path = "/store/order/{orderId}".sub("{" + "orderId" + "}", URI.encode_path(order_id.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index 9809fc615e8..e40ed161172 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -212,7 +212,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'username' when calling UserApi.delete_user") end # resource path - local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode(username.to_s).gsub("%2F", "/")) + local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode_path(username.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new @@ -267,7 +267,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'username' when calling UserApi.get_user_by_name") end # resource path - local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode(username.to_s).gsub("%2F", "/")) + local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode_path(username.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new @@ -451,7 +451,7 @@ module Petstore raise ArgumentError.new("Missing the required parameter 'user' when calling UserApi.update_user") end # resource path - local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode(username.to_s).gsub("%2F", "/")) + local_var_path = "/user/{username}".sub("{" + "username" + "}", URI.encode_path(username.to_s).gsub("%2F", "/")) # query parameters query_params = Hash(String, String).new From 088c65c9c6a6ddf2192f7b1fcb095945f39b68d5 Mon Sep 17 00:00:00 2001 From: y-tomida Date: Sat, 29 Jan 2022 16:07:30 +0900 Subject: [PATCH 108/113] [typescript-axios] Add stringEnums option (#11368) * add stringEnums option * update templates * add export * update samples * update document * improve readability * remove unnecessary code * add config file for sample * add sample * update sample * remove enum variable form modelObjetEnum template because this variable is not used in modelStringEnum template. * change the indentation to be the same as modelGeneric template --- .../typescript-axios-with-string-enums.yaml | 6 + docs/generators/typescript-axios.md | 1 + .../TypeScriptAxiosClientCodegen.java | 9 + .../typescript-axios/modelEnum.mustache | 18 +- .../typescript-axios/modelGeneric.mustache | 18 + .../typescript-axios/modelObjectEnum.mustache | 14 + .../typescript-axios/modelStringEnum.mustache | 12 + .../builds/composed-schemas/api.ts | 50 +- .../typescript-axios/builds/default/api.ts | 32 +- .../typescript-axios/builds/es6-target/api.ts | 32 +- .../builds/test-petstore/api.ts | 253 ++- .../builds/with-complex-headers/api.ts | 32 +- .../api.ts | 215 +- .../builds/with-interfaces/api.ts | 32 +- .../builds/with-node-imports/api.ts | 32 +- .../model/some/levels/deep/order.ts | 16 +- .../model/some/levels/deep/pet.ts | 16 +- .../builds/with-npm-version/api.ts | 32 +- .../with-single-request-parameters/api.ts | 32 +- .../builds/with-string-enums/.gitignore | 4 + .../builds/with-string-enums/.npmignore | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 8 + .../.openapi-generator/VERSION | 1 + .../builds/with-string-enums/api.ts | 1816 +++++++++++++++++ .../builds/with-string-enums/base.ts | 71 + .../builds/with-string-enums/common.ts | 138 ++ .../builds/with-string-enums/configuration.ts | 101 + .../builds/with-string-enums/git_push.sh | 57 + .../builds/with-string-enums/index.ts | 18 + 30 files changed, 2664 insertions(+), 426 deletions(-) create mode 100644 bin/configs/typescript-axios-with-string-enums.yaml create mode 100644 modules/openapi-generator/src/main/resources/typescript-axios/modelObjectEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/typescript-axios/modelStringEnum.mustache create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/.gitignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/.npmignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/base.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh create mode 100644 samples/client/petstore/typescript-axios/builds/with-string-enums/index.ts diff --git a/bin/configs/typescript-axios-with-string-enums.yaml b/bin/configs/typescript-axios-with-string-enums.yaml new file mode 100644 index 00000000000..4ea5a08e30d --- /dev/null +++ b/bin/configs/typescript-axios-with-string-enums.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-string-enums +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-axios +additionalProperties: + stringEnums: true diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 0bbf056acc1..a205ff3f799 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|stringEnums|Generate string enums instead of objects for enum values.| |false| |supportsES6|Generate code that conforms to ES6.| |false| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 539313d513c..d76292d4741 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -34,8 +34,11 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege public static final String WITHOUT_PREFIX_ENUMS = "withoutPrefixEnums"; public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; public static final String WITH_NODE_IMPORTS = "withNodeImports"; + public static final String STRING_ENUMS = "stringEnums"; + public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; protected String npmRepository = null; + protected Boolean stringEnums = false; private String tsModelPackage = ""; @@ -57,6 +60,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege this.cliOptions.add(new CliOption(WITHOUT_PREFIX_ENUMS, "Don't prefix enum names with class names", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITH_NODE_IMPORTS, "Setting this property to true adds imports for NodeJS", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC).defaultValue(String.valueOf(this.stringEnums))); // Templates have no mapping between formatted property names and original base names so use only "original" and remove this option removeOption(CodegenConstants.MODEL_PROPERTY_NAMING); } @@ -127,6 +131,11 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege } } + if (additionalProperties.containsKey(STRING_ENUMS)) { + this.stringEnums = Boolean.parseBoolean(additionalProperties.get(STRING_ENUMS).toString()); + additionalProperties.put("stringEnums", this.stringEnums); + } + if (additionalProperties.containsKey(NPM_NAME)) { addNpmPackageGeneration(); } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/modelEnum.mustache index 5f1a5f44b6a..e18f5c09859 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/modelEnum.mustache @@ -8,16 +8,10 @@ export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last {{/isBoolean}} {{^isBoolean}} -export enum {{classname}} { -{{#allowableValues}} -{{#enumVars}} - {{#enumDescription}} - /** - * {{.}} - */ - {{/enumDescription}} - {{{name}}} = {{{value}}}{{^-last}},{{/-last}} -{{/enumVars}} -{{/allowableValues}} -} +{{^stringEnums}} +{{>modelObjectEnum}} +{{/stringEnums}} +{{#stringEnums}} +{{>modelStringEnum}} +{{/stringEnums}} {{/isBoolean}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache index b64c34e2cc9..06da8db77a6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache @@ -23,6 +23,7 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ {{#vars}} {{#isEnum}} +{{#stringEnums}} /** * @export * @enum {string} @@ -39,6 +40,23 @@ export enum {{enumName}} { {{/enumVars}} {{/allowableValues}} } +{{/stringEnums}} +{{^stringEnums}} +export const {{enumName}} = { +{{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{{name}}}: {{{value}}}{{^-last}},{{/-last}} + {{/enumVars}} +{{/allowableValues}} +} as const; + +export type {{enumName}} = typeof {{enumName}}[keyof typeof {{enumName}}]; +{{/stringEnums}} {{/isEnum}} {{/vars}} {{/hasEnums}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/modelObjectEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/modelObjectEnum.mustache new file mode 100644 index 00000000000..ce2c8208f37 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-axios/modelObjectEnum.mustache @@ -0,0 +1,14 @@ +export const {{classname}} = { +{{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{{name}}}: {{{value}}}{{^-last}},{{/-last}} + {{/enumVars}} +{{/allowableValues}} +} as const; + +export type {{classname}} = typeof {{classname}}[keyof typeof {{classname}}]; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/modelStringEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/modelStringEnum.mustache new file mode 100644 index 00000000000..c2886f750f5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-axios/modelStringEnum.mustache @@ -0,0 +1,12 @@ +export enum {{classname}} { +{{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{{name}}} = {{{value}}}{{^-last}},{{/-last}} + {{/enumVars}} +{{/allowableValues}} +} diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts index 13c92e708ca..e6572b57346 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts @@ -79,16 +79,14 @@ export interface Dog { 'breed'?: DogBreedEnum; } -/** - * @export - * @enum {string} - */ -export enum DogBreedEnum { - Dingo = 'Dingo', - Husky = 'Husky', - Retriever = 'Retriever', - Shepherd = 'Shepherd' -} +export const DogBreedEnum = { + Dingo: 'Dingo', + Husky: 'Husky', + Retriever: 'Retriever', + Shepherd: 'Shepherd' +} as const; + +export type DogBreedEnum = typeof DogBreedEnum[keyof typeof DogBreedEnum]; /** * @@ -110,16 +108,14 @@ export interface DogAllOf { 'breed'?: DogAllOfBreedEnum; } -/** - * @export - * @enum {string} - */ -export enum DogAllOfBreedEnum { - Dingo = 'Dingo', - Husky = 'Husky', - Retriever = 'Retriever', - Shepherd = 'Shepherd' -} +export const DogAllOfBreedEnum = { + Dingo: 'Dingo', + Husky: 'Husky', + Retriever: 'Retriever', + Shepherd: 'Shepherd' +} as const; + +export type DogAllOfBreedEnum = typeof DogAllOfBreedEnum[keyof typeof DogAllOfBreedEnum]; /** * @@ -173,14 +169,12 @@ export interface PetByType { 'hunts'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum PetByTypePetTypeEnum { - Cat = 'Cat', - Dog = 'Dog' -} +export const PetByTypePetTypeEnum = { + Cat: 'Cat', + Dog: 'Dog' +} as const; + +export type PetByTypePetTypeEnum = typeof PetByTypePetTypeEnum[keyof typeof PetByTypePetTypeEnum]; /** diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index fd8ae456d7a..893802cbed3 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -109,15 +109,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -163,15 +161,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index fd8ae456d7a..893802cbed3 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -109,15 +109,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -163,15 +161,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts index 3d2a576b59c..7d715d7ea75 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts @@ -362,13 +362,11 @@ export interface ChildCat extends ParentPet { 'pet_type': ChildCatPetTypeEnum; } -/** - * @export - * @enum {string} - */ -export enum ChildCatPetTypeEnum { - ChildCat = 'ChildCat' -} +export const ChildCatPetTypeEnum = { + ChildCat: 'ChildCat' +} as const; + +export type ChildCatPetTypeEnum = typeof ChildCatPetTypeEnum[keyof typeof ChildCatPetTypeEnum]; /** * @@ -390,13 +388,11 @@ export interface ChildCatAllOf { 'pet_type'?: ChildCatAllOfPetTypeEnum; } -/** - * @export - * @enum {string} - */ -export enum ChildCatAllOfPetTypeEnum { - ChildCat = 'ChildCat' -} +export const ChildCatAllOfPetTypeEnum = { + ChildCat: 'ChildCat' +} as const; + +export type ChildCatAllOfPetTypeEnum = typeof ChildCatAllOfPetTypeEnum[keyof typeof ChildCatAllOfPetTypeEnum]; /** * Model for testing model with \"_class\" property @@ -548,22 +544,18 @@ export interface EnumArrays { 'array_enum'?: Array; } -/** - * @export - * @enum {string} - */ -export enum EnumArraysJustSymbolEnum { - GreaterThanOrEqualTo = '>=', - Dollar = '$' -} -/** - * @export - * @enum {string} - */ -export enum EnumArraysArrayEnumEnum { - Fish = 'fish', - Crab = 'crab' -} +export const EnumArraysJustSymbolEnum = { + GreaterThanOrEqualTo: '>=', + Dollar: '$' +} as const; + +export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum]; +export const EnumArraysArrayEnumEnum = { + Fish: 'fish', + Crab: 'crab' +} as const; + +export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum]; /** * @@ -571,11 +563,14 @@ export enum EnumArraysArrayEnumEnum { * @enum {string} */ -export enum EnumClass { - Abc = '_abc', - Efg = '-efg', - Xyz = '(xyz)' -} +export const EnumClass = { + Abc: '_abc', + Efg: '-efg', + Xyz: '(xyz)' +} as const; + +export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; + /** * @@ -639,48 +634,38 @@ export interface EnumTest { 'outerEnumIntegerDefaultValue'?: OuterEnumIntegerDefaultValue; } -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumStringEnum { - Upper = 'UPPER', - Lower = 'lower', - Empty = '' -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumStringRequiredEnum { - Upper = 'UPPER', - Lower = 'lower', - Empty = '' -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumIntegerEnum { - NUMBER_1 = 1, - NUMBER_MINUS_1 = -1 -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumIntegerOnlyEnum { - NUMBER_2 = 2, - NUMBER_MINUS_2 = -2 -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumNumberEnum { - NUMBER_1_DOT_1 = 1.1, - NUMBER_MINUS_1_DOT_2 = -1.2 -} +export const EnumTestEnumStringEnum = { + Upper: 'UPPER', + Lower: 'lower', + Empty: '' +} as const; + +export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum]; +export const EnumTestEnumStringRequiredEnum = { + Upper: 'UPPER', + Lower: 'lower', + Empty: '' +} as const; + +export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum]; +export const EnumTestEnumIntegerEnum = { + NUMBER_1: 1, + NUMBER_MINUS_1: -1 +} as const; + +export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum]; +export const EnumTestEnumIntegerOnlyEnum = { + NUMBER_2: 2, + NUMBER_MINUS_2: -2 +} as const; + +export type EnumTestEnumIntegerOnlyEnum = typeof EnumTestEnumIntegerOnlyEnum[keyof typeof EnumTestEnumIntegerOnlyEnum]; +export const EnumTestEnumNumberEnum = { + NUMBER_1_DOT_1: 1.1, + NUMBER_MINUS_1_DOT_2: -1.2 +} as const; + +export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum]; /** * @@ -1007,14 +992,12 @@ export interface MapTest { 'indirect_map'?: { [key: string]: boolean; }; } -/** - * @export - * @enum {string} - */ -export enum MapTestMapOfEnumStringEnum { - Upper = 'UPPER', - Lower = 'lower' -} +export const MapTestMapOfEnumStringEnum = { + Upper: 'UPPER', + Lower: 'lower' +} as const; + +export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum]; /** * @@ -1283,15 +1266,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * @@ -1324,11 +1305,14 @@ export interface OuterComposite { * @enum {string} */ -export enum OuterEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OuterEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; + /** * @@ -1336,11 +1320,14 @@ export enum OuterEnum { * @enum {string} */ -export enum OuterEnumDefaultValue { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OuterEnumDefaultValue = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue]; + /** * @@ -1348,11 +1335,14 @@ export enum OuterEnumDefaultValue { * @enum {string} */ -export enum OuterEnumInteger { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} +export const OuterEnumInteger = { + NUMBER_0: 0, + NUMBER_1: 1, + NUMBER_2: 2 +} as const; + +export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger]; + /** * @@ -1360,11 +1350,14 @@ export enum OuterEnumInteger { * @enum {string} */ -export enum OuterEnumIntegerDefaultValue { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} +export const OuterEnumIntegerDefaultValue = { + NUMBER_0: 0, + NUMBER_1: 1, + NUMBER_2: 2 +} as const; + +export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue]; + /** * @@ -1417,15 +1410,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * @type Pig @@ -1731,15 +1722,13 @@ export interface Zebra { 'className': string; } -/** - * @export - * @enum {string} - */ -export enum ZebraTypeEnum { - Plains = 'plains', - Mountain = 'mountain', - Grevys = 'grevys' -} +export const ZebraTypeEnum = { + Plains: 'plains', + Mountain: 'mountain', + Grevys: 'grevys' +} as const; + +export type ZebraTypeEnum = typeof ZebraTypeEnum[keyof typeof ZebraTypeEnum]; /** diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 4966ecd507d..8c7d0abac4a 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -109,15 +109,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -163,15 +161,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts index 5ef2fa3cbbf..62742e15f67 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts @@ -361,22 +361,18 @@ export interface EnumArrays { 'array_enum'?: Array; } -/** - * @export - * @enum {string} - */ -export enum EnumArraysJustSymbolEnum { - GreaterThanOrEqualTo = '>=', - Dollar = '$' -} -/** - * @export - * @enum {string} - */ -export enum EnumArraysArrayEnumEnum { - Fish = 'fish', - Crab = 'crab' -} +export const EnumArraysJustSymbolEnum = { + GreaterThanOrEqualTo: '>=', + Dollar: '$' +} as const; + +export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum]; +export const EnumArraysArrayEnumEnum = { + Fish: 'fish', + Crab: 'crab' +} as const; + +export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum]; /** * @@ -384,11 +380,14 @@ export enum EnumArraysArrayEnumEnum { * @enum {string} */ -export enum EnumClass { - Abc = '_abc', - Efg = '-efg', - Xyz = '(xyz)' -} +export const EnumClass = { + Abc: '_abc', + Efg: '-efg', + Xyz: '(xyz)' +} as const; + +export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; + /** * @@ -446,40 +445,32 @@ export interface EnumTest { 'outerEnumIntegerDefaultValue'?: OuterEnumIntegerDefaultValue; } -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumStringEnum { - Upper = 'UPPER', - Lower = 'lower', - Empty = '' -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumStringRequiredEnum { - Upper = 'UPPER', - Lower = 'lower', - Empty = '' -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumIntegerEnum { - NUMBER_1 = 1, - NUMBER_MINUS_1 = -1 -} -/** - * @export - * @enum {string} - */ -export enum EnumTestEnumNumberEnum { - NUMBER_1_DOT_1 = 1.1, - NUMBER_MINUS_1_DOT_2 = -1.2 -} +export const EnumTestEnumStringEnum = { + Upper: 'UPPER', + Lower: 'lower', + Empty: '' +} as const; + +export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum]; +export const EnumTestEnumStringRequiredEnum = { + Upper: 'UPPER', + Lower: 'lower', + Empty: '' +} as const; + +export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum]; +export const EnumTestEnumIntegerEnum = { + NUMBER_1: 1, + NUMBER_MINUS_1: -1 +} as const; + +export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum]; +export const EnumTestEnumNumberEnum = { + NUMBER_1_DOT_1: 1.1, + NUMBER_MINUS_1_DOT_2: -1.2 +} as const; + +export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum]; /** * @@ -743,14 +734,12 @@ export interface MapTest { 'indirect_map'?: { [key: string]: boolean; }; } -/** - * @export - * @enum {string} - */ -export enum MapTestMapOfEnumStringEnum { - Upper = 'UPPER', - Lower = 'lower' -} +export const MapTestMapOfEnumStringEnum = { + Upper: 'UPPER', + Lower: 'lower' +} as const; + +export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum]; /** * @@ -978,15 +967,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * @@ -1019,11 +1006,14 @@ export interface OuterComposite { * @enum {string} */ -export enum OuterEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OuterEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; + /** * @@ -1031,11 +1021,14 @@ export enum OuterEnum { * @enum {string} */ -export enum OuterEnumDefaultValue { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OuterEnumDefaultValue = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue]; + /** * @@ -1043,11 +1036,14 @@ export enum OuterEnumDefaultValue { * @enum {string} */ -export enum OuterEnumInteger { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} +export const OuterEnumInteger = { + NUMBER_0: 0, + NUMBER_1: 1, + NUMBER_2: 2 +} as const; + +export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger]; + /** * @@ -1055,11 +1051,14 @@ export enum OuterEnumInteger { * @enum {string} */ -export enum OuterEnumIntegerDefaultValue { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} +export const OuterEnumIntegerDefaultValue = { + NUMBER_0: 0, + NUMBER_1: 1, + NUMBER_2: 2 +} as const; + +export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue]; + /** * @@ -1106,15 +1105,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * @@ -1353,15 +1350,13 @@ export interface Zebra { 'className': string; } -/** - * @export - * @enum {string} - */ -export enum ZebraTypeEnum { - Plains = 'plains', - Mountain = 'mountain', - Grevys = 'grevys' -} +export const ZebraTypeEnum = { + Plains: 'plains', + Mountain: 'mountain', + Grevys: 'grevys' +} as const; + +export type ZebraTypeEnum = typeof ZebraTypeEnum[keyof typeof ZebraTypeEnum]; /** diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 986bfee5787..d808b5aa937 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -109,15 +109,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -163,15 +161,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts index 81a0a296245..0cfec1ad4b3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts @@ -113,15 +113,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -167,15 +165,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts index b2ad43c3e40..1ed788e1ec8 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts @@ -58,14 +58,12 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts index 14d646fe149..e32493df735 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts @@ -60,14 +60,12 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index fd8ae456d7a..893802cbed3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -109,15 +109,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -163,15 +161,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts index 3afadf82f36..5a06a70cb99 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -109,15 +109,13 @@ export interface Order { 'complete'?: boolean; } -/** - * @export - * @enum {string} - */ -export enum OrderStatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' -} +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; + +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; /** * A pet for sale in the pet store @@ -163,15 +161,13 @@ export interface Pet { 'status'?: PetStatusEnum; } -/** - * @export - * @enum {string} - */ -export enum PetStatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' -} +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; + +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * A tag for a pet diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/.gitignore b/samples/client/petstore/typescript-axios/builds/with-string-enums/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/.npmignore b/samples/client/petstore/typescript-axios/builds/with-string-enums/.npmignore new file mode 100644 index 00000000000..999d88df693 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator-ignore b/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/.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/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/FILES new file mode 100644 index 00000000000..a80cd4f07b0 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/FILES @@ -0,0 +1,8 @@ +.gitignore +.npmignore +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/VERSION new file mode 100644 index 00000000000..0984c4c1ad2 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts new file mode 100644 index 00000000000..fd8ae456d7a --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts @@ -0,0 +1,1816 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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. + */ + + +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + 'code'?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + 'type'?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + 'message'?: string; +} +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof Category + */ + 'name'?: string; +} +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + 'id'?: number; + /** + * + * @type {number} + * @memberof Order + */ + 'petId'?: number; + /** + * + * @type {number} + * @memberof Order + */ + 'quantity'?: number; + /** + * + * @type {string} + * @memberof Order + */ + 'shipDate'?: string; + /** + * Order Status + * @type {string} + * @memberof Order + */ + 'status'?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + 'complete'?: boolean; +} + +/** + * @export + * @enum {string} + */ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + 'id'?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + 'category'?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + 'name': string; + /** + * + * @type {Array} + * @memberof Pet + */ + 'photoUrls': Array; + /** + * + * @type {Array} + * @memberof Pet + */ + 'tags'?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + 'status'?: PetStatusEnum; +} + +/** + * @export + * @enum {string} + */ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof Tag + */ + 'name'?: string; +} +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof User + */ + 'username'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'firstName'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'lastName'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'email'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'password'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'phone'?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + 'userStatus'?: number; +} + +/** + * PetApi - axios parameter creator + * @export + */ +export const PetApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet: async (body: Pet, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('addPet', 'body', body) + const localVarPath = `/pet`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet: async (petId: number, apiKey?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('deletePet', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'status' is not null or undefined + assertParamExists('findPetsByStatus', 'status', status) + const localVarPath = `/pet/findByStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + findPetsByTags: async (tags: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'tags' is not null or undefined + assertParamExists('findPetsByTags', 'tags', tags) + const localVarPath = `/pet/findByTags`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById: async (petId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('getPetById', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet: async (body: Pet, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('updatePet', 'body', body) + const localVarPath = `/pet`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm: async (petId: number, name?: string, status?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('updatePetWithForm', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new URLSearchParams(); + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + if (name !== undefined) { + localVarFormParams.set('name', name as any); + } + + if (status !== undefined) { + localVarFormParams.set('status', status as any); + } + + + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams.toString(); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('uploadFile', 'petId', petId) + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + if (additionalMetadata !== undefined) { + localVarFormParams.append('additionalMetadata', additionalMetadata as any); + } + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PetApi - functional programming interface + * @export + */ +export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addPet(body: Pet, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + async findPetsByTags(tags: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPetById(petId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePet(body: Pet, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * PetApi - factory interface + * @export + */ +export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): AxiosPromise { + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): AxiosPromise> { + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): AxiosPromise { + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): AxiosPromise { + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(body: Pet, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).addPet(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).deletePet(petId, apiKey, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).findPetsByStatus(status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(tags: Array, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).findPetsByTags(tags, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(petId: number, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).getPetById(petId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(body: Pet, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).updatePet(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).updatePetWithForm(petId, name, status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * StoreApi - axios parameter creator + * @export + */ +export const StoreApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder: async (orderId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + assertParamExists('deleteOrder', 'orderId', orderId) + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/store/inventory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById: async (orderId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + assertParamExists('getOrderById', 'orderId', orderId) + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder: async (body: Order, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('placeOrder', 'body', body) + const localVarPath = `/store/order`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * StoreApi - functional programming interface + * @export + */ +export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrder(orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInventory(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrderById(orderId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async placeOrder(body: Order, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * StoreApi - factory interface + * @export + */ +export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): AxiosPromise { + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): AxiosPromise { + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any): AxiosPromise { + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(orderId: string, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).deleteOrder(orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).getInventory(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(orderId: number, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).getOrderById(orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(body: Order, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser: async (body: User, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUser', 'body', body) + const localVarPath = `/user`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput: async (body: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUsersWithArrayInput', 'body', body) + const localVarPath = `/user/createWithArray`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput: async (body: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUsersWithListInput', 'body', body) + const localVarPath = `/user/createWithList`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser: async (username: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('deleteUser', 'username', username) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName: async (username: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('getUserByName', 'username', username) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser: async (username: string, password: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('loginUser', 'username', username) + // verify required parameter 'password' is not null or undefined + assertParamExists('loginUser', 'password', password) + const localVarPath = `/user/login`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (password !== undefined) { + localVarQueryParameter['password'] = password; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/user/logout`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser: async (username: string, body: User, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('updateUser', 'username', username) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateUser', 'body', body) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUser(body: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithArrayInput(body: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithListInput(body: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteUser(username: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getUserByName(username: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginUser(username: string, password: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async logoutUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateUser(username: string, body: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): AxiosPromise { + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): AxiosPromise { + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): AxiosPromise { + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): AxiosPromise { + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): AxiosPromise { + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): AxiosPromise { + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): AxiosPromise { + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(body: User, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUser(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(body: Array, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUsersWithArrayInput(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(body: Array, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUsersWithListInput(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(username: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).deleteUser(username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(username: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).getUserByName(username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(username: string, password: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).loginUser(username, password, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).logoutUser(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(username: string, body: User, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/base.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/base.ts new file mode 100644 index 00000000000..e23d972eeb0 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/base.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: AxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts new file mode 100644 index 00000000000..1b1d3a4b7ae --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts @@ -0,0 +1,138 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance, AxiosResponse } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + if (Array.isArray(object[key])) { + searchParams.delete(key); + for (const item of object[key]) { + searchParams.append(key, item); + } + } else { + searchParams.set(key, object[key]); + } + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts new file mode 100644 index 00000000000..b8780457121 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/git_push.sh @@ -0,0 +1,57 @@ +#!/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-petstore-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/client/petstore/typescript-axios/builds/with-string-enums/index.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/index.ts new file mode 100644 index 00000000000..ed3d348fdfe --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * 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. + */ + + +export * from "./api"; +export * from "./configuration"; + From e5bb98ce3e2f055e92279e090f0befce00ccfa54 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 29 Jan 2022 17:11:47 +0800 Subject: [PATCH 109/113] [java][spring] use Github action instead (#11441) * spring ci * update samples * remove tests in circleci * update workflow * Revert "update samples" This reverts commit 27acc8217144aeca41da2ab14c369ebba4bac7d8. * trigger build failure * Revert "trigger build failure" This reverts commit a93258468d3e2fee41a9d6c8de2e197724608f88. * remove branchs, prs --- .github/workflows/samples-spring.yaml | 59 +++++++++++++++++++++++++++ pom.xml | 21 ---------- 2 files changed, 59 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/samples-spring.yaml diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml new file mode 100644 index 00000000000..d266c358482 --- /dev/null +++ b/.github/workflows/samples-spring.yaml @@ -0,0 +1,59 @@ +name: Samples Java Spring + +on: + push: + paths: + - 'samples/server/petstore/spring*/**' + - 'samples/openapi3/server/petstore/spring*/**' + pull_request: + paths: + - 'samples/server/petstore/spring*/**' + - 'samples/openapi3/server/petstore/spring*/**' +jobs: + build: + name: Build Java Spring + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/petstore/spring-cloud + - samples/openapi3/client/petstore/spring-cloud + - samples/client/petstore/spring-cloud-date-time + - samples/openapi3/client/petstore/spring-cloud-date-time + - samples/client/petstore/spring-stubs + - samples/openapi3/client/petstore/spring-stubs + # servers + - samples/server/petstore/spring-mvc + - samples/server/petstore/spring-mvc-default-value + - samples/server/petstore/spring-mvc-j8-async + - samples/server/petstore/spring-mvc-j8-localdatetime + - samples/server/petstore/springboot + - samples/openapi3/server/petstore/springboot + - samples/server/petstore/springboot-beanvalidation + - samples/server/petstore/springboot-useoptional + - samples/openapi3/server/petstore/springboot-useoptional + - samples/server/petstore/springboot-reactive + - samples/openapi3/server/petstore/springboot-reactive + - samples/server/petstore/springboot-implicitHeaders + - samples/openapi3/server/petstore/springboot-implicitHeaders + - samples/server/petstore/springboot-delegate + - samples/openapi3/server/petstore/springboot-delegate + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 8 + - name: Cache maven dependencies + uses: actions/cache@v2.1.7 + env: + cache-name: maven-repository + with: + path: | + ~/.m2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Build + working-directory: ${{ matrix.sample }} + run: mvn clean package diff --git a/pom.xml b/pom.xml index 332c899e1ad..9618190ac09 100644 --- a/pom.xml +++ b/pom.xml @@ -1261,27 +1261,6 @@ samples/client/petstore/spring-cloud - samples/openapi3/client/petstore/spring-cloud - samples/client/petstore/spring-cloud-date-time - samples/openapi3/client/petstore/spring-cloud-date-time - samples/client/petstore/spring-stubs - samples/openapi3/client/petstore/spring-stubs - - samples/server/petstore/spring-mvc - samples/server/petstore/spring-mvc-default-value - samples/server/petstore/spring-mvc-j8-async - samples/server/petstore/spring-mvc-j8-localdatetime - samples/server/petstore/springboot - samples/openapi3/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - samples/openapi3/server/petstore/springboot-useoptional - samples/server/petstore/springboot-reactive - samples/openapi3/server/petstore/springboot-reactive - samples/server/petstore/springboot-implicitHeaders - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate - samples/openapi3/server/petstore/springboot-delegate From 35fea62b3bf4ccf7b8239e8c52369d2c668d9ada Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 30 Jan 2022 02:01:26 +0800 Subject: [PATCH 110/113] [c#][netcore] mark EOL frameworks as deprecated (#11450) * removed old frameworks from csharp-netcore * removed another reference and build samples * updated readme * deprecated frameworks * fix test csproj file * update doc Co-authored-by: devhl-labs --- README.md | 2 +- .../csharp-netcore-OpenAPIClientCore.yaml | 2 +- ...arp-netcore-OpenAPIClientCoreAndNet47.yaml | 2 +- docs/generators/aspnetcore.md | 2 +- docs/generators/csharp-netcore-functions.md | 4 ++-- docs/generators/csharp-netcore.md | 4 ++-- docs/generators/csharp.md | 2 +- .../codegen/CodegenConstants.java | 4 ++-- .../languages/CSharpNetCoreClientCodegen.java | 20 +++++++++---------- .../Org.OpenAPITools.Test.csproj | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 52ce37403e8..b66fcfa6fb9 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient, Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | +| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient, Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | | **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/), [Apache Camel](https://camel.apache.org/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | diff --git a/bin/configs/csharp-netcore-OpenAPIClientCore.yaml b/bin/configs/csharp-netcore-OpenAPIClientCore.yaml index fbc12cef7e7..81c2ed9b0f1 100644 --- a/bin/configs/csharp-netcore-OpenAPIClientCore.yaml +++ b/bin/configs/csharp-netcore-OpenAPIClientCore.yaml @@ -4,5 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-f templateDir: modules/openapi-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' - targetFramework: netcoreapp2.0 + targetFramework: netcoreapp3.1 useCompareNetObjects: "true" diff --git a/bin/configs/csharp-netcore-OpenAPIClientCoreAndNet47.yaml b/bin/configs/csharp-netcore-OpenAPIClientCoreAndNet47.yaml index 58b30f42acb..45750b9f03e 100644 --- a/bin/configs/csharp-netcore-OpenAPIClientCoreAndNet47.yaml +++ b/bin/configs/csharp-netcore-OpenAPIClientCoreAndNet47.yaml @@ -4,5 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/csharp-netcore additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' - targetFramework: netstandard2.1;netcoreapp3.0 + targetFramework: netstandard2.1;net47 useCompareNetObjects: "true" diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 6956ac6d9c1..a85eac91e7f 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |licenseUrl|The URL of the license| |http://localhost| |modelClassModifier|Model Class Modifier can be nothing or partial| |partial| |newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0| -|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false| +|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer.| |false| |operationIsAsync|Set methods to async or sync (default).| |false| |operationModifier|Operation Modifier can be virtual or abstract|
**virtual**
Keep method virtual
**abstract**
Make method abstract
|virtual| |operationResultTask|Set methods result to Task<>.| |false| diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md index c694b4626ff..5030dee051a 100644 --- a/docs/generators/csharp-netcore-functions.md +++ b/docs/generators/csharp-netcore-functions.md @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| -|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false| +|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer.| |false| |optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| |optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| |optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| @@ -42,7 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
|netstandard2.0| +|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
|netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 17bc2cfa974..6e4a146c894 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -30,7 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| -|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false| +|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer.| |false| |optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| |optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| |optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| @@ -43,7 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
**net6.0**
.NET 6.0 compatible
|netstandard2.0| +|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible (deprecated)
**netcoreapp2.1**
.NET Core 2.1 compatible (deprecated)
**netcoreapp3.0**
.NET Core 3.0 compatible (deprecated)
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
**net6.0**
.NET 6.0 compatible
|netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 0dd162bc8d6..4caf9db56c8 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -36,7 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|
**v3.5**
.NET Framework 3.5 compatible
**v4.0**
.NET Framework 4.0 compatible
**v4.5**
.NET Framework 4.5 compatible
**v4.5.2**
.NET Framework 4.5.2+ compatible
**netstandard1.3**
.NET Standard 1.3 compatible (DEPRECATED. Please use `csharp-netcore` generator instead)
**uwp**
Universal Windows Platform (DEPRECATED. Please use `csharp-netcore` generator instead)
|v4.5| +|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`|
**v3.5**
.NET Framework 3.5 compatible
**v4.0**
.NET Framework 4.0 compatible
**v4.5**
.NET Framework 4.5 compatible
**v4.5.2**
.NET Framework 4.5.2+ compatible
**netstandard1.3**
.NET Standard 1.3 compatible (DEPRECATED. Please use `csharp-netcore` generator instead)
**uwp**
Universal Windows Platform (DEPRECATED. Please use `csharp-netcore` generator instead)
|v4.5| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useCompareNetObjects|Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 27c47456bc0..d0906a4caf0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -214,10 +214,10 @@ public class CodegenConstants { public static final String PARAM_NAMING_DESC = "Naming convention for parameters: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name"; public static final String DOTNET_FRAMEWORK = "targetFramework"; - public static final String DOTNET_FRAMEWORK_DESC = "The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`"; + public static final String DOTNET_FRAMEWORK_DESC = "The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.1`"; public static final String NULLABLE_REFERENCE_TYPES = "nullableReferenceTypes"; - public static final String NULLABLE_REFERENCE_TYPES_DESC = "Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer."; + public static final String NULLABLE_REFERENCE_TYPES_DESC = "Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.1 or newer."; public static final String TEMPLATING_ENGINE = "templatingEngine"; public static final String TEMPLATING_ENGINE_DESC = "The templating engine plugin to use: \"mustache\" (default) or \"handlebars\" (beta)"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 67cfd2f1cfa..1e882ca1819 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -39,7 +39,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @SuppressWarnings("Duplicates") -public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { +public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected String apiName = "Api"; // Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget @@ -1118,23 +1118,23 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); - static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3 compatible", "netcoreapp2.0") { + static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3 compatible", "netcoreapp3.1") { }; - static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4 compatible", "netcoreapp2.0") { + static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4 compatible", "netcoreapp3.1") { }; - static FrameworkStrategy NETSTANDARD_1_5 = new FrameworkStrategy("netstandard1.5", ".NET Standard 1.5 compatible", "netcoreapp2.0") { + static FrameworkStrategy NETSTANDARD_1_5 = new FrameworkStrategy("netstandard1.5", ".NET Standard 1.5 compatible", "netcoreapp3.1") { }; - static FrameworkStrategy NETSTANDARD_1_6 = new FrameworkStrategy("netstandard1.6", ".NET Standard 1.6 compatible", "netcoreapp2.0") { + static FrameworkStrategy NETSTANDARD_1_6 = new FrameworkStrategy("netstandard1.6", ".NET Standard 1.6 compatible", "netcoreapp3.1") { }; - static FrameworkStrategy NETSTANDARD_2_0 = new FrameworkStrategy("netstandard2.0", ".NET Standard 2.0 compatible", "netcoreapp2.0") { + static FrameworkStrategy NETSTANDARD_2_0 = new FrameworkStrategy("netstandard2.0", ".NET Standard 2.0 compatible", "netcoreapp3.1") { }; - static FrameworkStrategy NETSTANDARD_2_1 = new FrameworkStrategy("netstandard2.1", ".NET Standard 2.1 compatible", "netcoreapp3.0") { + static FrameworkStrategy NETSTANDARD_2_1 = new FrameworkStrategy("netstandard2.1", ".NET Standard 2.1 compatible", "netcoreapp3.1") { }; - static FrameworkStrategy NETCOREAPP_2_0 = new FrameworkStrategy("netcoreapp2.0", ".NET Core 2.0 compatible", "netcoreapp2.0", Boolean.FALSE) { + static FrameworkStrategy NETCOREAPP_2_0 = new FrameworkStrategy("netcoreapp2.0", ".NET Core 2.0 compatible (deprecated)", "netcoreapp2.0", Boolean.FALSE) { }; - static FrameworkStrategy NETCOREAPP_2_1 = new FrameworkStrategy("netcoreapp2.1", ".NET Core 2.1 compatible", "netcoreapp2.1", Boolean.FALSE) { + static FrameworkStrategy NETCOREAPP_2_1 = new FrameworkStrategy("netcoreapp2.1", ".NET Core 2.1 compatible (deprecated)", "netcoreapp2.1", Boolean.FALSE) { }; - static FrameworkStrategy NETCOREAPP_3_0 = new FrameworkStrategy("netcoreapp3.0", ".NET Core 3.0 compatible", "netcoreapp3.0", Boolean.FALSE) { + static FrameworkStrategy NETCOREAPP_3_0 = new FrameworkStrategy("netcoreapp3.0", ".NET Core 3.0 compatible (deprecated)", "netcoreapp3.0", Boolean.FALSE) { }; static FrameworkStrategy NETCOREAPP_3_1 = new FrameworkStrategy("netcoreapp3.1", ".NET Core 3.1 compatible", "netcoreapp3.1", Boolean.FALSE) { }; diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index d58f7e14d8d..a68e9179c81 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -3,7 +3,7 @@ Org.OpenAPITools.Test Org.OpenAPITools.Test - netcoreapp2.0 + netcoreapp3.1 false diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index d58f7e14d8d..a68e9179c81 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -3,7 +3,7 @@ Org.OpenAPITools.Test Org.OpenAPITools.Test - netcoreapp2.0 + netcoreapp3.1 false diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index d1694dcffd1..ac868f2e6ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -10,7 +10,7 @@ OpenAPI spec version: 1.0.0 - netcoreapp2.0 + netcoreapp3.1 false diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 97a88c1cbe3..8e1483670bb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -2,7 +2,7 @@ false - netcoreapp2.0 + netcoreapp3.1 Org.OpenAPITools Org.OpenAPITools Library diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index bc9730b0366..f75257161b7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -3,7 +3,7 @@ Org.OpenAPITools.Test Org.OpenAPITools.Test - netcoreapp3.0;netcoreapp3.0 + netcoreapp3.1;net47 false diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 6310b388e6e..fd30b32a72f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -2,7 +2,7 @@ false - netstandard2.1;netcoreapp3.0 + netstandard2.1;net47 Org.OpenAPITools Org.OpenAPITools Library From 8b017bc855e43c2bcf346390a2f8ea00b8f64133 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 30 Jan 2022 15:53:27 +0800 Subject: [PATCH 111/113] mark csharp-nancyfx generator as deprecated (#11454) --- .github/.test/samples.json | 14 +- .github/auto-labeler.yml | 2 - .../other/csharp-nancyfx-nancyfx-async.yaml | 7 - bin/configs/other/csharp-nancyfx-nancyfx.yaml | 7 - docs/generators.md | 2 +- ...ancyfx.md => csharp-nancyfx-deprecated.md} | 8 +- .../languages/CSharpNancyFXServerCodegen.java | 10 +- .../server/petstore/nancyfx-async/.gitignore | 362 -------------- .../nancyfx-async/.openapi-generator-ignore | 23 - .../nancyfx-async/.openapi-generator/FILES | 16 - .../nancyfx-async/.openapi-generator/VERSION | 1 - .../nancyfx-async/Org.OpenAPITools.sln | 25 - .../src/IO.Swagger/IO.Swagger.csproj | 66 --- .../src/IO.Swagger/IO.Swagger.nuspec | 14 - .../src/IO.Swagger/Models/ApiResponse.cs | 185 ------- .../src/IO.Swagger/Models/Category.cs | 165 ------- .../src/IO.Swagger/Models/Order.cs | 247 ---------- .../src/IO.Swagger/Models/Pet.cs | 254 ---------- .../src/IO.Swagger/Models/Tag.cs | 165 ------- .../src/IO.Swagger/Models/User.cs | 285 ----------- .../src/IO.Swagger/Modules/PetModule.cs | 247 ---------- .../src/IO.Swagger/Modules/StoreModule.cs | 129 ----- .../src/IO.Swagger/Modules/UserModule.cs | 234 --------- .../IO.Swagger/Utils/LocalDateConverter.cs | 55 --- .../src/IO.Swagger/Utils/Parameters.cs | 450 ------------------ .../src/IO.Swagger/packages.config | 7 - .../Org.OpenAPITools/Models/ApiResponse.cs | 185 ------- .../src/Org.OpenAPITools/Models/Category.cs | 165 ------- .../src/Org.OpenAPITools/Models/Order.cs | 247 ---------- .../src/Org.OpenAPITools/Models/Pet.cs | 254 ---------- .../src/Org.OpenAPITools/Models/Tag.cs | 165 ------- .../src/Org.OpenAPITools/Models/User.cs | 285 ----------- .../src/Org.OpenAPITools/Modules/PetModule.cs | 250 ---------- .../Org.OpenAPITools/Modules/StoreModule.cs | 129 ----- .../Org.OpenAPITools/Modules/UserModule.cs | 234 --------- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 66 --- .../Org.OpenAPITools/Org.OpenAPITools.nuspec | 13 - .../Utils/LocalDateConverter.cs | 55 --- .../src/Org.OpenAPITools/Utils/Parameters.cs | 450 ------------------ .../src/Org.OpenAPITools/packages.config | 7 - samples/server/petstore/nancyfx/.gitignore | 362 -------------- .../nancyfx/.openapi-generator-ignore | 23 - .../petstore/nancyfx/.openapi-generator/FILES | 16 - .../nancyfx/.openapi-generator/VERSION | 1 - .../petstore/nancyfx/Org.OpenAPITools.sln | 25 - .../Org.OpenAPITools/Models/ApiResponse.cs | 185 ------- .../src/Org.OpenAPITools/Models/Category.cs | 165 ------- .../src/Org.OpenAPITools/Models/Order.cs | 247 ---------- .../src/Org.OpenAPITools/Models/Pet.cs | 254 ---------- .../src/Org.OpenAPITools/Models/Tag.cs | 165 ------- .../src/Org.OpenAPITools/Models/User.cs | 285 ----------- .../src/Org.OpenAPITools/Modules/PetModule.cs | 249 ---------- .../Org.OpenAPITools/Modules/StoreModule.cs | 128 ----- .../Org.OpenAPITools/Modules/UserModule.cs | 233 --------- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 66 --- .../Org.OpenAPITools/Org.OpenAPITools.nuspec | 13 - .../Utils/LocalDateConverter.cs | 55 --- .../src/Org.OpenAPITools/Utils/Parameters.cs | 450 ------------------ .../src/Org.OpenAPITools/packages.config | 7 - 59 files changed, 14 insertions(+), 8400 deletions(-) delete mode 100644 bin/configs/other/csharp-nancyfx-nancyfx-async.yaml delete mode 100644 bin/configs/other/csharp-nancyfx-nancyfx.yaml rename docs/generators/{csharp-nancyfx.md => csharp-nancyfx-deprecated.md} (95%) delete mode 100644 samples/server/petstore/nancyfx-async/.gitignore delete mode 100644 samples/server/petstore/nancyfx-async/.openapi-generator-ignore delete mode 100644 samples/server/petstore/nancyfx-async/.openapi-generator/FILES delete mode 100644 samples/server/petstore/nancyfx-async/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.csproj delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.nuspec delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/ApiResponse.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Category.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Order.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Pet.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Tag.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/User.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/PetModule.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/StoreModule.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/UserModule.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/LocalDateConverter.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/Parameters.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/IO.Swagger/packages.config delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs delete mode 100644 samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config delete mode 100644 samples/server/petstore/nancyfx/.gitignore delete mode 100644 samples/server/petstore/nancyfx/.openapi-generator-ignore delete mode 100644 samples/server/petstore/nancyfx/.openapi-generator/FILES delete mode 100644 samples/server/petstore/nancyfx/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/nancyfx/Org.OpenAPITools.sln delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.nuspec delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs delete mode 100644 samples/server/petstore/nancyfx/src/Org.OpenAPITools/packages.config diff --git a/.github/.test/samples.json b/.github/.test/samples.json index d756cc45dfd..471241ab9c8 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -722,18 +722,6 @@ "Schema: MySQL" ] }, - { - "input": "nancyfx-petstore-server-async.sh", - "matches": [ - "Server: C-Sharp" - ] - }, - { - "input": "nancyfx-petstore-server.sh", - "matches": [ - "Server: C-Sharp" - ] - }, { "input": "nodejs-petstore-google-cloud-functions.sh", "matches": [ @@ -1401,4 +1389,4 @@ "matches": [] } ] -} \ No newline at end of file +} diff --git a/.github/auto-labeler.yml b/.github/auto-labeler.yml index 5bff51d5cec..2bb9a71d44e 100644 --- a/.github/auto-labeler.yml +++ b/.github/auto-labeler.yml @@ -223,8 +223,6 @@ labels: 'Server: C-Sharp': - '\s*?\[aspnetcore\]\s*?' - '\s*?-[gl] aspnetcore\s*?' - - '\s*?\[csharp-nancyfx\]\s*?' - - '\s*?-[gl] csharp-nancyfx\s*?' # 'Server: Ceylon': # TODO: REMOVE UNUSED LABEL 'Server: Eiffel': - '\s*?\[eiffel(-.*)?-server\]\s*?' diff --git a/bin/configs/other/csharp-nancyfx-nancyfx-async.yaml b/bin/configs/other/csharp-nancyfx-nancyfx-async.yaml deleted file mode 100644 index ae5e4671753..00000000000 --- a/bin/configs/other/csharp-nancyfx-nancyfx-async.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: csharp-nancyfx -outputDir: samples/server/petstore/nancyfx-async -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-nancyfx -additionalProperties: - asyncServer: "true" - packageGuid: '{768B8DC6-54EE-4D40-9B20-7857E1D742A4}' diff --git a/bin/configs/other/csharp-nancyfx-nancyfx.yaml b/bin/configs/other/csharp-nancyfx-nancyfx.yaml deleted file mode 100644 index 5fd6cdffafe..00000000000 --- a/bin/configs/other/csharp-nancyfx-nancyfx.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: csharp-nancyfx -outputDir: samples/server/petstore/nancyfx -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-nancyfx -additionalProperties: - asyncServer: "false" - packageGuid: '{768B8DC6-54EE-4D40-9B20-7857E1D742A4}' diff --git a/docs/generators.md b/docs/generators.md index afd41cba7e3..65595bbbe89 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -86,7 +86,7 @@ The following generators are available: * [cpp-pistache-server](generators/cpp-pistache-server.md) * [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md) * [cpp-restbed-server](generators/cpp-restbed-server.md) -* [csharp-nancyfx](generators/csharp-nancyfx.md) +* [csharp-nancyfx-deprecated (deprecated)](generators/csharp-nancyfx-deprecated.md) * [csharp-netcore-functions (beta)](generators/csharp-netcore-functions.md) * [erlang-server](generators/erlang-server.md) * [fsharp-functions (beta)](generators/fsharp-functions.md) diff --git a/docs/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx-deprecated.md similarity index 95% rename from docs/generators/csharp-nancyfx.md rename to docs/generators/csharp-nancyfx-deprecated.md index 37d2be9eb02..519edc27307 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx-deprecated.md @@ -1,17 +1,17 @@ --- -title: Documentation for the csharp-nancyfx Generator +title: Documentation for the csharp-nancyfx-deprecated Generator --- ## METADATA | Property | Value | Notes | | -------- | ----- | ----- | -| generator name | csharp-nancyfx | pass this to the generate command after -g | -| generator stability | STABLE | | +| generator name | csharp-nancyfx-deprecated | pass this to the generate command after -g | +| generator stability | DEPRECATED | | | generator type | SERVER | | | generator language | C# | | | generator default templating engine | mustache | | -| helpTxt | Generates a C# NancyFX Web API server. | | +| helpTxt | Generates a C# NancyFX Web API server (deprecated). | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java index a99243ab359..280d26f7a16 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNancyFXServerCodegen.java @@ -23,6 +23,8 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; @@ -86,6 +88,10 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen { ) ); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.DEPRECATED) + .build(); + outputFolder = "generated-code" + File.separator + getName(); apiTemplateFiles.put("api.mustache", ".cs"); @@ -127,12 +133,12 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen { @Override public String getName() { - return "csharp-nancyfx"; + return "csharp-nancyfx-deprecated"; } @Override public String getHelp() { - return "Generates a C# NancyFX Web API server."; + return "Generates a C# NancyFX Web API server (deprecated)."; } @Override diff --git a/samples/server/petstore/nancyfx-async/.gitignore b/samples/server/petstore/nancyfx-async/.gitignore deleted file mode 100644 index 1ee53850b84..00000000000 --- a/samples/server/petstore/nancyfx-async/.gitignore +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator-ignore b/samples/server/petstore/nancyfx-async/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c5..00000000000 --- a/samples/server/petstore/nancyfx-async/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# 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 Swagger Codgen 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/server/petstore/nancyfx-async/.openapi-generator/FILES b/samples/server/petstore/nancyfx-async/.openapi-generator/FILES deleted file mode 100644 index eabec10a061..00000000000 --- a/samples/server/petstore/nancyfx-async/.openapi-generator/FILES +++ /dev/null @@ -1,16 +0,0 @@ -.gitignore -Org.OpenAPITools.sln -src/Org.OpenAPITools/Models/ApiResponse.cs -src/Org.OpenAPITools/Models/Category.cs -src/Org.OpenAPITools/Models/Order.cs -src/Org.OpenAPITools/Models/Pet.cs -src/Org.OpenAPITools/Models/Tag.cs -src/Org.OpenAPITools/Models/User.cs -src/Org.OpenAPITools/Modules/PetModule.cs -src/Org.OpenAPITools/Modules/StoreModule.cs -src/Org.OpenAPITools/Modules/UserModule.cs -src/Org.OpenAPITools/Org.OpenAPITools.csproj -src/Org.OpenAPITools/Org.OpenAPITools.nuspec -src/Org.OpenAPITools/Utils/LocalDateConverter.cs -src/Org.OpenAPITools/Utils/Parameters.cs -src/Org.OpenAPITools/packages.config diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln b/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln deleted file mode 100644 index 757078a1383..00000000000 --- a/samples/server/petstore/nancyfx-async/Org.OpenAPITools.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -VisualStudioVersion = 12.0.0.0 -MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" -EndProject -Global -GlobalSection(SolutionConfigurationPlatforms) = preSolution -Debug|Any CPU = Debug|Any CPU -Release|Any CPU = Release|Any CPU -EndGlobalSection -GlobalSection(ProjectConfigurationPlatforms) = postSolution -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU -EndGlobalSection -GlobalSection(SolutionProperties) = preSolution -HideSolutionNode = FALSE -EndGlobalSection -EndGlobal \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.csproj deleted file mode 100644 index e1577197b6f..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - Debug - AnyCPU - {768B8DC6-54EE-4D40-9B20-7857E1D742A4} - Library - Properties - IO.Swagger.v2 - IO.Swagger - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\IO.Swagger.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\IO.Swagger.XML - - - - ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\..\packages\NodaTime.1.3.1\lib\net35-Client\NodaTime.dll - True - - - ..\..\packages\Sharpility.1.2.2\lib\net45\Sharpility.dll - True - - - ..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - - - - - - - - - - - - - - - - diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.nuspec b/samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.nuspec deleted file mode 100644 index 360effbaf7f..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/IO.Swagger.nuspec +++ /dev/null @@ -1,14 +0,0 @@ - - - - IO.Swagger - IO.Swagger - 1.0.0 - swagger-codegen - swagger-codegen - false - NancyFx IO.Swagger API - http://swagger.io/terms/ - https://www.apache.org/licenses/LICENSE-2.0.html - - \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/ApiResponse.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/ApiResponse.cs deleted file mode 100644 index ebaa3c8d4f1..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/ApiResponse.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace IO.Swagger.v2.Models -{ - /// - /// Describes the result of uploading an image resource - /// - public sealed class ApiResponse: IEquatable - { - /// - /// Code - /// - public int? Code { get; private set; } - - /// - /// Type - /// - public string Type { get; private set; } - - /// - /// Message - /// - public string Message { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use ApiResponse.Builder() for instance creation instead. - /// - [Obsolete] - public ApiResponse() - { - } - - private ApiResponse(int? Code, string Type, string Message) - { - - this.Code = Code; - - this.Type = Type; - - this.Message = Message; - - } - - /// - /// Returns builder of ApiResponse. - /// - /// ApiResponseBuilder - public static ApiResponseBuilder Builder() - { - return new ApiResponseBuilder(); - } - - /// - /// Returns ApiResponseBuilder with properties set. - /// Use it to change properties. - /// - /// ApiResponseBuilder - public ApiResponseBuilder With() - { - return Builder() - .Code(Code) - .Type(Type) - .Message(Message); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(ApiResponse other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (ApiResponse. - /// - /// Compared (ApiResponse - /// Compared (ApiResponse - /// true if compared items are equals, false otherwise - public static bool operator == (ApiResponse left, ApiResponse right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (ApiResponse. - /// - /// Compared (ApiResponse - /// Compared (ApiResponse - /// true if compared items are not equals, false otherwise - public static bool operator != (ApiResponse left, ApiResponse right) - { - return !Equals(left, right); - } - - /// - /// Builder of ApiResponse. - /// - public sealed class ApiResponseBuilder - { - private int? _Code; - private string _Type; - private string _Message; - - internal ApiResponseBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for ApiResponse.Code property. - /// - /// Code - public ApiResponseBuilder Code(int? value) - { - _Code = value; - return this; - } - - /// - /// Sets value for ApiResponse.Type property. - /// - /// Type - public ApiResponseBuilder Type(string value) - { - _Type = value; - return this; - } - - /// - /// Sets value for ApiResponse.Message property. - /// - /// Message - public ApiResponseBuilder Message(string value) - { - _Message = value; - return this; - } - - - /// - /// Builds instance of ApiResponse. - /// - /// ApiResponse - public ApiResponse Build() - { - Validate(); - return new ApiResponse( - Code: _Code, - Type: _Type, - Message: _Message - ); - } - - private void Validate() - { - } - } - - - } -} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Category.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Category.cs deleted file mode 100644 index bf811614b37..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Category.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace IO.Swagger.v2.Models -{ - /// - /// A category for a pet - /// - public sealed class Category: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Category.Builder() for instance creation instead. - /// - [Obsolete] - public Category() - { - } - - private Category(long? Id, string Name) - { - - this.Id = Id; - - this.Name = Name; - - } - - /// - /// Returns builder of Category. - /// - /// CategoryBuilder - public static CategoryBuilder Builder() - { - return new CategoryBuilder(); - } - - /// - /// Returns CategoryBuilder with properties set. - /// Use it to change properties. - /// - /// CategoryBuilder - public CategoryBuilder With() - { - return Builder() - .Id(Id) - .Name(Name); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Category other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Category. - /// - /// Compared (Category - /// Compared (Category - /// true if compared items are equals, false otherwise - public static bool operator == (Category left, Category right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Category. - /// - /// Compared (Category - /// Compared (Category - /// true if compared items are not equals, false otherwise - public static bool operator != (Category left, Category right) - { - return !Equals(left, right); - } - - /// - /// Builder of Category. - /// - public sealed class CategoryBuilder - { - private long? _Id; - private string _Name; - - internal CategoryBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Category.Id property. - /// - /// Id - public CategoryBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Category.Name property. - /// - /// Name - public CategoryBuilder Name(string value) - { - _Name = value; - return this; - } - - - /// - /// Builds instance of Category. - /// - /// Category - public Category Build() - { - Validate(); - return new Category( - Id: _Id, - Name: _Name - ); - } - - private void Validate() - { - } - } - - - } -} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Order.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Order.cs deleted file mode 100644 index 0495a36f138..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Order.cs +++ /dev/null @@ -1,247 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace IO.Swagger.v2.Models -{ - /// - /// An order for a pets from the pet store - /// - public sealed class Order: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// PetId - /// - public long? PetId { get; private set; } - - /// - /// Quantity - /// - public int? Quantity { get; private set; } - - /// - /// ShipDate - /// - public ZonedDateTime? ShipDate { get; private set; } - - /// - /// Order Status - /// - public StatusEnum? Status { get; private set; } - - /// - /// Complete - /// - public bool? Complete { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Order.Builder() for instance creation instead. - /// - [Obsolete] - public Order() - { - } - - private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) - { - - this.Id = Id; - - this.PetId = PetId; - - this.Quantity = Quantity; - - this.ShipDate = ShipDate; - - this.Status = Status; - - this.Complete = Complete; - - } - - /// - /// Returns builder of Order. - /// - /// OrderBuilder - public static OrderBuilder Builder() - { - return new OrderBuilder(); - } - - /// - /// Returns OrderBuilder with properties set. - /// Use it to change properties. - /// - /// OrderBuilder - public OrderBuilder With() - { - return Builder() - .Id(Id) - .PetId(PetId) - .Quantity(Quantity) - .ShipDate(ShipDate) - .Status(Status) - .Complete(Complete); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Order other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Order. - /// - /// Compared (Order - /// Compared (Order - /// true if compared items are equals, false otherwise - public static bool operator == (Order left, Order right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Order. - /// - /// Compared (Order - /// Compared (Order - /// true if compared items are not equals, false otherwise - public static bool operator != (Order left, Order right) - { - return !Equals(left, right); - } - - /// - /// Builder of Order. - /// - public sealed class OrderBuilder - { - private long? _Id; - private long? _PetId; - private int? _Quantity; - private ZonedDateTime? _ShipDate; - private StatusEnum? _Status; - private bool? _Complete; - - internal OrderBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - _Complete = false; - } - - /// - /// Sets value for Order.Id property. - /// - /// Id - public OrderBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Order.PetId property. - /// - /// PetId - public OrderBuilder PetId(long? value) - { - _PetId = value; - return this; - } - - /// - /// Sets value for Order.Quantity property. - /// - /// Quantity - public OrderBuilder Quantity(int? value) - { - _Quantity = value; - return this; - } - - /// - /// Sets value for Order.ShipDate property. - /// - /// ShipDate - public OrderBuilder ShipDate(ZonedDateTime? value) - { - _ShipDate = value; - return this; - } - - /// - /// Sets value for Order.Status property. - /// - /// Order Status - public OrderBuilder Status(StatusEnum? value) - { - _Status = value; - return this; - } - - /// - /// Sets value for Order.Complete property. - /// - /// Complete - public OrderBuilder Complete(bool? value) - { - _Complete = value; - return this; - } - - - /// - /// Builds instance of Order. - /// - /// Order - public Order Build() - { - Validate(); - return new Order( - Id: _Id, - PetId: _PetId, - Quantity: _Quantity, - ShipDate: _ShipDate, - Status: _Status, - Complete: _Complete - ); - } - - private void Validate() - { - } - } - - - public enum StatusEnum { Placed, Approved, Delivered }; - } -} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Pet.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Pet.cs deleted file mode 100644 index f945a0fdd78..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Pet.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace IO.Swagger.v2.Models -{ - /// - /// A pet for sale in the pet store - /// - public sealed class Pet: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Category - /// - public Category Category { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - /// - /// PhotoUrls - /// - public List PhotoUrls { get; private set; } - - /// - /// Tags - /// - public List Tags { get; private set; } - - /// - /// pet status in the store - /// - public StatusEnum? Status { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Pet.Builder() for instance creation instead. - /// - [Obsolete] - public Pet() - { - } - - private Pet(long? Id, Category Category, string Name, List PhotoUrls, List Tags, StatusEnum? Status) - { - - this.Id = Id; - - this.Category = Category; - - this.Name = Name; - - this.PhotoUrls = PhotoUrls; - - this.Tags = Tags; - - this.Status = Status; - - } - - /// - /// Returns builder of Pet. - /// - /// PetBuilder - public static PetBuilder Builder() - { - return new PetBuilder(); - } - - /// - /// Returns PetBuilder with properties set. - /// Use it to change properties. - /// - /// PetBuilder - public PetBuilder With() - { - return Builder() - .Id(Id) - .Category(Category) - .Name(Name) - .PhotoUrls(PhotoUrls) - .Tags(Tags) - .Status(Status); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Pet other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Pet. - /// - /// Compared (Pet - /// Compared (Pet - /// true if compared items are equals, false otherwise - public static bool operator == (Pet left, Pet right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Pet. - /// - /// Compared (Pet - /// Compared (Pet - /// true if compared items are not equals, false otherwise - public static bool operator != (Pet left, Pet right) - { - return !Equals(left, right); - } - - /// - /// Builder of Pet. - /// - public sealed class PetBuilder - { - private long? _Id; - private Category _Category; - private string _Name; - private List _PhotoUrls; - private List _Tags; - private StatusEnum? _Status; - - internal PetBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Pet.Id property. - /// - /// Id - public PetBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Pet.Category property. - /// - /// Category - public PetBuilder Category(Category value) - { - _Category = value; - return this; - } - - /// - /// Sets value for Pet.Name property. - /// - /// Name - public PetBuilder Name(string value) - { - _Name = value; - return this; - } - - /// - /// Sets value for Pet.PhotoUrls property. - /// - /// PhotoUrls - public PetBuilder PhotoUrls(List value) - { - _PhotoUrls = value; - return this; - } - - /// - /// Sets value for Pet.Tags property. - /// - /// Tags - public PetBuilder Tags(List value) - { - _Tags = value; - return this; - } - - /// - /// Sets value for Pet.Status property. - /// - /// pet status in the store - public PetBuilder Status(StatusEnum? value) - { - _Status = value; - return this; - } - - - /// - /// Builds instance of Pet. - /// - /// Pet - public Pet Build() - { - Validate(); - return new Pet( - Id: _Id, - Category: _Category, - Name: _Name, - PhotoUrls: _PhotoUrls, - Tags: _Tags, - Status: _Status - ); - } - - private void Validate() - { - if (_Name == null) - { - throw new ArgumentException("Name is a required property for Pet and cannot be null"); - } - if (_PhotoUrls == null) - { - throw new ArgumentException("PhotoUrls is a required property for Pet and cannot be null"); - } - } - } - - - public enum StatusEnum { Available, Pending, Sold }; - } -} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Tag.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Tag.cs deleted file mode 100644 index 02d1e40f1ec..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/Tag.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace IO.Swagger.v2.Models -{ - /// - /// A tag for a pet - /// - public sealed class Tag: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Tag.Builder() for instance creation instead. - /// - [Obsolete] - public Tag() - { - } - - private Tag(long? Id, string Name) - { - - this.Id = Id; - - this.Name = Name; - - } - - /// - /// Returns builder of Tag. - /// - /// TagBuilder - public static TagBuilder Builder() - { - return new TagBuilder(); - } - - /// - /// Returns TagBuilder with properties set. - /// Use it to change properties. - /// - /// TagBuilder - public TagBuilder With() - { - return Builder() - .Id(Id) - .Name(Name); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Tag other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Tag. - /// - /// Compared (Tag - /// Compared (Tag - /// true if compared items are equals, false otherwise - public static bool operator == (Tag left, Tag right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Tag. - /// - /// Compared (Tag - /// Compared (Tag - /// true if compared items are not equals, false otherwise - public static bool operator != (Tag left, Tag right) - { - return !Equals(left, right); - } - - /// - /// Builder of Tag. - /// - public sealed class TagBuilder - { - private long? _Id; - private string _Name; - - internal TagBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Tag.Id property. - /// - /// Id - public TagBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Tag.Name property. - /// - /// Name - public TagBuilder Name(string value) - { - _Name = value; - return this; - } - - - /// - /// Builds instance of Tag. - /// - /// Tag - public Tag Build() - { - Validate(); - return new Tag( - Id: _Id, - Name: _Name - ); - } - - private void Validate() - { - } - } - - - } -} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/User.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/User.cs deleted file mode 100644 index 99f401750df..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Models/User.cs +++ /dev/null @@ -1,285 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace IO.Swagger.v2.Models -{ - /// - /// A User who is purchasing from the pet store - /// - public sealed class User: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Username - /// - public string Username { get; private set; } - - /// - /// FirstName - /// - public string FirstName { get; private set; } - - /// - /// LastName - /// - public string LastName { get; private set; } - - /// - /// Email - /// - public string Email { get; private set; } - - /// - /// Password - /// - public string Password { get; private set; } - - /// - /// Phone - /// - public string Phone { get; private set; } - - /// - /// User Status - /// - public int? UserStatus { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use User.Builder() for instance creation instead. - /// - [Obsolete] - public User() - { - } - - private User(long? Id, string Username, string FirstName, string LastName, string Email, string Password, string Phone, int? UserStatus) - { - - this.Id = Id; - - this.Username = Username; - - this.FirstName = FirstName; - - this.LastName = LastName; - - this.Email = Email; - - this.Password = Password; - - this.Phone = Phone; - - this.UserStatus = UserStatus; - - } - - /// - /// Returns builder of User. - /// - /// UserBuilder - public static UserBuilder Builder() - { - return new UserBuilder(); - } - - /// - /// Returns UserBuilder with properties set. - /// Use it to change properties. - /// - /// UserBuilder - public UserBuilder With() - { - return Builder() - .Id(Id) - .Username(Username) - .FirstName(FirstName) - .LastName(LastName) - .Email(Email) - .Password(Password) - .Phone(Phone) - .UserStatus(UserStatus); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(User other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (User. - /// - /// Compared (User - /// Compared (User - /// true if compared items are equals, false otherwise - public static bool operator == (User left, User right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (User. - /// - /// Compared (User - /// Compared (User - /// true if compared items are not equals, false otherwise - public static bool operator != (User left, User right) - { - return !Equals(left, right); - } - - /// - /// Builder of User. - /// - public sealed class UserBuilder - { - private long? _Id; - private string _Username; - private string _FirstName; - private string _LastName; - private string _Email; - private string _Password; - private string _Phone; - private int? _UserStatus; - - internal UserBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for User.Id property. - /// - /// Id - public UserBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for User.Username property. - /// - /// Username - public UserBuilder Username(string value) - { - _Username = value; - return this; - } - - /// - /// Sets value for User.FirstName property. - /// - /// FirstName - public UserBuilder FirstName(string value) - { - _FirstName = value; - return this; - } - - /// - /// Sets value for User.LastName property. - /// - /// LastName - public UserBuilder LastName(string value) - { - _LastName = value; - return this; - } - - /// - /// Sets value for User.Email property. - /// - /// Email - public UserBuilder Email(string value) - { - _Email = value; - return this; - } - - /// - /// Sets value for User.Password property. - /// - /// Password - public UserBuilder Password(string value) - { - _Password = value; - return this; - } - - /// - /// Sets value for User.Phone property. - /// - /// Phone - public UserBuilder Phone(string value) - { - _Phone = value; - return this; - } - - /// - /// Sets value for User.UserStatus property. - /// - /// User Status - public UserBuilder UserStatus(int? value) - { - _UserStatus = value; - return this; - } - - - /// - /// Builds instance of User. - /// - /// User - public User Build() - { - Validate(); - return new User( - Id: _Id, - Username: _Username, - FirstName: _FirstName, - LastName: _LastName, - Email: _Email, - Password: _Password, - Phone: _Phone, - UserStatus: _UserStatus - ); - } - - private void Validate() - { - } - } - - - } -} \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/PetModule.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/PetModule.cs deleted file mode 100644 index 6b3e8cc1db8..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/PetModule.cs +++ /dev/null @@ -1,247 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using IO.Swagger.v2.Models; -using IO.Swagger.v2.Utils; -using NodaTime; -using System.Threading.Tasks; - -namespace IO.Swagger.v2.Modules -{ - /// - /// Status values that need to be considered for filter - /// - public enum FindPetsByStatusStatusEnum - { - available = 1, - pending = 2, - sold = 3 - }; - - - /// - /// Module processing requests of Pet domain. - /// - public sealed class PetModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public PetModule(PetService service) : base("/v2") - { - Post["/pet", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - - await service.AddPet(Context, body); - return new Response { ContentType = "application/xml"}; - }; - - Delete["/pet/{petId}", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var apiKey = Parameters.ValueOf(parameters, Context.Request, "apiKey", ParameterType.Header); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'DeletePet'"); - - await service.DeletePet(Context, petId, apiKey); - return new Response { ContentType = "application/xml"}; - }; - - Get["/pet/findByStatus", true] = async (parameters, ct) => - { - var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Query); - Preconditions.IsNotNull(status, "Required parameter: 'status' is missing at 'FindPetsByStatus'"); - - return await service.FindPetsByStatus(Context, status).ToArray(); - }; - - Get["/pet/findByTags", true] = async (parameters, ct) => - { - var tags = Parameters.ValueOf>(parameters, Context.Request, "tags", ParameterType.Query); - Preconditions.IsNotNull(tags, "Required parameter: 'tags' is missing at 'FindPetsByTags'"); - - return await service.FindPetsByTags(Context, tags).ToArray(); - }; - - Get["/pet/{petId}", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'GetPetById'"); - - return await service.GetPetById(Context, petId); - }; - - Put["/pet", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - - await service.UpdatePet(Context, body); - return new Response { ContentType = "application/xml"}; - }; - - Post["/pet/{petId}", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var name = Parameters.ValueOf(parameters, Context.Request, "name", ParameterType.Undefined); - var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Undefined); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UpdatePetWithForm'"); - - await service.UpdatePetWithForm(Context, petId, name, status); - return new Response { ContentType = "application/xml"}; - }; - - Post["/pet/{petId}/uploadImage", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var additionalMetadata = Parameters.ValueOf(parameters, Context.Request, "additionalMetadata", ParameterType.Undefined); - var file = Parameters.ValueOf(parameters, Context.Request, "file", ParameterType.Undefined); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UploadFile'"); - - return await service.UploadFile(Context, petId, additionalMetadata, file); - }; - } - } - - /// - /// Service handling Pet requests. - /// - public interface PetService - { - /// - /// - /// - /// Context of request - /// Pet object that needs to be added to the store - /// - Task AddPet(NancyContext context, Pet body); - - /// - /// - /// - /// Context of request - /// Pet id to delete - /// (optional) - /// - Task DeletePet(NancyContext context, long? petId, string apiKey); - - /// - /// Multiple status values can be provided with comma separated strings - /// - /// Context of request - /// Status values that need to be considered for filter - /// List<Pet> - Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status); - - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Context of request - /// Tags to filter by - /// List<Pet> - Task> FindPetsByTags(NancyContext context, List tags); - - /// - /// Returns a single pet - /// - /// Context of request - /// ID of pet to return - /// Pet - Task GetPetById(NancyContext context, long? petId); - - /// - /// - /// - /// Context of request - /// Pet object that needs to be added to the store - /// - Task UpdatePet(NancyContext context, Pet body); - - /// - /// - /// - /// Context of request - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) - /// - Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status); - - /// - /// - /// - /// Context of request - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) - /// ApiResponse - Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Abstraction of PetService. - /// - public abstract class AbstractPetService: PetService - { - public virtual Task AddPet(NancyContext context, Pet body) - { - return AddPet(body); - } - - public virtual Task DeletePet(NancyContext context, long? petId, string apiKey) - { - return DeletePet(petId, apiKey); - } - - public virtual Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status) - { - return FindPetsByStatus(status); - } - - public virtual Task> FindPetsByTags(NancyContext context, List tags) - { - return FindPetsByTags(tags); - } - - public virtual Task GetPetById(NancyContext context, long? petId) - { - return GetPetById(petId); - } - - public virtual Task UpdatePet(NancyContext context, Pet body) - { - return UpdatePet(body); - } - - public virtual Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status) - { - return UpdatePetWithForm(petId, name, status); - } - - public virtual Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file) - { - return UploadFile(petId, additionalMetadata, file); - } - - protected abstract Task AddPet(Pet body); - - protected abstract Task DeletePet(long? petId, string apiKey); - - protected abstract Task> FindPetsByStatus(FindPetsByStatusStatusEnum? status); - - protected abstract Task> FindPetsByTags(List tags); - - protected abstract Task GetPetById(long? petId); - - protected abstract Task UpdatePet(Pet body); - - protected abstract Task UpdatePetWithForm(long? petId, string name, string status); - - protected abstract Task UploadFile(long? petId, string additionalMetadata, System.IO.Stream file); - } - -} diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/StoreModule.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/StoreModule.cs deleted file mode 100644 index 30c46234256..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/StoreModule.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using IO.Swagger.v2.Models; -using IO.Swagger.v2.Utils; -using NodaTime; -using System.Threading.Tasks; - -namespace IO.Swagger.v2.Modules -{ - - /// - /// Module processing requests of Store domain. - /// - public sealed class StoreModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public StoreModule(StoreService service) : base("/v2") - { - Delete["/store/order/{orderId}", true] = async (parameters, ct) => - { - var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); - Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'DeleteOrder'"); - - await service.DeleteOrder(Context, orderId); - return new Response { ContentType = "application/xml"}; - }; - - Get["/store/inventory", true] = async (parameters, ct) => - { - - return await service.GetInventory(Context); - }; - - Get["/store/order/{orderId}", true] = async (parameters, ct) => - { - var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); - Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'GetOrderById'"); - - return await service.GetOrderById(Context, orderId); - }; - - Post["/store/order", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - - return await service.PlaceOrder(Context, body); - }; - } - } - - /// - /// Service handling Store requests. - /// - public interface StoreService - { - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// Context of request - /// ID of the order that needs to be deleted - /// - Task DeleteOrder(NancyContext context, string orderId); - - /// - /// Returns a map of status codes to quantities - /// - /// Context of request - /// Dictionary<string, int?> - Task> GetInventory(NancyContext context); - - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// Context of request - /// ID of pet that needs to be fetched - /// Order - Task GetOrderById(NancyContext context, long? orderId); - - /// - /// - /// - /// Context of request - /// order placed for purchasing the pet - /// Order - Task PlaceOrder(NancyContext context, Order body); - } - - /// - /// Abstraction of StoreService. - /// - public abstract class AbstractStoreService: StoreService - { - public virtual Task DeleteOrder(NancyContext context, string orderId) - { - return DeleteOrder(orderId); - } - - public virtual Task> GetInventory(NancyContext context) - { - return GetInventory(); - } - - public virtual Task GetOrderById(NancyContext context, long? orderId) - { - return GetOrderById(orderId); - } - - public virtual Task PlaceOrder(NancyContext context, Order body) - { - return PlaceOrder(body); - } - - protected abstract Task DeleteOrder(string orderId); - - protected abstract Task> GetInventory(); - - protected abstract Task GetOrderById(long? orderId); - - protected abstract Task PlaceOrder(Order body); - } - -} diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/UserModule.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/UserModule.cs deleted file mode 100644 index 4faf9e38dbd..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Modules/UserModule.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using IO.Swagger.v2.Models; -using IO.Swagger.v2.Utils; -using NodaTime; -using System.Threading.Tasks; - -namespace IO.Swagger.v2.Modules -{ - - /// - /// Module processing requests of User domain. - /// - public sealed class UserModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public UserModule(UserService service) : base("/v2") - { - Post["/user", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - - await service.CreateUser(Context, body); - return new Response { ContentType = "application/xml"}; - }; - - Post["/user/createWithArray", true] = async (parameters, ct) => - { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - - await service.CreateUsersWithArrayInput(Context, body); - return new Response { ContentType = "application/xml"}; - }; - - Post["/user/createWithList", true] = async (parameters, ct) => - { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - - await service.CreateUsersWithListInput(Context, body); - return new Response { ContentType = "application/xml"}; - }; - - Delete["/user/{username}", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'DeleteUser'"); - - await service.DeleteUser(Context, username); - return new Response { ContentType = "application/xml"}; - }; - - Get["/user/{username}", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'GetUserByName'"); - - return await service.GetUserByName(Context, username); - }; - - Get["/user/login", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Query); - var password = Parameters.ValueOf(parameters, Context.Request, "password", ParameterType.Query); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'LoginUser'"); - - Preconditions.IsNotNull(password, "Required parameter: 'password' is missing at 'LoginUser'"); - - return await service.LoginUser(Context, username, password); - }; - - Get["/user/logout", true] = async (parameters, ct) => - { - - await service.LogoutUser(Context); - return new Response { ContentType = "application/xml"}; - }; - - Put["/user/{username}", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var body = this.Bind(); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - - await service.UpdateUser(Context, username, body); - return new Response { ContentType = "application/xml"}; - }; - } - } - - /// - /// Service handling User requests. - /// - public interface UserService - { - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// Created user object - /// - Task CreateUser(NancyContext context, User body); - - /// - /// - /// - /// Context of request - /// List of user object - /// - Task CreateUsersWithArrayInput(NancyContext context, List body); - - /// - /// - /// - /// Context of request - /// List of user object - /// - Task CreateUsersWithListInput(NancyContext context, List body); - - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// The name that needs to be deleted - /// - Task DeleteUser(NancyContext context, string username); - - /// - /// - /// - /// Context of request - /// The name that needs to be fetched. Use user1 for testing. - /// User - Task GetUserByName(NancyContext context, string username); - - /// - /// - /// - /// Context of request - /// The user name for login - /// The password for login in clear text - /// string - Task LoginUser(NancyContext context, string username, string password); - - /// - /// - /// - /// Context of request - /// - Task LogoutUser(NancyContext context); - - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// name that need to be deleted - /// Updated user object - /// - Task UpdateUser(NancyContext context, string username, User body); - } - - /// - /// Abstraction of UserService. - /// - public abstract class AbstractUserService: UserService - { - public virtual Task CreateUser(NancyContext context, User body) - { - return CreateUser(body); - } - - public virtual Task CreateUsersWithArrayInput(NancyContext context, List body) - { - return CreateUsersWithArrayInput(body); - } - - public virtual Task CreateUsersWithListInput(NancyContext context, List body) - { - return CreateUsersWithListInput(body); - } - - public virtual Task DeleteUser(NancyContext context, string username) - { - return DeleteUser(username); - } - - public virtual Task GetUserByName(NancyContext context, string username) - { - return GetUserByName(username); - } - - public virtual Task LoginUser(NancyContext context, string username, string password) - { - return LoginUser(username, password); - } - - public virtual Task LogoutUser(NancyContext context) - { - return LogoutUser(); - } - - public virtual Task UpdateUser(NancyContext context, string username, User body) - { - return UpdateUser(username, body); - } - - protected abstract Task CreateUser(User body); - - protected abstract Task CreateUsersWithArrayInput(List body); - - protected abstract Task CreateUsersWithListInput(List body); - - protected abstract Task DeleteUser(string username); - - protected abstract Task GetUserByName(string username); - - protected abstract Task LoginUser(string username, string password); - - protected abstract Task LogoutUser(); - - protected abstract Task UpdateUser(string username, User body); - } - -} diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/LocalDateConverter.cs deleted file mode 100644 index d801e962c6a..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/LocalDateConverter.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Nancy.Bootstrapper; -using Nancy.Json; -using NodaTime; -using NodaTime.Text; -using System; -using System.Collections.Generic; - -namespace IO.Swagger.v2.Utils -{ - /// - /// (De)serializes a to a string using - /// the RFC3339 - /// full-date format. - /// - public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup - { - public override IEnumerable SupportedTypes - { - get - { - yield return typeof(LocalDate); - yield return typeof(LocalDate?); - } - } - - public void Initialize(IPipelines pipelines) - { - JsonSettings.PrimitiveConverters.Add(new LocalDateConverter()); - } - - - public override object Serialize(object obj, JavaScriptSerializer serializer) - { - if (obj is LocalDate) - { - LocalDate localDate = (LocalDate)obj; - return LocalDatePattern.IsoPattern.Format(localDate); - } - return null; - } - - public override object Deserialize(object primitiveValue, Type type, JavaScriptSerializer serializer) - { - if ((type == typeof(LocalDate) || type == typeof(LocalDate?)) && primitiveValue is string) - { - try - { - return LocalDatePattern.IsoPattern.Parse(primitiveValue as string).GetValueOrThrow(); - } - catch { } - } - return null; - } - } -} diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/Parameters.cs b/samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/Parameters.cs deleted file mode 100644 index d2198945763..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/Utils/Parameters.cs +++ /dev/null @@ -1,450 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using Nancy; -using NodaTime; -using NodaTime.Text; -using Sharpility.Base; -using Sharpility.Extensions; -using Sharpility.Util; - -namespace IO.Swagger.v2.Utils -{ - internal static class Parameters - { - private static readonly IDictionary> Parsers = CreateParsers(); - - internal static TValue ValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - var valueType = typeof(TValue); - var valueUnderlyingType = Nullable.GetUnderlyingType(valueType); - var isNullable = default(TValue) == null; - string value = RawValueOf(parameters, request, name, parameterType); - Preconditions.Evaluate(!string.IsNullOrEmpty(value) || isNullable, string.Format("Required parameter: '{0}' is missing", name)); - if (value == null && isNullable) - { - return default(TValue); - } - if (valueType.IsEnum || (valueUnderlyingType != null && valueUnderlyingType.IsEnum)) - { - return EnumValueOf(name, value); - } - return ValueOf(parameters, name, value, valueType, request, parameterType); - } - - private static string RawValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - try - { - switch (parameterType) - { - case ParameterType.Query: - string querValue = request.Query[name]; - return querValue; - case ParameterType.Path: - string pathValue = parameters[name]; - return pathValue; - case ParameterType.Header: - var headerValue = request.Headers[name]; - return headerValue != null ? string.Join(",", headerValue) : null; - } - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not obtain value of '{0}' parameter", name), e); - } - throw new InvalidOperationException(string.Format("Parameter with type: {0} is not supported", parameterType)); - } - - private static TValue EnumValueOf(string name, string value) - { - var valueType = typeof(TValue); - var enumType = valueType.IsEnum ? valueType : Nullable.GetUnderlyingType(valueType); - Preconditions.IsNotNull(enumType, () => new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' to enum. Type {1} is not enum", name, valueType))); - var values = Enum.GetValues(enumType); - foreach (var entry in values) - { - if (entry.ToString().EqualsIgnoreCases(value) - || ((int)entry).ToString().EqualsIgnoreCases(value)) - { - return (TValue)entry; - } - } - throw new ArgumentException(string.Format("Parameter: '{0}' value: '{1}' is not supported. Expected one of: {2}", - name, value, Strings.ToString(values))); - } - - private static TValue ValueOf(dynamic parameters, string name, string value, Type valueType, Request request, ParameterType parameterType) - { - var parser = Parsers.GetIfPresent(valueType); - if (parser != null) - { - return ParseValueUsing(name, value, valueType, parser); - } - if (parameterType == ParameterType.Path) - { - return DynamicValueOf(parameters, name); - } - if (parameterType == ParameterType.Query) - { - return DynamicValueOf(request.Query, name); - } - throw new InvalidOperationException(string.Format("Could not get value for {0} with type {1}", name, valueType)); - } - - private static TValue ParseValueUsing(string name, string value, Type valueType, Func parser) - { - var result = parser(Parameter.Of(name, value)); - try - { - return (TValue)result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' with value: '{1}'. " + - "Received: '{2}', expected: '{3}'.", - name, value, result.GetType(), valueType)); - } - } - - private static TValue DynamicValueOf(dynamic parameters, string name) - { - string value = parameters[name]; - try - { - TValue result = parameters[name]; - return result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException(Strings.Format("Parameter: '{0}' value: '{1}' could not be parsed. " + - "Expected type: '{2}' is not supported", - name, value, typeof(TValue))); - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not get '{0}' value of '{1}' type dynamicly", - name, typeof(TValue)), e); - } - } - - private static IDictionary> CreateParsers() - { - var parsers = ImmutableDictionary.CreateBuilder>(); - parsers.Put(typeof(string), value => value.Value); - parsers.Put(typeof(bool), SafeParse(bool.Parse)); - parsers.Put(typeof(bool?), SafeParse(bool.Parse)); - parsers.Put(typeof(byte), SafeParse(byte.Parse)); - parsers.Put(typeof(sbyte?), SafeParse(sbyte.Parse)); - parsers.Put(typeof(short), SafeParse(short.Parse)); - parsers.Put(typeof(short?), SafeParse(short.Parse)); - parsers.Put(typeof(ushort), SafeParse(ushort.Parse)); - parsers.Put(typeof(ushort?), SafeParse(ushort.Parse)); - parsers.Put(typeof(int), SafeParse(int.Parse)); - parsers.Put(typeof(int?), SafeParse(int.Parse)); - parsers.Put(typeof(uint), SafeParse(uint.Parse)); - parsers.Put(typeof(uint?), SafeParse(uint.Parse)); - parsers.Put(typeof(long), SafeParse(long.Parse)); - parsers.Put(typeof(long?), SafeParse(long.Parse)); - parsers.Put(typeof(ulong), SafeParse(ulong.Parse)); - parsers.Put(typeof(ulong?), SafeParse(ulong.Parse)); - parsers.Put(typeof(float), SafeParse(float.Parse)); - parsers.Put(typeof(float?), SafeParse(float.Parse)); - parsers.Put(typeof(double), SafeParse(double.Parse)); - parsers.Put(typeof(double?), SafeParse(double.Parse)); - parsers.Put(typeof(decimal), SafeParse(decimal.Parse)); - parsers.Put(typeof(decimal?), SafeParse(decimal.Parse)); - parsers.Put(typeof(DateTime), SafeParse(DateTime.Parse)); - parsers.Put(typeof(DateTime?), SafeParse(DateTime.Parse)); - parsers.Put(typeof(TimeSpan), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(TimeSpan?), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(ZonedDateTime), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(ZonedDateTime?), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(LocalDate), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalDate?), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalTime), SafeParse(ParseLocalTime)); - parsers.Put(typeof(LocalTime?), SafeParse(ParseLocalTime)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(value => value)); - parsers.Put(typeof(ICollection), ImmutableListParse(value => value)); - parsers.Put(typeof(IList), ImmutableListParse(value => value)); - parsers.Put(typeof(List), ListParse(value => value)); - parsers.Put(typeof(ISet), ImmutableListParse(value => value)); - parsers.Put(typeof(HashSet), SetParse(value => value)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(List), NullableListParse(bool.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(bool.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(bool.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(List), ListParse(byte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(byte.Parse)); - parsers.Put(typeof(HashSet), SetParse(byte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(List), ListParse(sbyte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(sbyte.Parse)); - parsers.Put(typeof(HashSet), SetParse(sbyte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(short.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(short.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(short.Parse)); - parsers.Put(typeof(List), ListParse(short.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(short.Parse)); - parsers.Put(typeof(HashSet), SetParse(short.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(List), ListParse(ushort.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ushort.Parse)); - parsers.Put(typeof(HashSet), SetParse(ushort.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(List), NullableListParse(int.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(int.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(int.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(List), ListParse(uint.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(uint.Parse)); - parsers.Put(typeof(HashSet), SetParse(uint.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(List), NullableListParse(long.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(long.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(long.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(List), ListParse(ulong.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ulong.Parse)); - parsers.Put(typeof(HashSet), SetParse(ulong.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(List), NullableListParse(float.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(float.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(float.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(List), NullableListParse(double.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(double.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(double.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(List), NullableListParse(decimal.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(decimal.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(decimal.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(List), NullableListParse(DateTime.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(DateTime.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(DateTime.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(List), ListParse(TimeSpan.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(TimeSpan.Parse)); - parsers.Put(typeof(HashSet), SetParse(TimeSpan.Parse)); - - return parsers.ToImmutableDictionary(); - } - - private static Func SafeParse(Func parse) - { - return parameter => - { - try - { - return parse(parameter.Value); - } - catch (OverflowException) - { - throw ParameterOutOfRange(parameter, typeof(T)); - } - catch (FormatException) - { - throw InvalidParameterFormat(parameter, typeof(T)); - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse parameter: '{0}' with value: '{1}' to {2}", - parameter.Name, parameter.Value, typeof(T)), e); - } - }; - } - - private static Func NullableListParse(Func itemParser) where T: struct - { - return ListParse(it => it.ToNullable(itemParser)); - } - - private static Func ListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new List(); - } - return ParseCollection(parameter.Value, itemParser).ToList(); - }; - } - - private static Func NullableImmutableListParse(Func itemParser) where T: struct - { - return ImmutableListParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Lists.EmptyList(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableList(); - }; - } - - private static Func NullableSetParse(Func itemParser) where T: struct - { - return SetParse(it => it.ToNullable(itemParser)); - } - - private static Func SetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new HashSet(); - } - return ParseCollection(parameter.Value, itemParser).ToSet(); - }; - } - - private static Func NullableImmutableSetParse(Func itemParser) where T: struct - { - return ImmutableSetParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableSetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Sets.EmptySet(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableHashSet(); - }; - } - - private static ZonedDateTime ParseZonedDateTime(string value) - { - var dateTime = DateTime.Parse(value); - return new ZonedDateTime(Instant.FromDateTimeUtc(dateTime.ToUniversalTime()), DateTimeZone.Utc); - } - - private static LocalDate ParseLocalDate(string value) - { - return LocalDatePattern.IsoPattern.Parse(value).Value; - } - - private static LocalTime ParseLocalTime(string value) - { - return LocalTimePattern.ExtendedIsoPattern.Parse(value).Value; - } - - private static ArgumentException ParameterOutOfRange(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query: '{0}' value: '{1}' is out of range for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static ArgumentException InvalidParameterFormat(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query '{0}' value: '{1}' format is invalid for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static IEnumerable ParseCollection(string value, Func itemParser) - { - var results = value.Split(new[] { ',' }, StringSplitOptions.None) - .Where(it => it != null) - .Select(it => it.Trim()) - .Select(itemParser); - return results; - } - - public static T? ToNullable(this string s, Func itemParser) where T : struct - { - T? result = new T?(); - try - { - if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) - { - result = itemParser(s); - } - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse value: '{0}' to nullable: '{1}'", s, typeof(T).ToString()), e); - } - return result; - } - - private class Parameter - { - internal string Name { get; private set; } - internal string Value { get; private set; } - - private Parameter(string name, string value) - { - Name = name; - Value = value; - } - - internal static Parameter Of(string name, string value) - { - return new Parameter(name, value); - } - } - } - - internal enum ParameterType - { - Undefined, - Query, - Path, - Header - } -} diff --git a/samples/server/petstore/nancyfx-async/src/IO.Swagger/packages.config b/samples/server/petstore/nancyfx-async/src/IO.Swagger/packages.config deleted file mode 100644 index e3401566e5d..00000000000 --- a/samples/server/petstore/nancyfx-async/src/IO.Swagger/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs deleted file mode 100644 index 2c35c0c5fd9..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/ApiResponse.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// Describes the result of uploading an image resource - /// - public sealed class ApiResponse: IEquatable - { - /// - /// Code - /// - public int? Code { get; private set; } - - /// - /// Type - /// - public string Type { get; private set; } - - /// - /// Message - /// - public string Message { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use ApiResponse.Builder() for instance creation instead. - /// - [Obsolete] - public ApiResponse() - { - } - - private ApiResponse(int? Code, string Type, string Message) - { - - this.Code = Code; - - this.Type = Type; - - this.Message = Message; - - } - - /// - /// Returns builder of ApiResponse. - /// - /// ApiResponseBuilder - public static ApiResponseBuilder Builder() - { - return new ApiResponseBuilder(); - } - - /// - /// Returns ApiResponseBuilder with properties set. - /// Use it to change properties. - /// - /// ApiResponseBuilder - public ApiResponseBuilder With() - { - return Builder() - .Code(Code) - .Type(Type) - .Message(Message); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(ApiResponse other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (ApiResponse. - /// - /// Compared (ApiResponse - /// Compared (ApiResponse - /// true if compared items are equals, false otherwise - public static bool operator == (ApiResponse left, ApiResponse right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (ApiResponse. - /// - /// Compared (ApiResponse - /// Compared (ApiResponse - /// true if compared items are not equals, false otherwise - public static bool operator != (ApiResponse left, ApiResponse right) - { - return !Equals(left, right); - } - - /// - /// Builder of ApiResponse. - /// - public sealed class ApiResponseBuilder - { - private int? _Code; - private string _Type; - private string _Message; - - internal ApiResponseBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for ApiResponse.Code property. - /// - /// Code - public ApiResponseBuilder Code(int? value) - { - _Code = value; - return this; - } - - /// - /// Sets value for ApiResponse.Type property. - /// - /// Type - public ApiResponseBuilder Type(string value) - { - _Type = value; - return this; - } - - /// - /// Sets value for ApiResponse.Message property. - /// - /// Message - public ApiResponseBuilder Message(string value) - { - _Message = value; - return this; - } - - - /// - /// Builds instance of ApiResponse. - /// - /// ApiResponse - public ApiResponse Build() - { - Validate(); - return new ApiResponse( - Code: _Code, - Type: _Type, - Message: _Message - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs deleted file mode 100644 index 3cadeec39fe..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Category.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A category for a pet - /// - public sealed class Category: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Category.Builder() for instance creation instead. - /// - [Obsolete] - public Category() - { - } - - private Category(long? Id, string Name) - { - - this.Id = Id; - - this.Name = Name; - - } - - /// - /// Returns builder of Category. - /// - /// CategoryBuilder - public static CategoryBuilder Builder() - { - return new CategoryBuilder(); - } - - /// - /// Returns CategoryBuilder with properties set. - /// Use it to change properties. - /// - /// CategoryBuilder - public CategoryBuilder With() - { - return Builder() - .Id(Id) - .Name(Name); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Category other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Category. - /// - /// Compared (Category - /// Compared (Category - /// true if compared items are equals, false otherwise - public static bool operator == (Category left, Category right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Category. - /// - /// Compared (Category - /// Compared (Category - /// true if compared items are not equals, false otherwise - public static bool operator != (Category left, Category right) - { - return !Equals(left, right); - } - - /// - /// Builder of Category. - /// - public sealed class CategoryBuilder - { - private long? _Id; - private string _Name; - - internal CategoryBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Category.Id property. - /// - /// Id - public CategoryBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Category.Name property. - /// - /// Name - public CategoryBuilder Name(string value) - { - _Name = value; - return this; - } - - - /// - /// Builds instance of Category. - /// - /// Category - public Category Build() - { - Validate(); - return new Category( - Id: _Id, - Name: _Name - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs deleted file mode 100644 index 3ef8e9133c7..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Order.cs +++ /dev/null @@ -1,247 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// An order for a pets from the pet store - /// - public sealed class Order: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// PetId - /// - public long? PetId { get; private set; } - - /// - /// Quantity - /// - public int? Quantity { get; private set; } - - /// - /// ShipDate - /// - public DateTime? ShipDate { get; private set; } - - /// - /// Order Status - /// - public StatusEnum? Status { get; private set; } - - /// - /// Complete - /// - public bool? Complete { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Order.Builder() for instance creation instead. - /// - [Obsolete] - public Order() - { - } - - private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) - { - - this.Id = Id; - - this.PetId = PetId; - - this.Quantity = Quantity; - - this.ShipDate = ShipDate; - - this.Status = Status; - - this.Complete = Complete; - - } - - /// - /// Returns builder of Order. - /// - /// OrderBuilder - public static OrderBuilder Builder() - { - return new OrderBuilder(); - } - - /// - /// Returns OrderBuilder with properties set. - /// Use it to change properties. - /// - /// OrderBuilder - public OrderBuilder With() - { - return Builder() - .Id(Id) - .PetId(PetId) - .Quantity(Quantity) - .ShipDate(ShipDate) - .Status(Status) - .Complete(Complete); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Order other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Order. - /// - /// Compared (Order - /// Compared (Order - /// true if compared items are equals, false otherwise - public static bool operator == (Order left, Order right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Order. - /// - /// Compared (Order - /// Compared (Order - /// true if compared items are not equals, false otherwise - public static bool operator != (Order left, Order right) - { - return !Equals(left, right); - } - - /// - /// Builder of Order. - /// - public sealed class OrderBuilder - { - private long? _Id; - private long? _PetId; - private int? _Quantity; - private DateTime? _ShipDate; - private StatusEnum? _Status; - private bool? _Complete; - - internal OrderBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - _Complete = false; - } - - /// - /// Sets value for Order.Id property. - /// - /// Id - public OrderBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Order.PetId property. - /// - /// PetId - public OrderBuilder PetId(long? value) - { - _PetId = value; - return this; - } - - /// - /// Sets value for Order.Quantity property. - /// - /// Quantity - public OrderBuilder Quantity(int? value) - { - _Quantity = value; - return this; - } - - /// - /// Sets value for Order.ShipDate property. - /// - /// ShipDate - public OrderBuilder ShipDate(DateTime? value) - { - _ShipDate = value; - return this; - } - - /// - /// Sets value for Order.Status property. - /// - /// Order Status - public OrderBuilder Status(StatusEnum? value) - { - _Status = value; - return this; - } - - /// - /// Sets value for Order.Complete property. - /// - /// Complete - public OrderBuilder Complete(bool? value) - { - _Complete = value; - return this; - } - - - /// - /// Builds instance of Order. - /// - /// Order - public Order Build() - { - Validate(); - return new Order( - Id: _Id, - PetId: _PetId, - Quantity: _Quantity, - ShipDate: _ShipDate, - Status: _Status, - Complete: _Complete - ); - } - - private void Validate() - { - } - } - - - public enum StatusEnum { Placed, Approved, Delivered }; - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs deleted file mode 100644 index a9e839bb969..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Pet.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A pet for sale in the pet store - /// - public sealed class Pet: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Category - /// - public Category Category { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - /// - /// PhotoUrls - /// - public List PhotoUrls { get; private set; } - - /// - /// Tags - /// - public List Tags { get; private set; } - - /// - /// pet status in the store - /// - public StatusEnum? Status { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Pet.Builder() for instance creation instead. - /// - [Obsolete] - public Pet() - { - } - - private Pet(long? Id, Category Category, string Name, List PhotoUrls, List Tags, StatusEnum? Status) - { - - this.Id = Id; - - this.Category = Category; - - this.Name = Name; - - this.PhotoUrls = PhotoUrls; - - this.Tags = Tags; - - this.Status = Status; - - } - - /// - /// Returns builder of Pet. - /// - /// PetBuilder - public static PetBuilder Builder() - { - return new PetBuilder(); - } - - /// - /// Returns PetBuilder with properties set. - /// Use it to change properties. - /// - /// PetBuilder - public PetBuilder With() - { - return Builder() - .Id(Id) - .Category(Category) - .Name(Name) - .PhotoUrls(PhotoUrls) - .Tags(Tags) - .Status(Status); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Pet other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Pet. - /// - /// Compared (Pet - /// Compared (Pet - /// true if compared items are equals, false otherwise - public static bool operator == (Pet left, Pet right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Pet. - /// - /// Compared (Pet - /// Compared (Pet - /// true if compared items are not equals, false otherwise - public static bool operator != (Pet left, Pet right) - { - return !Equals(left, right); - } - - /// - /// Builder of Pet. - /// - public sealed class PetBuilder - { - private long? _Id; - private Category _Category; - private string _Name; - private List _PhotoUrls; - private List _Tags; - private StatusEnum? _Status; - - internal PetBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Pet.Id property. - /// - /// Id - public PetBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Pet.Category property. - /// - /// Category - public PetBuilder Category(Category value) - { - _Category = value; - return this; - } - - /// - /// Sets value for Pet.Name property. - /// - /// Name - public PetBuilder Name(string value) - { - _Name = value; - return this; - } - - /// - /// Sets value for Pet.PhotoUrls property. - /// - /// PhotoUrls - public PetBuilder PhotoUrls(List value) - { - _PhotoUrls = value; - return this; - } - - /// - /// Sets value for Pet.Tags property. - /// - /// Tags - public PetBuilder Tags(List value) - { - _Tags = value; - return this; - } - - /// - /// Sets value for Pet.Status property. - /// - /// pet status in the store - public PetBuilder Status(StatusEnum? value) - { - _Status = value; - return this; - } - - - /// - /// Builds instance of Pet. - /// - /// Pet - public Pet Build() - { - Validate(); - return new Pet( - Id: _Id, - Category: _Category, - Name: _Name, - PhotoUrls: _PhotoUrls, - Tags: _Tags, - Status: _Status - ); - } - - private void Validate() - { - if (_Name == null) - { - throw new ArgumentException("Name is a required property for Pet and cannot be null"); - } - if (_PhotoUrls == null) - { - throw new ArgumentException("PhotoUrls is a required property for Pet and cannot be null"); - } - } - } - - - public enum StatusEnum { Available, Pending, Sold }; - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs deleted file mode 100644 index e46182c334c..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/Tag.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A tag for a pet - /// - public sealed class Tag: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Tag.Builder() for instance creation instead. - /// - [Obsolete] - public Tag() - { - } - - private Tag(long? Id, string Name) - { - - this.Id = Id; - - this.Name = Name; - - } - - /// - /// Returns builder of Tag. - /// - /// TagBuilder - public static TagBuilder Builder() - { - return new TagBuilder(); - } - - /// - /// Returns TagBuilder with properties set. - /// Use it to change properties. - /// - /// TagBuilder - public TagBuilder With() - { - return Builder() - .Id(Id) - .Name(Name); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Tag other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Tag. - /// - /// Compared (Tag - /// Compared (Tag - /// true if compared items are equals, false otherwise - public static bool operator == (Tag left, Tag right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Tag. - /// - /// Compared (Tag - /// Compared (Tag - /// true if compared items are not equals, false otherwise - public static bool operator != (Tag left, Tag right) - { - return !Equals(left, right); - } - - /// - /// Builder of Tag. - /// - public sealed class TagBuilder - { - private long? _Id; - private string _Name; - - internal TagBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Tag.Id property. - /// - /// Id - public TagBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Tag.Name property. - /// - /// Name - public TagBuilder Name(string value) - { - _Name = value; - return this; - } - - - /// - /// Builds instance of Tag. - /// - /// Tag - public Tag Build() - { - Validate(); - return new Tag( - Id: _Id, - Name: _Name - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs deleted file mode 100644 index 29c94bbfefe..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Models/User.cs +++ /dev/null @@ -1,285 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A User who is purchasing from the pet store - /// - public sealed class User: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Username - /// - public string Username { get; private set; } - - /// - /// FirstName - /// - public string FirstName { get; private set; } - - /// - /// LastName - /// - public string LastName { get; private set; } - - /// - /// Email - /// - public string Email { get; private set; } - - /// - /// Password - /// - public string Password { get; private set; } - - /// - /// Phone - /// - public string Phone { get; private set; } - - /// - /// User Status - /// - public int? UserStatus { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use User.Builder() for instance creation instead. - /// - [Obsolete] - public User() - { - } - - private User(long? Id, string Username, string FirstName, string LastName, string Email, string Password, string Phone, int? UserStatus) - { - - this.Id = Id; - - this.Username = Username; - - this.FirstName = FirstName; - - this.LastName = LastName; - - this.Email = Email; - - this.Password = Password; - - this.Phone = Phone; - - this.UserStatus = UserStatus; - - } - - /// - /// Returns builder of User. - /// - /// UserBuilder - public static UserBuilder Builder() - { - return new UserBuilder(); - } - - /// - /// Returns UserBuilder with properties set. - /// Use it to change properties. - /// - /// UserBuilder - public UserBuilder With() - { - return Builder() - .Id(Id) - .Username(Username) - .FirstName(FirstName) - .LastName(LastName) - .Email(Email) - .Password(Password) - .Phone(Phone) - .UserStatus(UserStatus); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(User other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (User. - /// - /// Compared (User - /// Compared (User - /// true if compared items are equals, false otherwise - public static bool operator == (User left, User right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (User. - /// - /// Compared (User - /// Compared (User - /// true if compared items are not equals, false otherwise - public static bool operator != (User left, User right) - { - return !Equals(left, right); - } - - /// - /// Builder of User. - /// - public sealed class UserBuilder - { - private long? _Id; - private string _Username; - private string _FirstName; - private string _LastName; - private string _Email; - private string _Password; - private string _Phone; - private int? _UserStatus; - - internal UserBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for User.Id property. - /// - /// Id - public UserBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for User.Username property. - /// - /// Username - public UserBuilder Username(string value) - { - _Username = value; - return this; - } - - /// - /// Sets value for User.FirstName property. - /// - /// FirstName - public UserBuilder FirstName(string value) - { - _FirstName = value; - return this; - } - - /// - /// Sets value for User.LastName property. - /// - /// LastName - public UserBuilder LastName(string value) - { - _LastName = value; - return this; - } - - /// - /// Sets value for User.Email property. - /// - /// Email - public UserBuilder Email(string value) - { - _Email = value; - return this; - } - - /// - /// Sets value for User.Password property. - /// - /// Password - public UserBuilder Password(string value) - { - _Password = value; - return this; - } - - /// - /// Sets value for User.Phone property. - /// - /// Phone - public UserBuilder Phone(string value) - { - _Phone = value; - return this; - } - - /// - /// Sets value for User.UserStatus property. - /// - /// User Status - public UserBuilder UserStatus(int? value) - { - _UserStatus = value; - return this; - } - - - /// - /// Builds instance of User. - /// - /// User - public User Build() - { - Validate(); - return new User( - Id: _Id, - Username: _Username, - FirstName: _FirstName, - LastName: _LastName, - Email: _Email, - Password: _Password, - Phone: _Phone, - UserStatus: _UserStatus - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs deleted file mode 100644 index 7ea7c760147..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/PetModule.cs +++ /dev/null @@ -1,250 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; -using NodaTime; -using System.Threading.Tasks; - -namespace Org.OpenAPITools._v2.Modules -{ - /// - /// Status values that need to be considered for filter - /// - public enum FindPetsByStatusStatusEnum - { - available = 1, - pending = 2, - sold = 3 - }; - - - /// - /// Module processing requests of Pet domain. - /// - public sealed class PetModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public PetModule(PetService service) : base("/v2") - { - Post["/pet", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - - await service.AddPet(Context, body); - return new Response { ContentType = ""}; - }; - - Delete["/pet/{petId}", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var apiKey = Parameters.ValueOf(parameters, Context.Request, "apiKey", ParameterType.Header); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'DeletePet'"); - - await service.DeletePet(Context, petId, apiKey); - return new Response { ContentType = ""}; - }; - - Get["/pet/findByStatus", true] = async (parameters, ct) => - { - var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Query); - Preconditions.IsNotNull(status, "Required parameter: 'status' is missing at 'FindPetsByStatus'"); - - return await service.FindPetsByStatus(Context, status).ToArray(); - }; - - Get["/pet/findByTags", true] = async (parameters, ct) => - { - var tags = Parameters.ValueOf>(parameters, Context.Request, "tags", ParameterType.Query); - Preconditions.IsNotNull(tags, "Required parameter: 'tags' is missing at 'FindPetsByTags'"); - - return await service.FindPetsByTags(Context, tags).ToArray(); - }; - - Get["/pet/{petId}", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'GetPetById'"); - - return await service.GetPetById(Context, petId); - }; - - Put["/pet", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - - await service.UpdatePet(Context, body); - return new Response { ContentType = ""}; - }; - - Post["/pet/{petId}", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var name = Parameters.ValueOf(parameters, Context.Request, "name", ParameterType.Undefined); - var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Undefined); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UpdatePetWithForm'"); - - await service.UpdatePetWithForm(Context, petId, name, status); - return new Response { ContentType = ""}; - }; - - Post["/pet/{petId}/uploadImage", true] = async (parameters, ct) => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var additionalMetadata = Parameters.ValueOf(parameters, Context.Request, "additionalMetadata", ParameterType.Undefined); - var file = Parameters.ValueOf(parameters, Context.Request, "file", ParameterType.Undefined); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UploadFile'"); - - return await service.UploadFile(Context, petId, additionalMetadata, file); - }; - } - } - - /// - /// Service handling Pet requests. - /// - public interface PetService - { - /// - /// - /// - /// Context of request - /// Pet object that needs to be added to the store - /// - Task AddPet(NancyContext context, Pet body); - - /// - /// - /// - /// Context of request - /// Pet id to delete - /// (optional) - /// - Task DeletePet(NancyContext context, long? petId, string apiKey); - - /// - /// Multiple status values can be provided with comma separated strings - /// - /// Context of request - /// Status values that need to be considered for filter - /// List<Pet> - Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status); - - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Context of request - /// Tags to filter by - /// List<Pet> - [Obsolete] - Task> FindPetsByTags(NancyContext context, List tags); - - /// - /// Returns a single pet - /// - /// Context of request - /// ID of pet to return - /// Pet - Task GetPetById(NancyContext context, long? petId); - - /// - /// - /// - /// Context of request - /// Pet object that needs to be added to the store - /// - Task UpdatePet(NancyContext context, Pet body); - - /// - /// - /// - /// Context of request - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) - /// - Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status); - - /// - /// - /// - /// Context of request - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) - /// ApiResponse - Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Abstraction of PetService. - /// - public abstract class AbstractPetService: PetService - { - public virtual Task AddPet(NancyContext context, Pet body) - { - return AddPet(body); - } - - public virtual Task DeletePet(NancyContext context, long? petId, string apiKey) - { - return DeletePet(petId, apiKey); - } - - public virtual Task> FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status) - { - return FindPetsByStatus(status); - } - - [Obsolete] - public virtual Task> FindPetsByTags(NancyContext context, List tags) - { - return FindPetsByTags(tags); - } - - public virtual Task GetPetById(NancyContext context, long? petId) - { - return GetPetById(petId); - } - - public virtual Task UpdatePet(NancyContext context, Pet body) - { - return UpdatePet(body); - } - - public virtual Task UpdatePetWithForm(NancyContext context, long? petId, string name, string status) - { - return UpdatePetWithForm(petId, name, status); - } - - public virtual Task UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file) - { - return UploadFile(petId, additionalMetadata, file); - } - - protected abstract Task AddPet(Pet body); - - protected abstract Task DeletePet(long? petId, string apiKey); - - protected abstract Task> FindPetsByStatus(FindPetsByStatusStatusEnum? status); - - [Obsolete] - protected abstract Task> FindPetsByTags(List tags); - - protected abstract Task GetPetById(long? petId); - - protected abstract Task UpdatePet(Pet body); - - protected abstract Task UpdatePetWithForm(long? petId, string name, string status); - - protected abstract Task UploadFile(long? petId, string additionalMetadata, System.IO.Stream file); - } - -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs deleted file mode 100644 index eed0645da35..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/StoreModule.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; -using NodaTime; -using System.Threading.Tasks; - -namespace Org.OpenAPITools._v2.Modules -{ - - /// - /// Module processing requests of Store domain. - /// - public sealed class StoreModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public StoreModule(StoreService service) : base("/v2") - { - Delete["/store/order/{orderId}", true] = async (parameters, ct) => - { - var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); - Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'DeleteOrder'"); - - await service.DeleteOrder(Context, orderId); - return new Response { ContentType = ""}; - }; - - Get["/store/inventory", true] = async (parameters, ct) => - { - - return await service.GetInventory(Context); - }; - - Get["/store/order/{orderId}", true] = async (parameters, ct) => - { - var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); - Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'GetOrderById'"); - - return await service.GetOrderById(Context, orderId); - }; - - Post["/store/order", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - - return await service.PlaceOrder(Context, body); - }; - } - } - - /// - /// Service handling Store requests. - /// - public interface StoreService - { - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// Context of request - /// ID of the order that needs to be deleted - /// - Task DeleteOrder(NancyContext context, string orderId); - - /// - /// Returns a map of status codes to quantities - /// - /// Context of request - /// Dictionary<string, int?> - Task> GetInventory(NancyContext context); - - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// Context of request - /// ID of pet that needs to be fetched - /// Order - Task GetOrderById(NancyContext context, long? orderId); - - /// - /// - /// - /// Context of request - /// order placed for purchasing the pet - /// Order - Task PlaceOrder(NancyContext context, Order body); - } - - /// - /// Abstraction of StoreService. - /// - public abstract class AbstractStoreService: StoreService - { - public virtual Task DeleteOrder(NancyContext context, string orderId) - { - return DeleteOrder(orderId); - } - - public virtual Task> GetInventory(NancyContext context) - { - return GetInventory(); - } - - public virtual Task GetOrderById(NancyContext context, long? orderId) - { - return GetOrderById(orderId); - } - - public virtual Task PlaceOrder(NancyContext context, Order body) - { - return PlaceOrder(body); - } - - protected abstract Task DeleteOrder(string orderId); - - protected abstract Task> GetInventory(); - - protected abstract Task GetOrderById(long? orderId); - - protected abstract Task PlaceOrder(Order body); - } - -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs deleted file mode 100644 index 23d99c214e4..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Modules/UserModule.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; -using NodaTime; -using System.Threading.Tasks; - -namespace Org.OpenAPITools._v2.Modules -{ - - /// - /// Module processing requests of User domain. - /// - public sealed class UserModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public UserModule(UserService service) : base("/v2") - { - Post["/user", true] = async (parameters, ct) => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - - await service.CreateUser(Context, body); - return new Response { ContentType = ""}; - }; - - Post["/user/createWithArray", true] = async (parameters, ct) => - { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - - await service.CreateUsersWithArrayInput(Context, body); - return new Response { ContentType = ""}; - }; - - Post["/user/createWithList", true] = async (parameters, ct) => - { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - - await service.CreateUsersWithListInput(Context, body); - return new Response { ContentType = ""}; - }; - - Delete["/user/{username}", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'DeleteUser'"); - - await service.DeleteUser(Context, username); - return new Response { ContentType = ""}; - }; - - Get["/user/{username}", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'GetUserByName'"); - - return await service.GetUserByName(Context, username); - }; - - Get["/user/login", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Query); - var password = Parameters.ValueOf(parameters, Context.Request, "password", ParameterType.Query); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'LoginUser'"); - - Preconditions.IsNotNull(password, "Required parameter: 'password' is missing at 'LoginUser'"); - - return await service.LoginUser(Context, username, password); - }; - - Get["/user/logout", true] = async (parameters, ct) => - { - - await service.LogoutUser(Context); - return new Response { ContentType = ""}; - }; - - Put["/user/{username}", true] = async (parameters, ct) => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var body = this.Bind(); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - - await service.UpdateUser(Context, username, body); - return new Response { ContentType = ""}; - }; - } - } - - /// - /// Service handling User requests. - /// - public interface UserService - { - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// Created user object - /// - Task CreateUser(NancyContext context, User body); - - /// - /// - /// - /// Context of request - /// List of user object - /// - Task CreateUsersWithArrayInput(NancyContext context, List body); - - /// - /// - /// - /// Context of request - /// List of user object - /// - Task CreateUsersWithListInput(NancyContext context, List body); - - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// The name that needs to be deleted - /// - Task DeleteUser(NancyContext context, string username); - - /// - /// - /// - /// Context of request - /// The name that needs to be fetched. Use user1 for testing. - /// User - Task GetUserByName(NancyContext context, string username); - - /// - /// - /// - /// Context of request - /// The user name for login - /// The password for login in clear text - /// string - Task LoginUser(NancyContext context, string username, string password); - - /// - /// - /// - /// Context of request - /// - Task LogoutUser(NancyContext context); - - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// name that need to be deleted - /// Updated user object - /// - Task UpdateUser(NancyContext context, string username, User body); - } - - /// - /// Abstraction of UserService. - /// - public abstract class AbstractUserService: UserService - { - public virtual Task CreateUser(NancyContext context, User body) - { - return CreateUser(body); - } - - public virtual Task CreateUsersWithArrayInput(NancyContext context, List body) - { - return CreateUsersWithArrayInput(body); - } - - public virtual Task CreateUsersWithListInput(NancyContext context, List body) - { - return CreateUsersWithListInput(body); - } - - public virtual Task DeleteUser(NancyContext context, string username) - { - return DeleteUser(username); - } - - public virtual Task GetUserByName(NancyContext context, string username) - { - return GetUserByName(username); - } - - public virtual Task LoginUser(NancyContext context, string username, string password) - { - return LoginUser(username, password); - } - - public virtual Task LogoutUser(NancyContext context) - { - return LogoutUser(); - } - - public virtual Task UpdateUser(NancyContext context, string username, User body) - { - return UpdateUser(username, body); - } - - protected abstract Task CreateUser(User body); - - protected abstract Task CreateUsersWithArrayInput(List body); - - protected abstract Task CreateUsersWithListInput(List body); - - protected abstract Task DeleteUser(string username); - - protected abstract Task GetUserByName(string username); - - protected abstract Task LoginUser(string username, string password); - - protected abstract Task LogoutUser(); - - protected abstract Task UpdateUser(string username, User body); - } - -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj deleted file mode 100644 index b26666605cd..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - Debug - AnyCPU - {768B8DC6-54EE-4D40-9B20-7857E1D742A4} - Library - Properties - Org.OpenAPITools._v2 - Org.OpenAPITools - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Org.OpenAPITools.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Org.OpenAPITools.XML - - - - ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\..\packages\NodaTime.1.3.1\lib\net35-Client\NodaTime.dll - True - - - ..\..\packages\Sharpility.1.2.2\lib\net45\Sharpility.dll - True - - - ..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - - - - - - - - - - - - - - - - diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec deleted file mode 100644 index d4ee2fc102a..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Org.OpenAPITools.nuspec +++ /dev/null @@ -1,13 +0,0 @@ - - - - Org.OpenAPITools - Org.OpenAPITools - 1.0.0 - openapi-generator - openapi-generator - false - NancyFx Org.OpenAPITools API - https://www.apache.org/licenses/LICENSE-2.0.html - - \ No newline at end of file diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs deleted file mode 100644 index dd90cbf5133..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Nancy.Bootstrapper; -using Nancy.Json; -using NodaTime; -using NodaTime.Text; -using System; -using System.Collections.Generic; - -namespace Org.OpenAPITools._v2.Utils -{ - /// - /// (De)serializes a to a string using - /// the RFC3339 - /// full-date format. - /// - public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup - { - public override IEnumerable SupportedTypes - { - get - { - yield return typeof(LocalDate); - yield return typeof(LocalDate?); - } - } - - public void Initialize(IPipelines pipelines) - { - JsonSettings.PrimitiveConverters.Add(new LocalDateConverter()); - } - - - public override object Serialize(object obj, JavaScriptSerializer serializer) - { - if (obj is LocalDate) - { - LocalDate localDate = (LocalDate)obj; - return LocalDatePattern.IsoPattern.Format(localDate); - } - return null; - } - - public override object Deserialize(object primitiveValue, Type type, JavaScriptSerializer serializer) - { - if ((type == typeof(LocalDate) || type == typeof(LocalDate?)) && primitiveValue is string) - { - try - { - return LocalDatePattern.IsoPattern.Parse(primitiveValue as string).GetValueOrThrow(); - } - catch { } - } - return null; - } - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs deleted file mode 100644 index 847527a2dbb..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/Utils/Parameters.cs +++ /dev/null @@ -1,450 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using Nancy; -using NodaTime; -using NodaTime.Text; -using Sharpility.Base; -using Sharpility.Extensions; -using Sharpility.Util; - -namespace Org.OpenAPITools._v2.Utils -{ - internal static class Parameters - { - private static readonly IDictionary> Parsers = CreateParsers(); - - internal static TValue ValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - var valueType = typeof(TValue); - var valueUnderlyingType = Nullable.GetUnderlyingType(valueType); - var isNullable = default(TValue) == null; - string value = RawValueOf(parameters, request, name, parameterType); - Preconditions.Evaluate(!string.IsNullOrEmpty(value) || isNullable, string.Format("Required parameter: '{0}' is missing", name)); - if (value == null && isNullable) - { - return default(TValue); - } - if (valueType.IsEnum || (valueUnderlyingType != null && valueUnderlyingType.IsEnum)) - { - return EnumValueOf(name, value); - } - return ValueOf(parameters, name, value, valueType, request, parameterType); - } - - private static string RawValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - try - { - switch (parameterType) - { - case ParameterType.Query: - string querValue = request.Query[name]; - return querValue; - case ParameterType.Path: - string pathValue = parameters[name]; - return pathValue; - case ParameterType.Header: - var headerValue = request.Headers[name]; - return headerValue != null ? string.Join(",", headerValue) : null; - } - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not obtain value of '{0}' parameter", name), e); - } - throw new InvalidOperationException(string.Format("Parameter with type: {0} is not supported", parameterType)); - } - - private static TValue EnumValueOf(string name, string value) - { - var valueType = typeof(TValue); - var enumType = valueType.IsEnum ? valueType : Nullable.GetUnderlyingType(valueType); - Preconditions.IsNotNull(enumType, () => new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' to enum. Type {1} is not enum", name, valueType))); - var values = Enum.GetValues(enumType); - foreach (var entry in values) - { - if (entry.ToString().EqualsIgnoreCases(value) - || ((int)entry).ToString().EqualsIgnoreCases(value)) - { - return (TValue)entry; - } - } - throw new ArgumentException(string.Format("Parameter: '{0}' value: '{1}' is not supported. Expected one of: {2}", - name, value, Strings.ToString(values))); - } - - private static TValue ValueOf(dynamic parameters, string name, string value, Type valueType, Request request, ParameterType parameterType) - { - var parser = Parsers.GetIfPresent(valueType); - if (parser != null) - { - return ParseValueUsing(name, value, valueType, parser); - } - if (parameterType == ParameterType.Path) - { - return DynamicValueOf(parameters, name); - } - if (parameterType == ParameterType.Query) - { - return DynamicValueOf(request.Query, name); - } - throw new InvalidOperationException(string.Format("Could not get value for {0} with type {1}", name, valueType)); - } - - private static TValue ParseValueUsing(string name, string value, Type valueType, Func parser) - { - var result = parser(Parameter.Of(name, value)); - try - { - return (TValue)result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' with value: '{1}'. " + - "Received: '{2}', expected: '{3}'.", - name, value, result.GetType(), valueType)); - } - } - - private static TValue DynamicValueOf(dynamic parameters, string name) - { - string value = parameters[name]; - try - { - TValue result = parameters[name]; - return result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException(Strings.Format("Parameter: '{0}' value: '{1}' could not be parsed. " + - "Expected type: '{2}' is not supported", - name, value, typeof(TValue))); - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not get '{0}' value of '{1}' type dynamicly", - name, typeof(TValue)), e); - } - } - - private static IDictionary> CreateParsers() - { - var parsers = ImmutableDictionary.CreateBuilder>(); - parsers.Put(typeof(string), value => value.Value); - parsers.Put(typeof(bool), SafeParse(bool.Parse)); - parsers.Put(typeof(bool?), SafeParse(bool.Parse)); - parsers.Put(typeof(byte), SafeParse(byte.Parse)); - parsers.Put(typeof(sbyte?), SafeParse(sbyte.Parse)); - parsers.Put(typeof(short), SafeParse(short.Parse)); - parsers.Put(typeof(short?), SafeParse(short.Parse)); - parsers.Put(typeof(ushort), SafeParse(ushort.Parse)); - parsers.Put(typeof(ushort?), SafeParse(ushort.Parse)); - parsers.Put(typeof(int), SafeParse(int.Parse)); - parsers.Put(typeof(int?), SafeParse(int.Parse)); - parsers.Put(typeof(uint), SafeParse(uint.Parse)); - parsers.Put(typeof(uint?), SafeParse(uint.Parse)); - parsers.Put(typeof(long), SafeParse(long.Parse)); - parsers.Put(typeof(long?), SafeParse(long.Parse)); - parsers.Put(typeof(ulong), SafeParse(ulong.Parse)); - parsers.Put(typeof(ulong?), SafeParse(ulong.Parse)); - parsers.Put(typeof(float), SafeParse(float.Parse)); - parsers.Put(typeof(float?), SafeParse(float.Parse)); - parsers.Put(typeof(double), SafeParse(double.Parse)); - parsers.Put(typeof(double?), SafeParse(double.Parse)); - parsers.Put(typeof(decimal), SafeParse(decimal.Parse)); - parsers.Put(typeof(decimal?), SafeParse(decimal.Parse)); - parsers.Put(typeof(DateTime), SafeParse(DateTime.Parse)); - parsers.Put(typeof(DateTime?), SafeParse(DateTime.Parse)); - parsers.Put(typeof(TimeSpan), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(TimeSpan?), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(ZonedDateTime), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(ZonedDateTime?), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(LocalDate), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalDate?), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalTime), SafeParse(ParseLocalTime)); - parsers.Put(typeof(LocalTime?), SafeParse(ParseLocalTime)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(value => value)); - parsers.Put(typeof(ICollection), ImmutableListParse(value => value)); - parsers.Put(typeof(IList), ImmutableListParse(value => value)); - parsers.Put(typeof(List), ListParse(value => value)); - parsers.Put(typeof(ISet), ImmutableListParse(value => value)); - parsers.Put(typeof(HashSet), SetParse(value => value)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(List), NullableListParse(bool.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(bool.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(bool.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(List), ListParse(byte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(byte.Parse)); - parsers.Put(typeof(HashSet), SetParse(byte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(List), ListParse(sbyte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(sbyte.Parse)); - parsers.Put(typeof(HashSet), SetParse(sbyte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(short.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(short.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(short.Parse)); - parsers.Put(typeof(List), ListParse(short.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(short.Parse)); - parsers.Put(typeof(HashSet), SetParse(short.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(List), ListParse(ushort.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ushort.Parse)); - parsers.Put(typeof(HashSet), SetParse(ushort.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(List), NullableListParse(int.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(int.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(int.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(List), ListParse(uint.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(uint.Parse)); - parsers.Put(typeof(HashSet), SetParse(uint.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(List), NullableListParse(long.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(long.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(long.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(List), ListParse(ulong.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ulong.Parse)); - parsers.Put(typeof(HashSet), SetParse(ulong.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(List), NullableListParse(float.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(float.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(float.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(List), NullableListParse(double.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(double.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(double.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(List), NullableListParse(decimal.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(decimal.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(decimal.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(List), NullableListParse(DateTime.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(DateTime.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(DateTime.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(List), ListParse(TimeSpan.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(TimeSpan.Parse)); - parsers.Put(typeof(HashSet), SetParse(TimeSpan.Parse)); - - return parsers.ToImmutableDictionary(); - } - - private static Func SafeParse(Func parse) - { - return parameter => - { - try - { - return parse(parameter.Value); - } - catch (OverflowException) - { - throw ParameterOutOfRange(parameter, typeof(T)); - } - catch (FormatException) - { - throw InvalidParameterFormat(parameter, typeof(T)); - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse parameter: '{0}' with value: '{1}' to {2}", - parameter.Name, parameter.Value, typeof(T)), e); - } - }; - } - - private static Func NullableListParse(Func itemParser) where T: struct - { - return ListParse(it => it.ToNullable(itemParser)); - } - - private static Func ListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new List(); - } - return ParseCollection(parameter.Value, itemParser).ToList(); - }; - } - - private static Func NullableImmutableListParse(Func itemParser) where T: struct - { - return ImmutableListParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Lists.EmptyList(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableList(); - }; - } - - private static Func NullableSetParse(Func itemParser) where T: struct - { - return SetParse(it => it.ToNullable(itemParser)); - } - - private static Func SetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new HashSet(); - } - return ParseCollection(parameter.Value, itemParser).ToSet(); - }; - } - - private static Func NullableImmutableSetParse(Func itemParser) where T: struct - { - return ImmutableSetParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableSetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Sets.EmptySet(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableHashSet(); - }; - } - - private static ZonedDateTime ParseZonedDateTime(string value) - { - var dateTime = DateTime.Parse(value); - return new ZonedDateTime(Instant.FromDateTimeUtc(dateTime.ToUniversalTime()), DateTimeZone.Utc); - } - - private static LocalDate ParseLocalDate(string value) - { - return LocalDatePattern.IsoPattern.Parse(value).Value; - } - - private static LocalTime ParseLocalTime(string value) - { - return LocalTimePattern.ExtendedIsoPattern.Parse(value).Value; - } - - private static ArgumentException ParameterOutOfRange(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query: '{0}' value: '{1}' is out of range for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static ArgumentException InvalidParameterFormat(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query '{0}' value: '{1}' format is invalid for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static IEnumerable ParseCollection(string value, Func itemParser) - { - var results = value.Split(new[] { ',' }, StringSplitOptions.None) - .Where(it => it != null) - .Select(it => it.Trim()) - .Select(itemParser); - return results; - } - - public static T? ToNullable(this string s, Func itemParser) where T : struct - { - T? result = new T?(); - try - { - if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) - { - result = itemParser(s); - } - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse value: '{0}' to nullable: '{1}'", s, typeof(T).ToString()), e); - } - return result; - } - - private class Parameter - { - internal string Name { get; private set; } - internal string Value { get; private set; } - - private Parameter(string name, string value) - { - Name = name; - Value = value; - } - - internal static Parameter Of(string name, string value) - { - return new Parameter(name, value); - } - } - } - - internal enum ParameterType - { - Undefined, - Query, - Path, - Header - } -} diff --git a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config b/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config deleted file mode 100644 index e3401566e5d..00000000000 --- a/samples/server/petstore/nancyfx-async/src/Org.OpenAPITools/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/.gitignore b/samples/server/petstore/nancyfx/.gitignore deleted file mode 100644 index 1ee53850b84..00000000000 --- a/samples/server/petstore/nancyfx/.gitignore +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/samples/server/petstore/nancyfx/.openapi-generator-ignore b/samples/server/petstore/nancyfx/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c5..00000000000 --- a/samples/server/petstore/nancyfx/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# 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 Swagger Codgen 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/server/petstore/nancyfx/.openapi-generator/FILES b/samples/server/petstore/nancyfx/.openapi-generator/FILES deleted file mode 100644 index eabec10a061..00000000000 --- a/samples/server/petstore/nancyfx/.openapi-generator/FILES +++ /dev/null @@ -1,16 +0,0 @@ -.gitignore -Org.OpenAPITools.sln -src/Org.OpenAPITools/Models/ApiResponse.cs -src/Org.OpenAPITools/Models/Category.cs -src/Org.OpenAPITools/Models/Order.cs -src/Org.OpenAPITools/Models/Pet.cs -src/Org.OpenAPITools/Models/Tag.cs -src/Org.OpenAPITools/Models/User.cs -src/Org.OpenAPITools/Modules/PetModule.cs -src/Org.OpenAPITools/Modules/StoreModule.cs -src/Org.OpenAPITools/Modules/UserModule.cs -src/Org.OpenAPITools/Org.OpenAPITools.csproj -src/Org.OpenAPITools/Org.OpenAPITools.nuspec -src/Org.OpenAPITools/Utils/LocalDateConverter.cs -src/Org.OpenAPITools/Utils/Parameters.cs -src/Org.OpenAPITools/packages.config diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/Org.OpenAPITools.sln b/samples/server/petstore/nancyfx/Org.OpenAPITools.sln deleted file mode 100644 index 757078a1383..00000000000 --- a/samples/server/petstore/nancyfx/Org.OpenAPITools.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -VisualStudioVersion = 12.0.0.0 -MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{768B8DC6-54EE-4D40-9B20-7857E1D742A4}" -EndProject -Global -GlobalSection(SolutionConfigurationPlatforms) = preSolution -Debug|Any CPU = Debug|Any CPU -Release|Any CPU = Release|Any CPU -EndGlobalSection -GlobalSection(ProjectConfigurationPlatforms) = postSolution -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Debug|Any CPU.Build.0 = Debug|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.ActiveCfg = Release|Any CPU -{768B8DC6-54EE-4D40-9B20-7857E1D742A4}.Release|Any CPU.Build.0 = Release|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU -{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU -EndGlobalSection -GlobalSection(SolutionProperties) = preSolution -HideSolutionNode = FALSE -EndGlobalSection -EndGlobal \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs deleted file mode 100644 index 2c35c0c5fd9..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// Describes the result of uploading an image resource - /// - public sealed class ApiResponse: IEquatable - { - /// - /// Code - /// - public int? Code { get; private set; } - - /// - /// Type - /// - public string Type { get; private set; } - - /// - /// Message - /// - public string Message { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use ApiResponse.Builder() for instance creation instead. - /// - [Obsolete] - public ApiResponse() - { - } - - private ApiResponse(int? Code, string Type, string Message) - { - - this.Code = Code; - - this.Type = Type; - - this.Message = Message; - - } - - /// - /// Returns builder of ApiResponse. - /// - /// ApiResponseBuilder - public static ApiResponseBuilder Builder() - { - return new ApiResponseBuilder(); - } - - /// - /// Returns ApiResponseBuilder with properties set. - /// Use it to change properties. - /// - /// ApiResponseBuilder - public ApiResponseBuilder With() - { - return Builder() - .Code(Code) - .Type(Type) - .Message(Message); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(ApiResponse other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (ApiResponse. - /// - /// Compared (ApiResponse - /// Compared (ApiResponse - /// true if compared items are equals, false otherwise - public static bool operator == (ApiResponse left, ApiResponse right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (ApiResponse. - /// - /// Compared (ApiResponse - /// Compared (ApiResponse - /// true if compared items are not equals, false otherwise - public static bool operator != (ApiResponse left, ApiResponse right) - { - return !Equals(left, right); - } - - /// - /// Builder of ApiResponse. - /// - public sealed class ApiResponseBuilder - { - private int? _Code; - private string _Type; - private string _Message; - - internal ApiResponseBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for ApiResponse.Code property. - /// - /// Code - public ApiResponseBuilder Code(int? value) - { - _Code = value; - return this; - } - - /// - /// Sets value for ApiResponse.Type property. - /// - /// Type - public ApiResponseBuilder Type(string value) - { - _Type = value; - return this; - } - - /// - /// Sets value for ApiResponse.Message property. - /// - /// Message - public ApiResponseBuilder Message(string value) - { - _Message = value; - return this; - } - - - /// - /// Builds instance of ApiResponse. - /// - /// ApiResponse - public ApiResponse Build() - { - Validate(); - return new ApiResponse( - Code: _Code, - Type: _Type, - Message: _Message - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs deleted file mode 100644 index 3cadeec39fe..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A category for a pet - /// - public sealed class Category: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Category.Builder() for instance creation instead. - /// - [Obsolete] - public Category() - { - } - - private Category(long? Id, string Name) - { - - this.Id = Id; - - this.Name = Name; - - } - - /// - /// Returns builder of Category. - /// - /// CategoryBuilder - public static CategoryBuilder Builder() - { - return new CategoryBuilder(); - } - - /// - /// Returns CategoryBuilder with properties set. - /// Use it to change properties. - /// - /// CategoryBuilder - public CategoryBuilder With() - { - return Builder() - .Id(Id) - .Name(Name); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Category other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Category. - /// - /// Compared (Category - /// Compared (Category - /// true if compared items are equals, false otherwise - public static bool operator == (Category left, Category right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Category. - /// - /// Compared (Category - /// Compared (Category - /// true if compared items are not equals, false otherwise - public static bool operator != (Category left, Category right) - { - return !Equals(left, right); - } - - /// - /// Builder of Category. - /// - public sealed class CategoryBuilder - { - private long? _Id; - private string _Name; - - internal CategoryBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Category.Id property. - /// - /// Id - public CategoryBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Category.Name property. - /// - /// Name - public CategoryBuilder Name(string value) - { - _Name = value; - return this; - } - - - /// - /// Builds instance of Category. - /// - /// Category - public Category Build() - { - Validate(); - return new Category( - Id: _Id, - Name: _Name - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs deleted file mode 100644 index 3ef8e9133c7..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ /dev/null @@ -1,247 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// An order for a pets from the pet store - /// - public sealed class Order: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// PetId - /// - public long? PetId { get; private set; } - - /// - /// Quantity - /// - public int? Quantity { get; private set; } - - /// - /// ShipDate - /// - public DateTime? ShipDate { get; private set; } - - /// - /// Order Status - /// - public StatusEnum? Status { get; private set; } - - /// - /// Complete - /// - public bool? Complete { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Order.Builder() for instance creation instead. - /// - [Obsolete] - public Order() - { - } - - private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) - { - - this.Id = Id; - - this.PetId = PetId; - - this.Quantity = Quantity; - - this.ShipDate = ShipDate; - - this.Status = Status; - - this.Complete = Complete; - - } - - /// - /// Returns builder of Order. - /// - /// OrderBuilder - public static OrderBuilder Builder() - { - return new OrderBuilder(); - } - - /// - /// Returns OrderBuilder with properties set. - /// Use it to change properties. - /// - /// OrderBuilder - public OrderBuilder With() - { - return Builder() - .Id(Id) - .PetId(PetId) - .Quantity(Quantity) - .ShipDate(ShipDate) - .Status(Status) - .Complete(Complete); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Order other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Order. - /// - /// Compared (Order - /// Compared (Order - /// true if compared items are equals, false otherwise - public static bool operator == (Order left, Order right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Order. - /// - /// Compared (Order - /// Compared (Order - /// true if compared items are not equals, false otherwise - public static bool operator != (Order left, Order right) - { - return !Equals(left, right); - } - - /// - /// Builder of Order. - /// - public sealed class OrderBuilder - { - private long? _Id; - private long? _PetId; - private int? _Quantity; - private DateTime? _ShipDate; - private StatusEnum? _Status; - private bool? _Complete; - - internal OrderBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - _Complete = false; - } - - /// - /// Sets value for Order.Id property. - /// - /// Id - public OrderBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Order.PetId property. - /// - /// PetId - public OrderBuilder PetId(long? value) - { - _PetId = value; - return this; - } - - /// - /// Sets value for Order.Quantity property. - /// - /// Quantity - public OrderBuilder Quantity(int? value) - { - _Quantity = value; - return this; - } - - /// - /// Sets value for Order.ShipDate property. - /// - /// ShipDate - public OrderBuilder ShipDate(DateTime? value) - { - _ShipDate = value; - return this; - } - - /// - /// Sets value for Order.Status property. - /// - /// Order Status - public OrderBuilder Status(StatusEnum? value) - { - _Status = value; - return this; - } - - /// - /// Sets value for Order.Complete property. - /// - /// Complete - public OrderBuilder Complete(bool? value) - { - _Complete = value; - return this; - } - - - /// - /// Builds instance of Order. - /// - /// Order - public Order Build() - { - Validate(); - return new Order( - Id: _Id, - PetId: _PetId, - Quantity: _Quantity, - ShipDate: _ShipDate, - Status: _Status, - Complete: _Complete - ); - } - - private void Validate() - { - } - } - - - public enum StatusEnum { Placed, Approved, Delivered }; - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs deleted file mode 100644 index a9e839bb969..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A pet for sale in the pet store - /// - public sealed class Pet: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Category - /// - public Category Category { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - /// - /// PhotoUrls - /// - public List PhotoUrls { get; private set; } - - /// - /// Tags - /// - public List Tags { get; private set; } - - /// - /// pet status in the store - /// - public StatusEnum? Status { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Pet.Builder() for instance creation instead. - /// - [Obsolete] - public Pet() - { - } - - private Pet(long? Id, Category Category, string Name, List PhotoUrls, List Tags, StatusEnum? Status) - { - - this.Id = Id; - - this.Category = Category; - - this.Name = Name; - - this.PhotoUrls = PhotoUrls; - - this.Tags = Tags; - - this.Status = Status; - - } - - /// - /// Returns builder of Pet. - /// - /// PetBuilder - public static PetBuilder Builder() - { - return new PetBuilder(); - } - - /// - /// Returns PetBuilder with properties set. - /// Use it to change properties. - /// - /// PetBuilder - public PetBuilder With() - { - return Builder() - .Id(Id) - .Category(Category) - .Name(Name) - .PhotoUrls(PhotoUrls) - .Tags(Tags) - .Status(Status); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Pet other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Pet. - /// - /// Compared (Pet - /// Compared (Pet - /// true if compared items are equals, false otherwise - public static bool operator == (Pet left, Pet right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Pet. - /// - /// Compared (Pet - /// Compared (Pet - /// true if compared items are not equals, false otherwise - public static bool operator != (Pet left, Pet right) - { - return !Equals(left, right); - } - - /// - /// Builder of Pet. - /// - public sealed class PetBuilder - { - private long? _Id; - private Category _Category; - private string _Name; - private List _PhotoUrls; - private List _Tags; - private StatusEnum? _Status; - - internal PetBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Pet.Id property. - /// - /// Id - public PetBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Pet.Category property. - /// - /// Category - public PetBuilder Category(Category value) - { - _Category = value; - return this; - } - - /// - /// Sets value for Pet.Name property. - /// - /// Name - public PetBuilder Name(string value) - { - _Name = value; - return this; - } - - /// - /// Sets value for Pet.PhotoUrls property. - /// - /// PhotoUrls - public PetBuilder PhotoUrls(List value) - { - _PhotoUrls = value; - return this; - } - - /// - /// Sets value for Pet.Tags property. - /// - /// Tags - public PetBuilder Tags(List value) - { - _Tags = value; - return this; - } - - /// - /// Sets value for Pet.Status property. - /// - /// pet status in the store - public PetBuilder Status(StatusEnum? value) - { - _Status = value; - return this; - } - - - /// - /// Builds instance of Pet. - /// - /// Pet - public Pet Build() - { - Validate(); - return new Pet( - Id: _Id, - Category: _Category, - Name: _Name, - PhotoUrls: _PhotoUrls, - Tags: _Tags, - Status: _Status - ); - } - - private void Validate() - { - if (_Name == null) - { - throw new ArgumentException("Name is a required property for Pet and cannot be null"); - } - if (_PhotoUrls == null) - { - throw new ArgumentException("PhotoUrls is a required property for Pet and cannot be null"); - } - } - } - - - public enum StatusEnum { Available, Pending, Sold }; - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs deleted file mode 100644 index e46182c334c..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A tag for a pet - /// - public sealed class Tag: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Name - /// - public string Name { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use Tag.Builder() for instance creation instead. - /// - [Obsolete] - public Tag() - { - } - - private Tag(long? Id, string Name) - { - - this.Id = Id; - - this.Name = Name; - - } - - /// - /// Returns builder of Tag. - /// - /// TagBuilder - public static TagBuilder Builder() - { - return new TagBuilder(); - } - - /// - /// Returns TagBuilder with properties set. - /// Use it to change properties. - /// - /// TagBuilder - public TagBuilder With() - { - return Builder() - .Id(Id) - .Name(Name); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(Tag other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (Tag. - /// - /// Compared (Tag - /// Compared (Tag - /// true if compared items are equals, false otherwise - public static bool operator == (Tag left, Tag right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (Tag. - /// - /// Compared (Tag - /// Compared (Tag - /// true if compared items are not equals, false otherwise - public static bool operator != (Tag left, Tag right) - { - return !Equals(left, right); - } - - /// - /// Builder of Tag. - /// - public sealed class TagBuilder - { - private long? _Id; - private string _Name; - - internal TagBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for Tag.Id property. - /// - /// Id - public TagBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for Tag.Name property. - /// - /// Name - public TagBuilder Name(string value) - { - _Name = value; - return this; - } - - - /// - /// Builds instance of Tag. - /// - /// Tag - public Tag Build() - { - Validate(); - return new Tag( - Id: _Id, - Name: _Name - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs deleted file mode 100644 index 29c94bbfefe..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ /dev/null @@ -1,285 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Sharpility.Extensions; -using NodaTime; - -namespace Org.OpenAPITools._v2.Models -{ - /// - /// A User who is purchasing from the pet store - /// - public sealed class User: IEquatable - { - /// - /// Id - /// - public long? Id { get; private set; } - - /// - /// Username - /// - public string Username { get; private set; } - - /// - /// FirstName - /// - public string FirstName { get; private set; } - - /// - /// LastName - /// - public string LastName { get; private set; } - - /// - /// Email - /// - public string Email { get; private set; } - - /// - /// Password - /// - public string Password { get; private set; } - - /// - /// Phone - /// - public string Phone { get; private set; } - - /// - /// User Status - /// - public int? UserStatus { get; private set; } - - - /// - /// Empty constructor required by some serializers. - /// Use User.Builder() for instance creation instead. - /// - [Obsolete] - public User() - { - } - - private User(long? Id, string Username, string FirstName, string LastName, string Email, string Password, string Phone, int? UserStatus) - { - - this.Id = Id; - - this.Username = Username; - - this.FirstName = FirstName; - - this.LastName = LastName; - - this.Email = Email; - - this.Password = Password; - - this.Phone = Phone; - - this.UserStatus = UserStatus; - - } - - /// - /// Returns builder of User. - /// - /// UserBuilder - public static UserBuilder Builder() - { - return new UserBuilder(); - } - - /// - /// Returns UserBuilder with properties set. - /// Use it to change properties. - /// - /// UserBuilder - public UserBuilder With() - { - return Builder() - .Id(Id) - .Username(Username) - .FirstName(FirstName) - .LastName(LastName) - .Email(Email) - .Password(Password) - .Phone(Phone) - .UserStatus(UserStatus); - } - - public override string ToString() - { - return this.PropertiesToString(); - } - - public override bool Equals(object obj) - { - return this.EqualsByProperties(obj); - } - - public bool Equals(User other) - { - return Equals((object) other); - } - - public override int GetHashCode() - { - return this.PropertiesHash(); - } - - /// - /// Implementation of == operator for (User. - /// - /// Compared (User - /// Compared (User - /// true if compared items are equals, false otherwise - public static bool operator == (User left, User right) - { - return Equals(left, right); - } - - /// - /// Implementation of != operator for (User. - /// - /// Compared (User - /// Compared (User - /// true if compared items are not equals, false otherwise - public static bool operator != (User left, User right) - { - return !Equals(left, right); - } - - /// - /// Builder of User. - /// - public sealed class UserBuilder - { - private long? _Id; - private string _Username; - private string _FirstName; - private string _LastName; - private string _Email; - private string _Password; - private string _Phone; - private int? _UserStatus; - - internal UserBuilder() - { - SetupDefaults(); - } - - private void SetupDefaults() - { - } - - /// - /// Sets value for User.Id property. - /// - /// Id - public UserBuilder Id(long? value) - { - _Id = value; - return this; - } - - /// - /// Sets value for User.Username property. - /// - /// Username - public UserBuilder Username(string value) - { - _Username = value; - return this; - } - - /// - /// Sets value for User.FirstName property. - /// - /// FirstName - public UserBuilder FirstName(string value) - { - _FirstName = value; - return this; - } - - /// - /// Sets value for User.LastName property. - /// - /// LastName - public UserBuilder LastName(string value) - { - _LastName = value; - return this; - } - - /// - /// Sets value for User.Email property. - /// - /// Email - public UserBuilder Email(string value) - { - _Email = value; - return this; - } - - /// - /// Sets value for User.Password property. - /// - /// Password - public UserBuilder Password(string value) - { - _Password = value; - return this; - } - - /// - /// Sets value for User.Phone property. - /// - /// Phone - public UserBuilder Phone(string value) - { - _Phone = value; - return this; - } - - /// - /// Sets value for User.UserStatus property. - /// - /// User Status - public UserBuilder UserStatus(int? value) - { - _UserStatus = value; - return this; - } - - - /// - /// Builds instance of User. - /// - /// User - public User Build() - { - Validate(); - return new User( - Id: _Id, - Username: _Username, - FirstName: _FirstName, - LastName: _LastName, - Email: _Email, - Password: _Password, - Phone: _Phone, - UserStatus: _UserStatus - ); - } - - private void Validate() - { - } - } - - - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs deleted file mode 100644 index 8dc52f8275b..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ /dev/null @@ -1,249 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; -using NodaTime; - -namespace Org.OpenAPITools._v2.Modules -{ - /// - /// Status values that need to be considered for filter - /// - public enum FindPetsByStatusStatusEnum - { - available = 1, - pending = 2, - sold = 3 - }; - - - /// - /// Module processing requests of Pet domain. - /// - public sealed class PetModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public PetModule(PetService service) : base("/v2") - { - Post["/pet"] = parameters => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - - service.AddPet(Context, body); - return new Response { ContentType = ""}; - }; - - Delete["/pet/{petId}"] = parameters => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var apiKey = Parameters.ValueOf(parameters, Context.Request, "apiKey", ParameterType.Header); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'DeletePet'"); - - service.DeletePet(Context, petId, apiKey); - return new Response { ContentType = ""}; - }; - - Get["/pet/findByStatus"] = parameters => - { - var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Query); - Preconditions.IsNotNull(status, "Required parameter: 'status' is missing at 'FindPetsByStatus'"); - - return service.FindPetsByStatus(Context, status).ToArray(); - }; - - Get["/pet/findByTags"] = parameters => - { - var tags = Parameters.ValueOf>(parameters, Context.Request, "tags", ParameterType.Query); - Preconditions.IsNotNull(tags, "Required parameter: 'tags' is missing at 'FindPetsByTags'"); - - return service.FindPetsByTags(Context, tags).ToArray(); - }; - - Get["/pet/{petId}"] = parameters => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'GetPetById'"); - - return service.GetPetById(Context, petId); - }; - - Put["/pet"] = parameters => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - - service.UpdatePet(Context, body); - return new Response { ContentType = ""}; - }; - - Post["/pet/{petId}"] = parameters => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var name = Parameters.ValueOf(parameters, Context.Request, "name", ParameterType.Undefined); - var status = Parameters.ValueOf(parameters, Context.Request, "status", ParameterType.Undefined); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UpdatePetWithForm'"); - - service.UpdatePetWithForm(Context, petId, name, status); - return new Response { ContentType = ""}; - }; - - Post["/pet/{petId}/uploadImage"] = parameters => - { - var petId = Parameters.ValueOf(parameters, Context.Request, "petId", ParameterType.Path); - var additionalMetadata = Parameters.ValueOf(parameters, Context.Request, "additionalMetadata", ParameterType.Undefined); - var file = Parameters.ValueOf(parameters, Context.Request, "file", ParameterType.Undefined); - Preconditions.IsNotNull(petId, "Required parameter: 'petId' is missing at 'UploadFile'"); - - return service.UploadFile(Context, petId, additionalMetadata, file); - }; - } - } - - /// - /// Service handling Pet requests. - /// - public interface PetService - { - /// - /// - /// - /// Context of request - /// Pet object that needs to be added to the store - /// - void AddPet(NancyContext context, Pet body); - - /// - /// - /// - /// Context of request - /// Pet id to delete - /// (optional) - /// - void DeletePet(NancyContext context, long? petId, string apiKey); - - /// - /// Multiple status values can be provided with comma separated strings - /// - /// Context of request - /// Status values that need to be considered for filter - /// List<Pet> - List FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status); - - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Context of request - /// Tags to filter by - /// List<Pet> - [Obsolete] - List FindPetsByTags(NancyContext context, List tags); - - /// - /// Returns a single pet - /// - /// Context of request - /// ID of pet to return - /// Pet - Pet GetPetById(NancyContext context, long? petId); - - /// - /// - /// - /// Context of request - /// Pet object that needs to be added to the store - /// - void UpdatePet(NancyContext context, Pet body); - - /// - /// - /// - /// Context of request - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) - /// - void UpdatePetWithForm(NancyContext context, long? petId, string name, string status); - - /// - /// - /// - /// Context of request - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) - /// ApiResponse - ApiResponse UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file); - } - - /// - /// Abstraction of PetService. - /// - public abstract class AbstractPetService: PetService - { - public virtual void AddPet(NancyContext context, Pet body) - { - AddPet(body); - } - - public virtual void DeletePet(NancyContext context, long? petId, string apiKey) - { - DeletePet(petId, apiKey); - } - - public virtual List FindPetsByStatus(NancyContext context, FindPetsByStatusStatusEnum? status) - { - return FindPetsByStatus(status); - } - - [Obsolete] - public virtual List FindPetsByTags(NancyContext context, List tags) - { - return FindPetsByTags(tags); - } - - public virtual Pet GetPetById(NancyContext context, long? petId) - { - return GetPetById(petId); - } - - public virtual void UpdatePet(NancyContext context, Pet body) - { - UpdatePet(body); - } - - public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) - { - UpdatePetWithForm(petId, name, status); - } - - public virtual ApiResponse UploadFile(NancyContext context, long? petId, string additionalMetadata, System.IO.Stream file) - { - return UploadFile(petId, additionalMetadata, file); - } - - protected abstract void AddPet(Pet body); - - protected abstract void DeletePet(long? petId, string apiKey); - - protected abstract List FindPetsByStatus(FindPetsByStatusStatusEnum? status); - - [Obsolete] - protected abstract List FindPetsByTags(List tags); - - protected abstract Pet GetPetById(long? petId); - - protected abstract void UpdatePet(Pet body); - - protected abstract void UpdatePetWithForm(long? petId, string name, string status); - - protected abstract ApiResponse UploadFile(long? petId, string additionalMetadata, System.IO.Stream file); - } - -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs deleted file mode 100644 index 0c75b02fd9a..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; -using NodaTime; - -namespace Org.OpenAPITools._v2.Modules -{ - - /// - /// Module processing requests of Store domain. - /// - public sealed class StoreModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public StoreModule(StoreService service) : base("/v2") - { - Delete["/store/order/{orderId}"] = parameters => - { - var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); - Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'DeleteOrder'"); - - service.DeleteOrder(Context, orderId); - return new Response { ContentType = ""}; - }; - - Get["/store/inventory"] = parameters => - { - - return service.GetInventory(Context); - }; - - Get["/store/order/{orderId}"] = parameters => - { - var orderId = Parameters.ValueOf(parameters, Context.Request, "orderId", ParameterType.Path); - Preconditions.IsNotNull(orderId, "Required parameter: 'orderId' is missing at 'GetOrderById'"); - - return service.GetOrderById(Context, orderId); - }; - - Post["/store/order"] = parameters => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - - return service.PlaceOrder(Context, body); - }; - } - } - - /// - /// Service handling Store requests. - /// - public interface StoreService - { - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// Context of request - /// ID of the order that needs to be deleted - /// - void DeleteOrder(NancyContext context, string orderId); - - /// - /// Returns a map of status codes to quantities - /// - /// Context of request - /// Dictionary<string, int?> - Dictionary GetInventory(NancyContext context); - - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// Context of request - /// ID of pet that needs to be fetched - /// Order - Order GetOrderById(NancyContext context, long? orderId); - - /// - /// - /// - /// Context of request - /// order placed for purchasing the pet - /// Order - Order PlaceOrder(NancyContext context, Order body); - } - - /// - /// Abstraction of StoreService. - /// - public abstract class AbstractStoreService: StoreService - { - public virtual void DeleteOrder(NancyContext context, string orderId) - { - DeleteOrder(orderId); - } - - public virtual Dictionary GetInventory(NancyContext context) - { - return GetInventory(); - } - - public virtual Order GetOrderById(NancyContext context, long? orderId) - { - return GetOrderById(orderId); - } - - public virtual Order PlaceOrder(NancyContext context, Order body) - { - return PlaceOrder(body); - } - - protected abstract void DeleteOrder(string orderId); - - protected abstract Dictionary GetInventory(); - - protected abstract Order GetOrderById(long? orderId); - - protected abstract Order PlaceOrder(Order body); - } - -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs deleted file mode 100644 index cc268b9a2c5..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ /dev/null @@ -1,233 +0,0 @@ -using System; -using Nancy; -using Nancy.ModelBinding; -using System.Collections.Generic; -using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; -using NodaTime; - -namespace Org.OpenAPITools._v2.Modules -{ - - /// - /// Module processing requests of User domain. - /// - public sealed class UserModule : NancyModule - { - /// - /// Sets up HTTP methods mappings. - /// - /// Service handling requests - public UserModule(UserService service) : base("/v2") - { - Post["/user"] = parameters => - { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - - service.CreateUser(Context, body); - return new Response { ContentType = ""}; - }; - - Post["/user/createWithArray"] = parameters => - { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - - service.CreateUsersWithArrayInput(Context, body); - return new Response { ContentType = ""}; - }; - - Post["/user/createWithList"] = parameters => - { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - - service.CreateUsersWithListInput(Context, body); - return new Response { ContentType = ""}; - }; - - Delete["/user/{username}"] = parameters => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'DeleteUser'"); - - service.DeleteUser(Context, username); - return new Response { ContentType = ""}; - }; - - Get["/user/{username}"] = parameters => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'GetUserByName'"); - - return service.GetUserByName(Context, username); - }; - - Get["/user/login"] = parameters => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Query); - var password = Parameters.ValueOf(parameters, Context.Request, "password", ParameterType.Query); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'LoginUser'"); - - Preconditions.IsNotNull(password, "Required parameter: 'password' is missing at 'LoginUser'"); - - return service.LoginUser(Context, username, password); - }; - - Get["/user/logout"] = parameters => - { - - service.LogoutUser(Context); - return new Response { ContentType = ""}; - }; - - Put["/user/{username}"] = parameters => - { - var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var body = this.Bind(); - Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - - service.UpdateUser(Context, username, body); - return new Response { ContentType = ""}; - }; - } - } - - /// - /// Service handling User requests. - /// - public interface UserService - { - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// Created user object - /// - void CreateUser(NancyContext context, User body); - - /// - /// - /// - /// Context of request - /// List of user object - /// - void CreateUsersWithArrayInput(NancyContext context, List body); - - /// - /// - /// - /// Context of request - /// List of user object - /// - void CreateUsersWithListInput(NancyContext context, List body); - - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// The name that needs to be deleted - /// - void DeleteUser(NancyContext context, string username); - - /// - /// - /// - /// Context of request - /// The name that needs to be fetched. Use user1 for testing. - /// User - User GetUserByName(NancyContext context, string username); - - /// - /// - /// - /// Context of request - /// The user name for login - /// The password for login in clear text - /// string - string LoginUser(NancyContext context, string username, string password); - - /// - /// - /// - /// Context of request - /// - void LogoutUser(NancyContext context); - - /// - /// This can only be done by the logged in user. - /// - /// Context of request - /// name that need to be deleted - /// Updated user object - /// - void UpdateUser(NancyContext context, string username, User body); - } - - /// - /// Abstraction of UserService. - /// - public abstract class AbstractUserService: UserService - { - public virtual void CreateUser(NancyContext context, User body) - { - CreateUser(body); - } - - public virtual void CreateUsersWithArrayInput(NancyContext context, List body) - { - CreateUsersWithArrayInput(body); - } - - public virtual void CreateUsersWithListInput(NancyContext context, List body) - { - CreateUsersWithListInput(body); - } - - public virtual void DeleteUser(NancyContext context, string username) - { - DeleteUser(username); - } - - public virtual User GetUserByName(NancyContext context, string username) - { - return GetUserByName(username); - } - - public virtual string LoginUser(NancyContext context, string username, string password) - { - return LoginUser(username, password); - } - - public virtual void LogoutUser(NancyContext context) - { - LogoutUser(); - } - - public virtual void UpdateUser(NancyContext context, string username, User body) - { - UpdateUser(username, body); - } - - protected abstract void CreateUser(User body); - - protected abstract void CreateUsersWithArrayInput(List body); - - protected abstract void CreateUsersWithListInput(List body); - - protected abstract void DeleteUser(string username); - - protected abstract User GetUserByName(string username); - - protected abstract string LoginUser(string username, string password); - - protected abstract void LogoutUser(); - - protected abstract void UpdateUser(string username, User body); - } - -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj deleted file mode 100644 index b26666605cd..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - Debug - AnyCPU - {768B8DC6-54EE-4D40-9B20-7857E1D742A4} - Library - Properties - Org.OpenAPITools._v2 - Org.OpenAPITools - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Org.OpenAPITools.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Org.OpenAPITools.XML - - - - ..\..\packages\Nancy.1.4.3\lib\net40\Nancy.dll - True - - - ..\..\packages\NodaTime.1.3.1\lib\net35-Client\NodaTime.dll - True - - - ..\..\packages\Sharpility.1.2.2\lib\net45\Sharpility.dll - True - - - ..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - - - - - - - - - - - - - - - - diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.nuspec deleted file mode 100644 index d4ee2fc102a..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.nuspec +++ /dev/null @@ -1,13 +0,0 @@ - - - - Org.OpenAPITools - Org.OpenAPITools - 1.0.0 - openapi-generator - openapi-generator - false - NancyFx Org.OpenAPITools API - https://www.apache.org/licenses/LICENSE-2.0.html - - \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs deleted file mode 100644 index dd90cbf5133..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Nancy.Bootstrapper; -using Nancy.Json; -using NodaTime; -using NodaTime.Text; -using System; -using System.Collections.Generic; - -namespace Org.OpenAPITools._v2.Utils -{ - /// - /// (De)serializes a to a string using - /// the RFC3339 - /// full-date format. - /// - public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup - { - public override IEnumerable SupportedTypes - { - get - { - yield return typeof(LocalDate); - yield return typeof(LocalDate?); - } - } - - public void Initialize(IPipelines pipelines) - { - JsonSettings.PrimitiveConverters.Add(new LocalDateConverter()); - } - - - public override object Serialize(object obj, JavaScriptSerializer serializer) - { - if (obj is LocalDate) - { - LocalDate localDate = (LocalDate)obj; - return LocalDatePattern.IsoPattern.Format(localDate); - } - return null; - } - - public override object Deserialize(object primitiveValue, Type type, JavaScriptSerializer serializer) - { - if ((type == typeof(LocalDate) || type == typeof(LocalDate?)) && primitiveValue is string) - { - try - { - return LocalDatePattern.IsoPattern.Parse(primitiveValue as string).GetValueOrThrow(); - } - catch { } - } - return null; - } - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs deleted file mode 100644 index 847527a2dbb..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ /dev/null @@ -1,450 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using Nancy; -using NodaTime; -using NodaTime.Text; -using Sharpility.Base; -using Sharpility.Extensions; -using Sharpility.Util; - -namespace Org.OpenAPITools._v2.Utils -{ - internal static class Parameters - { - private static readonly IDictionary> Parsers = CreateParsers(); - - internal static TValue ValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - var valueType = typeof(TValue); - var valueUnderlyingType = Nullable.GetUnderlyingType(valueType); - var isNullable = default(TValue) == null; - string value = RawValueOf(parameters, request, name, parameterType); - Preconditions.Evaluate(!string.IsNullOrEmpty(value) || isNullable, string.Format("Required parameter: '{0}' is missing", name)); - if (value == null && isNullable) - { - return default(TValue); - } - if (valueType.IsEnum || (valueUnderlyingType != null && valueUnderlyingType.IsEnum)) - { - return EnumValueOf(name, value); - } - return ValueOf(parameters, name, value, valueType, request, parameterType); - } - - private static string RawValueOf(dynamic parameters, Request request, string name, ParameterType parameterType) - { - try - { - switch (parameterType) - { - case ParameterType.Query: - string querValue = request.Query[name]; - return querValue; - case ParameterType.Path: - string pathValue = parameters[name]; - return pathValue; - case ParameterType.Header: - var headerValue = request.Headers[name]; - return headerValue != null ? string.Join(",", headerValue) : null; - } - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not obtain value of '{0}' parameter", name), e); - } - throw new InvalidOperationException(string.Format("Parameter with type: {0} is not supported", parameterType)); - } - - private static TValue EnumValueOf(string name, string value) - { - var valueType = typeof(TValue); - var enumType = valueType.IsEnum ? valueType : Nullable.GetUnderlyingType(valueType); - Preconditions.IsNotNull(enumType, () => new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' to enum. Type {1} is not enum", name, valueType))); - var values = Enum.GetValues(enumType); - foreach (var entry in values) - { - if (entry.ToString().EqualsIgnoreCases(value) - || ((int)entry).ToString().EqualsIgnoreCases(value)) - { - return (TValue)entry; - } - } - throw new ArgumentException(string.Format("Parameter: '{0}' value: '{1}' is not supported. Expected one of: {2}", - name, value, Strings.ToString(values))); - } - - private static TValue ValueOf(dynamic parameters, string name, string value, Type valueType, Request request, ParameterType parameterType) - { - var parser = Parsers.GetIfPresent(valueType); - if (parser != null) - { - return ParseValueUsing(name, value, valueType, parser); - } - if (parameterType == ParameterType.Path) - { - return DynamicValueOf(parameters, name); - } - if (parameterType == ParameterType.Query) - { - return DynamicValueOf(request.Query, name); - } - throw new InvalidOperationException(string.Format("Could not get value for {0} with type {1}", name, valueType)); - } - - private static TValue ParseValueUsing(string name, string value, Type valueType, Func parser) - { - var result = parser(Parameter.Of(name, value)); - try - { - return (TValue)result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException( - string.Format("Could not parse parameter: '{0}' with value: '{1}'. " + - "Received: '{2}', expected: '{3}'.", - name, value, result.GetType(), valueType)); - } - } - - private static TValue DynamicValueOf(dynamic parameters, string name) - { - string value = parameters[name]; - try - { - TValue result = parameters[name]; - return result; - } - catch (InvalidCastException) - { - throw new InvalidOperationException(Strings.Format("Parameter: '{0}' value: '{1}' could not be parsed. " + - "Expected type: '{2}' is not supported", - name, value, typeof(TValue))); - } - catch (Exception e) - { - throw new InvalidOperationException(string.Format("Could not get '{0}' value of '{1}' type dynamicly", - name, typeof(TValue)), e); - } - } - - private static IDictionary> CreateParsers() - { - var parsers = ImmutableDictionary.CreateBuilder>(); - parsers.Put(typeof(string), value => value.Value); - parsers.Put(typeof(bool), SafeParse(bool.Parse)); - parsers.Put(typeof(bool?), SafeParse(bool.Parse)); - parsers.Put(typeof(byte), SafeParse(byte.Parse)); - parsers.Put(typeof(sbyte?), SafeParse(sbyte.Parse)); - parsers.Put(typeof(short), SafeParse(short.Parse)); - parsers.Put(typeof(short?), SafeParse(short.Parse)); - parsers.Put(typeof(ushort), SafeParse(ushort.Parse)); - parsers.Put(typeof(ushort?), SafeParse(ushort.Parse)); - parsers.Put(typeof(int), SafeParse(int.Parse)); - parsers.Put(typeof(int?), SafeParse(int.Parse)); - parsers.Put(typeof(uint), SafeParse(uint.Parse)); - parsers.Put(typeof(uint?), SafeParse(uint.Parse)); - parsers.Put(typeof(long), SafeParse(long.Parse)); - parsers.Put(typeof(long?), SafeParse(long.Parse)); - parsers.Put(typeof(ulong), SafeParse(ulong.Parse)); - parsers.Put(typeof(ulong?), SafeParse(ulong.Parse)); - parsers.Put(typeof(float), SafeParse(float.Parse)); - parsers.Put(typeof(float?), SafeParse(float.Parse)); - parsers.Put(typeof(double), SafeParse(double.Parse)); - parsers.Put(typeof(double?), SafeParse(double.Parse)); - parsers.Put(typeof(decimal), SafeParse(decimal.Parse)); - parsers.Put(typeof(decimal?), SafeParse(decimal.Parse)); - parsers.Put(typeof(DateTime), SafeParse(DateTime.Parse)); - parsers.Put(typeof(DateTime?), SafeParse(DateTime.Parse)); - parsers.Put(typeof(TimeSpan), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(TimeSpan?), SafeParse(TimeSpan.Parse)); - parsers.Put(typeof(ZonedDateTime), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(ZonedDateTime?), SafeParse(ParseZonedDateTime)); - parsers.Put(typeof(LocalDate), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalDate?), SafeParse(ParseLocalDate)); - parsers.Put(typeof(LocalTime), SafeParse(ParseLocalTime)); - parsers.Put(typeof(LocalTime?), SafeParse(ParseLocalTime)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(value => value)); - parsers.Put(typeof(ICollection), ImmutableListParse(value => value)); - parsers.Put(typeof(IList), ImmutableListParse(value => value)); - parsers.Put(typeof(List), ListParse(value => value)); - parsers.Put(typeof(ISet), ImmutableListParse(value => value)); - parsers.Put(typeof(HashSet), SetParse(value => value)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(bool.Parse)); - parsers.Put(typeof(List), NullableListParse(bool.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(bool.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(bool.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(byte.Parse)); - parsers.Put(typeof(List), ListParse(byte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(byte.Parse)); - parsers.Put(typeof(HashSet), SetParse(byte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(sbyte.Parse)); - parsers.Put(typeof(List), ListParse(sbyte.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(sbyte.Parse)); - parsers.Put(typeof(HashSet), SetParse(sbyte.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(short.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(short.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(short.Parse)); - parsers.Put(typeof(List), ListParse(short.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(short.Parse)); - parsers.Put(typeof(HashSet), SetParse(short.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ushort.Parse)); - parsers.Put(typeof(List), ListParse(ushort.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ushort.Parse)); - parsers.Put(typeof(HashSet), SetParse(ushort.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(int.Parse)); - parsers.Put(typeof(List), NullableListParse(int.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(int.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(int.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(uint.Parse)); - parsers.Put(typeof(List), ListParse(uint.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(uint.Parse)); - parsers.Put(typeof(HashSet), SetParse(uint.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(long.Parse)); - parsers.Put(typeof(List), NullableListParse(long.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(long.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(long.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(ulong.Parse)); - parsers.Put(typeof(List), ListParse(ulong.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(ulong.Parse)); - parsers.Put(typeof(HashSet), SetParse(ulong.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(float.Parse)); - parsers.Put(typeof(List), NullableListParse(float.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(float.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(float.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(double.Parse)); - parsers.Put(typeof(List), NullableListParse(double.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(double.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(double.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(decimal.Parse)); - parsers.Put(typeof(List), NullableListParse(decimal.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(decimal.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(decimal.Parse)); - - parsers.Put(typeof(IEnumerable), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(ICollection), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(IList), NullableImmutableListParse(DateTime.Parse)); - parsers.Put(typeof(List), NullableListParse(DateTime.Parse)); - parsers.Put(typeof(ISet), NullableImmutableSetParse(DateTime.Parse)); - parsers.Put(typeof(HashSet), NullableSetParse(DateTime.Parse)); - - parsers.Put(typeof(IEnumerable), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(ICollection), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(IList), ImmutableListParse(TimeSpan.Parse)); - parsers.Put(typeof(List), ListParse(TimeSpan.Parse)); - parsers.Put(typeof(ISet), ImmutableSetParse(TimeSpan.Parse)); - parsers.Put(typeof(HashSet), SetParse(TimeSpan.Parse)); - - return parsers.ToImmutableDictionary(); - } - - private static Func SafeParse(Func parse) - { - return parameter => - { - try - { - return parse(parameter.Value); - } - catch (OverflowException) - { - throw ParameterOutOfRange(parameter, typeof(T)); - } - catch (FormatException) - { - throw InvalidParameterFormat(parameter, typeof(T)); - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse parameter: '{0}' with value: '{1}' to {2}", - parameter.Name, parameter.Value, typeof(T)), e); - } - }; - } - - private static Func NullableListParse(Func itemParser) where T: struct - { - return ListParse(it => it.ToNullable(itemParser)); - } - - private static Func ListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new List(); - } - return ParseCollection(parameter.Value, itemParser).ToList(); - }; - } - - private static Func NullableImmutableListParse(Func itemParser) where T: struct - { - return ImmutableListParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableListParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Lists.EmptyList(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableList(); - }; - } - - private static Func NullableSetParse(Func itemParser) where T: struct - { - return SetParse(it => it.ToNullable(itemParser)); - } - - private static Func SetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return new HashSet(); - } - return ParseCollection(parameter.Value, itemParser).ToSet(); - }; - } - - private static Func NullableImmutableSetParse(Func itemParser) where T: struct - { - return ImmutableSetParse(it => it.ToNullable(itemParser)); - } - - private static Func ImmutableSetParse(Func itemParser) - { - return parameter => - { - if (string.IsNullOrEmpty(parameter.Value)) - { - return Sets.EmptySet(); - } - return ParseCollection(parameter.Value, itemParser).ToImmutableHashSet(); - }; - } - - private static ZonedDateTime ParseZonedDateTime(string value) - { - var dateTime = DateTime.Parse(value); - return new ZonedDateTime(Instant.FromDateTimeUtc(dateTime.ToUniversalTime()), DateTimeZone.Utc); - } - - private static LocalDate ParseLocalDate(string value) - { - return LocalDatePattern.IsoPattern.Parse(value).Value; - } - - private static LocalTime ParseLocalTime(string value) - { - return LocalTimePattern.ExtendedIsoPattern.Parse(value).Value; - } - - private static ArgumentException ParameterOutOfRange(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query: '{0}' value: '{1}' is out of range for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static ArgumentException InvalidParameterFormat(Parameter parameter, Type type) - { - return new ArgumentException(Strings.Format("Query '{0}' value: '{1}' format is invalid for: '{2}'", - parameter.Name, parameter.Value, type)); - } - - private static IEnumerable ParseCollection(string value, Func itemParser) - { - var results = value.Split(new[] { ',' }, StringSplitOptions.None) - .Where(it => it != null) - .Select(it => it.Trim()) - .Select(itemParser); - return results; - } - - public static T? ToNullable(this string s, Func itemParser) where T : struct - { - T? result = new T?(); - try - { - if (!string.IsNullOrEmpty(s) && s.Trim().Length > 0) - { - result = itemParser(s); - } - } - catch (Exception e) - { - throw new InvalidOperationException(Strings.Format("Unable to parse value: '{0}' to nullable: '{1}'", s, typeof(T).ToString()), e); - } - return result; - } - - private class Parameter - { - internal string Name { get; private set; } - internal string Value { get; private set; } - - private Parameter(string name, string value) - { - Name = name; - Value = value; - } - - internal static Parameter Of(string name, string value) - { - return new Parameter(name, value); - } - } - } - - internal enum ParameterType - { - Undefined, - Query, - Path, - Header - } -} diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/packages.config b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/packages.config deleted file mode 100644 index e3401566e5d..00000000000 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file From 91087b59c5268c5f3915bd4a0ae6b470818ca13a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 30 Jan 2022 15:56:08 +0800 Subject: [PATCH 112/113] remove swift4 generator (#11455) --- docs/generators.md | 1 - docs/generators/swift4-deprecated.md | 333 ----- .../codegen/languages/Swift4Codegen.java | 1097 ----------------- .../org.openapitools.codegen.CodegenConfig | 4 +- .../main/resources/swift4/APIHelper.mustache | 70 -- .../src/main/resources/swift4/APIs.mustache | 62 - .../swift4/AlamofireImplementations.mustache | 451 ------- .../main/resources/swift4/Cartfile.mustache | 3 - .../resources/swift4/CodableHelper.mustache | 75 -- .../resources/swift4/Configuration.mustache | 15 - .../main/resources/swift4/Extensions.mustache | 188 --- .../swift4/JSONEncodableEncoding.mustache | 54 - .../swift4/JSONEncodingHelper.mustache | 43 - .../src/main/resources/swift4/Models.mustache | 36 - .../resources/swift4/Package.swift.mustache | 33 - .../main/resources/swift4/Podspec.mustache | 38 - .../src/main/resources/swift4/README.mustache | 69 -- .../src/main/resources/swift4/Result.mustache | 17 - .../main/resources/swift4/XcodeGen.mustache | 17 - .../src/main/resources/swift4/_param.mustache | 1 - .../src/main/resources/swift4/api.mustache | 216 ---- .../main/resources/swift4/api_doc.mustache | 97 -- .../resources/swift4/git_push.sh.mustache | 57 - .../main/resources/swift4/gitignore.mustache | 63 - .../src/main/resources/swift4/model.mustache | 24 - .../main/resources/swift4/modelArray.mustache | 1 - .../main/resources/swift4/modelEnum.mustache | 7 - .../modelInlineEnumDeclaration.mustache | 7 - .../resources/swift4/modelObject.mustache | 81 -- .../main/resources/swift4/model_doc.mustache | 11 - 30 files changed, 1 insertion(+), 3170 deletions(-) delete mode 100644 docs/generators/swift4-deprecated.md delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java delete mode 100644 modules/openapi-generator/src/main/resources/swift4/APIHelper.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/APIs.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/AlamofireImplementations.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Cartfile.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/CodableHelper.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Configuration.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Extensions.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/JSONEncodableEncoding.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/JSONEncodingHelper.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Models.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Package.swift.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Podspec.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/Result.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/XcodeGen.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/_param.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/api.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/api_doc.mustache delete mode 100755 modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/gitignore.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/modelArray.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/modelEnum.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/modelInlineEnumDeclaration.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/modelObject.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift4/model_doc.mustache diff --git a/docs/generators.md b/docs/generators.md index 65595bbbe89..0ec7569496c 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -64,7 +64,6 @@ The following generators are available: * [scala-httpclient-deprecated (deprecated)](generators/scala-httpclient-deprecated.md) * [scala-sttp (beta)](generators/scala-sttp.md) * [scalaz](generators/scalaz.md) -* [swift4-deprecated (deprecated)](generators/swift4-deprecated.md) * [swift5](generators/swift5.md) * [typescript (experimental)](generators/typescript.md) * [typescript-angular](generators/typescript-angular.md) diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md deleted file mode 100644 index dd39ea98776..00000000000 --- a/docs/generators/swift4-deprecated.md +++ /dev/null @@ -1,333 +0,0 @@ ---- -title: Documentation for the swift4-deprecated Generator ---- - -## METADATA - -| Property | Value | Notes | -| -------- | ----- | ----- | -| generator name | swift4-deprecated | pass this to the generate command after -g | -| generator stability | DEPRECATED | | -| generator type | CLIENT | | -| generator language | Swift | | -| generator default templating engine | mustache | | -| helpTxt | Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.) | | - -## CONFIG OPTIONS -These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| -|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| -|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null| -|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null| -|podAuthors|Authors used for Podspec| |null| -|podDescription|Description used for Podspec| |null| -|podDocsetURL|Docset URL used for Podspec| |null| -|podDocumentationURL|Documentation URL used for Podspec| |null| -|podHomepage|Homepage used for Podspec| |null| -|podLicense|License used for Podspec| |null| -|podScreenshots|Screenshots used for Podspec| |null| -|podSocialMediaURL|Social Media URL used for Podspec| |null| -|podSource|Source information used for Podspec| |null| -|podSummary|Summary used for Podspec| |null| -|podVersion|Version used for Podspec| |null| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|projectName|Project name in Xcode| |null| -|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result are available.| |null| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null| -|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| - -## IMPORT MAPPING - -| Type/Alias | Imports | -| ---------- | ------- | - - -## INSTANTIATION TYPES - -| Type/Alias | Instantiated By | -| ---------- | --------------- | - - -## LANGUAGE PRIMITIVES - -
    -
  • Any
  • -
  • AnyObject
  • -
  • Bool
  • -
  • Character
  • -
  • Data
  • -
  • Date
  • -
  • Decimal
  • -
  • Double
  • -
  • Float
  • -
  • Int
  • -
  • Int32
  • -
  • Int64
  • -
  • String
  • -
  • URL
  • -
  • UUID
  • -
  • Void
  • -
- -## RESERVED WORDS - -
    -
  • #available
  • -
  • #colorLiteral
  • -
  • #column
  • -
  • #else
  • -
  • #elseif
  • -
  • #endif
  • -
  • #file
  • -
  • #fileLiteral
  • -
  • #function
  • -
  • #if
  • -
  • #imageLiteral
  • -
  • #line
  • -
  • #selector
  • -
  • #sourceLocation
  • -
  • Any
  • -
  • AnyObject
  • -
  • Array
  • -
  • Bool
  • -
  • COLUMN
  • -
  • Character
  • -
  • Class
  • -
  • ClosedRange
  • -
  • Codable
  • -
  • CountableClosedRange
  • -
  • CountableRange
  • -
  • Data
  • -
  • Decodable
  • -
  • Dictionary
  • -
  • Double
  • -
  • Encodable
  • -
  • Error
  • -
  • ErrorResponse
  • -
  • FILE
  • -
  • FUNCTION
  • -
  • Float
  • -
  • Float32
  • -
  • Float64
  • -
  • Float80
  • -
  • Int
  • -
  • Int16
  • -
  • Int32
  • -
  • Int64
  • -
  • Int8
  • -
  • LINE
  • -
  • OptionSet
  • -
  • Optional
  • -
  • Protocol
  • -
  • Range
  • -
  • Response
  • -
  • Self
  • -
  • Set
  • -
  • StaticString
  • -
  • String
  • -
  • Type
  • -
  • UInt
  • -
  • UInt16
  • -
  • UInt32
  • -
  • UInt64
  • -
  • UInt8
  • -
  • URL
  • -
  • Unicode
  • -
  • Void
  • -
  • _
  • -
  • as
  • -
  • associatedtype
  • -
  • associativity
  • -
  • break
  • -
  • case
  • -
  • catch
  • -
  • class
  • -
  • continue
  • -
  • convenience
  • -
  • default
  • -
  • defer
  • -
  • deinit
  • -
  • didSet
  • -
  • do
  • -
  • dynamic
  • -
  • dynamicType
  • -
  • else
  • -
  • enum
  • -
  • extension
  • -
  • fallthrough
  • -
  • false
  • -
  • fileprivate
  • -
  • final
  • -
  • for
  • -
  • func
  • -
  • get
  • -
  • guard
  • -
  • if
  • -
  • import
  • -
  • in
  • -
  • indirect
  • -
  • infix
  • -
  • init
  • -
  • inout
  • -
  • internal
  • -
  • is
  • -
  • lazy
  • -
  • left
  • -
  • let
  • -
  • mutating
  • -
  • nil
  • -
  • none
  • -
  • nonmutating
  • -
  • open
  • -
  • operator
  • -
  • optional
  • -
  • override
  • -
  • postfix
  • -
  • precedence
  • -
  • prefix
  • -
  • private
  • -
  • protocol
  • -
  • public
  • -
  • repeat
  • -
  • required
  • -
  • rethrows
  • -
  • return
  • -
  • right
  • -
  • self
  • -
  • set
  • -
  • static
  • -
  • struct
  • -
  • subscript
  • -
  • super
  • -
  • switch
  • -
  • throw
  • -
  • throws
  • -
  • true
  • -
  • try
  • -
  • typealias
  • -
  • unowned
  • -
  • var
  • -
  • weak
  • -
  • where
  • -
  • while
  • -
  • willSet
  • -
- -## FEATURE SET - - -### Client Modification Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasePath|✗|ToolingExtension -|Authorizations|✗|ToolingExtension -|UserAgent|✗|ToolingExtension -|MockServer|✗|ToolingExtension - -### Data Type Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Custom|✗|OAS2,OAS3 -|Int32|✓|OAS2,OAS3 -|Int64|✓|OAS2,OAS3 -|Float|✓|OAS2,OAS3 -|Double|✓|OAS2,OAS3 -|Decimal|✓|ToolingExtension -|String|✓|OAS2,OAS3 -|Byte|✓|OAS2,OAS3 -|Binary|✓|OAS2,OAS3 -|Boolean|✓|OAS2,OAS3 -|Date|✓|OAS2,OAS3 -|DateTime|✓|OAS2,OAS3 -|Password|✓|OAS2,OAS3 -|File|✓|OAS2 -|Array|✓|OAS2,OAS3 -|Maps|✓|ToolingExtension -|CollectionFormat|✓|OAS2 -|CollectionFormatMulti|✓|OAS2 -|Enum|✓|OAS2,OAS3 -|ArrayOfEnum|✓|ToolingExtension -|ArrayOfModel|✓|ToolingExtension -|ArrayOfCollectionOfPrimitives|✓|ToolingExtension -|ArrayOfCollectionOfModel|✓|ToolingExtension -|ArrayOfCollectionOfEnum|✓|ToolingExtension -|MapOfEnum|✓|ToolingExtension -|MapOfModel|✓|ToolingExtension -|MapOfCollectionOfPrimitives|✓|ToolingExtension -|MapOfCollectionOfModel|✓|ToolingExtension -|MapOfCollectionOfEnum|✓|ToolingExtension - -### Documentation Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Readme|✗|ToolingExtension -|Model|✓|ToolingExtension -|Api|✓|ToolingExtension - -### Global Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Host|✓|OAS2,OAS3 -|BasePath|✓|OAS2,OAS3 -|Info|✓|OAS2,OAS3 -|Schemes|✗|OAS2,OAS3 -|PartialSchemes|✓|OAS2,OAS3 -|Consumes|✓|OAS2 -|Produces|✓|OAS2 -|ExternalDocumentation|✓|OAS2,OAS3 -|Examples|✓|OAS2,OAS3 -|XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 -|ParameterizedServer|✗|OAS3 -|ParameterStyling|✗|OAS3 -|Callbacks|✗|OAS3 -|LinkObjects|✗|OAS3 - -### Parameter Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Path|✓|OAS2,OAS3 -|Query|✓|OAS2,OAS3 -|Header|✓|OAS2,OAS3 -|Body|✓|OAS2 -|FormUnencoded|✓|OAS2 -|FormMultipart|✓|OAS2 -|Cookie|✗|OAS3 - -### Schema Support Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|Simple|✓|OAS2,OAS3 -|Composite|✓|OAS2,OAS3 -|Polymorphism|✓|OAS2,OAS3 -|Union|✗|OAS3 - -### Security Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|BasicAuth|✓|OAS2,OAS3 -|ApiKey|✓|OAS2,OAS3 -|OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 -|OAuth2_Implicit|✓|OAS2,OAS3 -|OAuth2_Password|✗|OAS2,OAS3 -|OAuth2_ClientCredentials|✗|OAS2,OAS3 -|OAuth2_AuthorizationCode|✗|OAS2,OAS3 - -### Wire Format Feature -| Name | Supported | Defined By | -| ---- | --------- | ---------- | -|JSON|✓|OAS2,OAS3 -|XML|✗|OAS2,OAS3 -|PROTOBUF|✗|ToolingExtension -|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java deleted file mode 100644 index 5adc13172bf..00000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ /dev/null @@ -1,1097 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.text.WordUtils; -import org.openapitools.codegen.*; -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.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.openapitools.codegen.utils.StringUtils.camelize; - -public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { - private final Logger LOGGER = LoggerFactory.getLogger(Swift4Codegen.class); - - public static final String PROJECT_NAME = "projectName"; - public static final String RESPONSE_AS = "responseAs"; - public static final String UNWRAP_REQUIRED = "unwrapRequired"; - public static final String OBJC_COMPATIBLE = "objcCompatible"; - public static final String POD_SOURCE = "podSource"; - public static final String POD_AUTHORS = "podAuthors"; - public static final String POD_SOCIAL_MEDIA_URL = "podSocialMediaURL"; - public static final String POD_DOCSET_URL = "podDocsetURL"; - public static final String POD_LICENSE = "podLicense"; - public static final String POD_HOMEPAGE = "podHomepage"; - public static final String POD_SUMMARY = "podSummary"; - public static final String POD_DESCRIPTION = "podDescription"; - public static final String POD_SCREENSHOTS = "podScreenshots"; - public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; - public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; - public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; - public static final String LENIENT_TYPE_CAST = "lenientTypeCast"; - protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; - protected static final String LIBRARY_RX_SWIFT = "RxSwift"; - protected static final String LIBRARY_RESULT = "Result"; - protected static final String[] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT, LIBRARY_RESULT}; - protected String projectName = "OpenAPIClient"; - protected boolean nonPublicApi = false; - protected boolean unwrapRequired; - protected boolean objcCompatible = false; - protected boolean lenientTypeCast = false; - protected boolean swiftUseApiNamespace; - protected String[] responseAs = new String[0]; - protected String sourceFolder = "Classes" + File.separator + "OpenAPIs"; - protected HashSet objcReservedWords; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - - /** - * Constructor for the swift4 language codegen module. - */ - public Swift4Codegen() { - super(); - - modifyFeatureSet(features -> features - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .includeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - outputFolder = "generated-code" + File.separator + "swift"; - modelTemplateFiles.put("model.mustache", ".swift"); - apiTemplateFiles.put("api.mustache", ".swift"); - embeddedTemplateDir = templateDir = "swift4"; - apiPackage = File.separator + "APIs"; - modelPackage = File.separator + "Models"; - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - - languageSpecificPrimitives = new HashSet<>( - Arrays.asList( - "Int", - "Int32", - "Int64", - "Float", - "Double", - "Bool", - "Void", - "String", - "URL", - "Data", - "Date", - "Character", - "UUID", - "URL", - "AnyObject", - "Any", - "Decimal") - ); - defaultIncludes = new HashSet<>( - Arrays.asList( - "Data", - "Date", - "URL", // for file - "UUID", - "Array", - "Dictionary", - "Set", - "Any", - "Empty", - "AnyObject", - "Any", - "Decimal") - ); - - objcReservedWords = new HashSet<>( - Arrays.asList( - // Added for Objective-C compatibility - "id", "description", "NSArray", "NSURL", "CGFloat", "NSSet", "NSString", "NSInteger", "NSUInteger", - "NSError", "NSDictionary", - // Cannot override with a stored property 'className' - "className" - ) - ); - - reservedWords = new HashSet<>( - Arrays.asList( - // name used by swift client - "ErrorResponse", "Response", - - // Swift keywords. This list is taken from here: - // https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-ID410 - // - // Keywords used in declarations - "associatedtype", "class", "deinit", "enum", "extension", "fileprivate", "func", "import", "init", - "inout", "internal", "let", "open", "operator", "private", "protocol", "public", "static", "struct", - "subscript", "typealias", "var", - // Keywords uses in statements - "break", "case", "continue", "default", "defer", "do", "else", "fallthrough", "for", "guard", "if", - "in", "repeat", "return", "switch", "where", "while", - // Keywords used in expressions and types - "as", "Any", "catch", "false", "is", "nil", "rethrows", "super", "self", "Self", "throw", "throws", "true", "try", - // Keywords used in patterns - "_", - // Keywords that begin with a number sign - "#available", "#colorLiteral", "#column", "#else", "#elseif", "#endif", "#file", "#fileLiteral", "#function", "#if", - "#imageLiteral", "#line", "#selector", "#sourceLocation", - // Keywords reserved in particular contexts - "associativity", "convenience", "dynamic", "didSet", "final", "get", "infix", "indirect", "lazy", "left", - "mutating", "none", "nonmutating", "optional", "override", "postfix", "precedence", "prefix", "Protocol", - "required", "right", "set", "Type", "unowned", "weak", "willSet", - - // - // Swift Standard Library types - // https://developer.apple.com/documentation/swift - // - // Numbers and Basic Values - "Bool", "Int", "Double", "Float", "Range", "ClosedRange", "Error", "Optional", - // Special-Use Numeric Types - "UInt", "UInt8", "UInt16", "UInt32", "UInt64", "Int8", "Int16", "Int32", "Int64", "Float80", "Float32", "Float64", - // Strings and Text - "String", "Character", "Unicode", "StaticString", - // Collections - "Array", "Dictionary", "Set", "OptionSet", "CountableRange", "CountableClosedRange", - - // The following are commonly-used Foundation types - "URL", "Data", "Codable", "Encodable", "Decodable", - - // The following are other words we want to reserve - "Void", "AnyObject", "Class", "dynamicType", "COLUMN", "FILE", "FUNCTION", "LINE" - ) - ); - - typeMapping = new HashMap<>(); - typeMapping.put("array", "Array"); - typeMapping.put("List", "Array"); - typeMapping.put("map", "Dictionary"); - typeMapping.put("date", "Date"); - typeMapping.put("Date", "Date"); - typeMapping.put("DateTime", "Date"); - typeMapping.put("boolean", "Bool"); - typeMapping.put("string", "String"); - typeMapping.put("char", "Character"); - typeMapping.put("short", "Int"); - typeMapping.put("int", "Int"); - typeMapping.put("long", "Int64"); - typeMapping.put("integer", "Int"); - typeMapping.put("Integer", "Int"); - typeMapping.put("float", "Float"); - typeMapping.put("number", "Double"); - typeMapping.put("double", "Double"); - typeMapping.put("file", "URL"); - typeMapping.put("binary", "URL"); - typeMapping.put("ByteArray", "Data"); - typeMapping.put("UUID", "UUID"); - typeMapping.put("URI", "String"); - typeMapping.put("decimal", "Decimal"); - typeMapping.put("object", "Any"); - typeMapping.put("AnyType", "Any"); - - importMapping = new HashMap<>(); - - cliOptions.add(new CliOption(PROJECT_NAME, "Project name in Xcode")); - cliOptions.add(new CliOption(RESPONSE_AS, - "Optionally use libraries to manage response. Currently " - + StringUtils.join(RESPONSE_LIBRARIES, ", ") - + " are available.")); - cliOptions.add(new CliOption(CodegenConstants.NON_PUBLIC_API, - CodegenConstants.NON_PUBLIC_API_DESC - + "(default: false)")); - cliOptions.add(new CliOption(UNWRAP_REQUIRED, - "Treat 'required' properties in response as non-optional " - + "(which would crash the app if api returns null as opposed " - + "to required option specified in json schema")); - cliOptions.add(new CliOption(OBJC_COMPATIBLE, - "Add additional properties and methods for Objective-C " - + "compatibility (default: false)")); - cliOptions.add(new CliOption(POD_SOURCE, "Source information used for Podspec")); - cliOptions.add(new CliOption(CodegenConstants.POD_VERSION, "Version used for Podspec")); - cliOptions.add(new CliOption(POD_AUTHORS, "Authors used for Podspec")); - cliOptions.add(new CliOption(POD_SOCIAL_MEDIA_URL, "Social Media URL used for Podspec")); - cliOptions.add(new CliOption(POD_DOCSET_URL, "Docset URL used for Podspec")); - cliOptions.add(new CliOption(POD_LICENSE, "License used for Podspec")); - cliOptions.add(new CliOption(POD_HOMEPAGE, "Homepage used for Podspec")); - cliOptions.add(new CliOption(POD_SUMMARY, "Summary used for Podspec")); - cliOptions.add(new CliOption(POD_DESCRIPTION, "Description used for Podspec")); - cliOptions.add(new CliOption(POD_SCREENSHOTS, "Screenshots used for Podspec")); - cliOptions.add(new CliOption(POD_DOCUMENTATION_URL, - "Documentation URL used for Podspec")); - cliOptions.add(new CliOption(SWIFT_USE_API_NAMESPACE, - "Flag to make all the API classes inner-class " - + "of {{projectName}}API")); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, - CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) - .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(LENIENT_TYPE_CAST, - "Accept and cast values for simple types (string->bool, " - + "string->int, int->string)") - .defaultValue(Boolean.FALSE.toString())); - } - - private static CodegenModel reconcileProperties(CodegenModel codegenModel, - CodegenModel parentCodegenModel) { - // To support inheritance in this generator, we will analyze - // the parent and child models, look for properties that match, and remove - // them from the child models and leave them in the parent. - // Because the child models extend the parents, the properties - // will be available via the parent. - - // Get the properties for the parent and child models - final List parentModelCodegenProperties = parentCodegenModel.vars; - List codegenProperties = codegenModel.vars; - codegenModel.allVars = new ArrayList(codegenProperties); - codegenModel.parentVars = parentCodegenModel.allVars; - - // Iterate over all of the parent model properties - boolean removedChildProperty = false; - - for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) { - // Now that we have found a prop in the parent class, - // and search the child class for the same prop. - Iterator iterator = codegenProperties.iterator(); - while (iterator.hasNext()) { - CodegenProperty codegenProperty = iterator.next(); - if (codegenProperty.baseName.equals(parentModelCodegenProperty.baseName)) { - // We found a property in the child class that is - // a duplicate of the one in the parent, so remove it. - iterator.remove(); - removedChildProperty = true; - } - } - } - - if (removedChildProperty) { - codegenModel.vars = codegenProperties; - } - - - return codegenModel; - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "swift4-deprecated"; - } - - @Override - public String getHelp() { - return "Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.)"; - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, - Schema schema) { - - final Schema additionalProperties = getAdditionalProperties(schema); - - if (additionalProperties != null) { - codegenModel.additionalPropertiesType = getSchemaType(additionalProperties); - } - } - - @Override - public void processOpts() { - super.processOpts(); - - if (StringUtils.isEmpty(System.getenv("SWIFT_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable SWIFT_POST_PROCESS_FILE not defined so the Swift code may not be properly formatted. To define it, try 'export SWIFT_POST_PROCESS_FILE=/usr/local/bin/swiftformat' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - // Setup project name - if (additionalProperties.containsKey(PROJECT_NAME)) { - setProjectName((String) additionalProperties.get(PROJECT_NAME)); - } else { - additionalProperties.put(PROJECT_NAME, projectName); - } - sourceFolder = projectName + File.separator + sourceFolder; - - // Setup nonPublicApi option, which generates code with reduced access - // modifiers; allows embedding elsewhere without exposing non-public API calls - // to consumers - if (additionalProperties.containsKey(CodegenConstants.NON_PUBLIC_API)) { - setNonPublicApi(convertPropertyToBooleanAndWriteBack(CodegenConstants.NON_PUBLIC_API)); - } - additionalProperties.put(CodegenConstants.NON_PUBLIC_API, nonPublicApi); - - // Setup unwrapRequired option, which makes all the - // properties with "required" non-optional - if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); - } - additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); - - // Setup objcCompatible option, which adds additional properties - // and methods for Objective-C compatibility - if (additionalProperties.containsKey(OBJC_COMPATIBLE)) { - setObjcCompatible(convertPropertyToBooleanAndWriteBack(OBJC_COMPATIBLE)); - } - additionalProperties.put(OBJC_COMPATIBLE, objcCompatible); - - // add objc reserved words - if (Boolean.TRUE.equals(objcCompatible)) { - reservedWords.addAll(objcReservedWords); - } - - // Setup unwrapRequired option, which makes all the properties with "required" non-optional - if (additionalProperties.containsKey(RESPONSE_AS)) { - Object responseAsObject = additionalProperties.get(RESPONSE_AS); - if (responseAsObject instanceof String) { - setResponseAs(((String) responseAsObject).split(",")); - } else { - setResponseAs((String[]) responseAsObject); - } - } - additionalProperties.put(RESPONSE_AS, responseAs); - if (ArrayUtils.contains(responseAs, LIBRARY_PROMISE_KIT)) { - additionalProperties.put("usePromiseKit", true); - } - if (ArrayUtils.contains(responseAs, LIBRARY_RX_SWIFT)) { - additionalProperties.put("useRxSwift", true); - } - if (ArrayUtils.contains(responseAs, LIBRARY_RESULT)) { - additionalProperties.put("useResult", true); - } - - // Setup swiftUseApiNamespace option, which makes all the API - // classes inner-class of {{projectName}}API - if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); - } - - if (!additionalProperties.containsKey(POD_AUTHORS)) { - additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); - } - - setLenientTypeCast(convertPropertyToBooleanAndWriteBack(LENIENT_TYPE_CAST)); - - // make api and model doc path available in mustache template - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - supportingFiles.add(new SupportingFile("Podspec.mustache", - "", - projectName + ".podspec")); - supportingFiles.add(new SupportingFile("Cartfile.mustache", - "", - "Cartfile")); - supportingFiles.add(new SupportingFile("Package.swift.mustache", - "", - "Package.swift")); - supportingFiles.add(new SupportingFile("APIHelper.mustache", - sourceFolder, - "APIHelper.swift")); - supportingFiles.add(new SupportingFile("AlamofireImplementations.mustache", - sourceFolder, - "AlamofireImplementations.swift")); - supportingFiles.add(new SupportingFile("Configuration.mustache", - sourceFolder, - "Configuration.swift")); - supportingFiles.add(new SupportingFile("Extensions.mustache", - sourceFolder, - "Extensions.swift")); - supportingFiles.add(new SupportingFile("Models.mustache", - sourceFolder, - "Models.swift")); - supportingFiles.add(new SupportingFile("APIs.mustache", - sourceFolder, - "APIs.swift")); - supportingFiles.add(new SupportingFile("CodableHelper.mustache", - sourceFolder, - "CodableHelper.swift")); - supportingFiles.add(new SupportingFile("JSONEncodableEncoding.mustache", - sourceFolder, - "JSONEncodableEncoding.swift")); - supportingFiles.add(new SupportingFile("JSONEncodingHelper.mustache", - sourceFolder, - "JSONEncodingHelper.swift")); - if (ArrayUtils.contains(responseAs, LIBRARY_RESULT)) { - supportingFiles.add(new SupportingFile("Result.mustache", - sourceFolder, - "Result.swift")); - } - supportingFiles.add(new SupportingFile("git_push.sh.mustache", - "", - "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", - "", - ".gitignore")); - supportingFiles.add(new SupportingFile("README.mustache", - "", - "README.md")); - supportingFiles.add(new SupportingFile("XcodeGen.mustache", - "", - "project.yml")); - - } - - @Override - protected boolean isReservedWord(String word) { - return word != null && reservedWords.contains(word); //don't lowercase as super does - } - - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; // add an underscore to the name - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder - + modelPackage().replace('.', File.separatorChar); - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder - + apiPackage().replace('.', File.separatorChar); - } - - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return "[" + getTypeDeclaration(inner) + "]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = getAdditionalProperties(p); - return "[String:" + getTypeDeclaration(inner) + "]"; - } - return super.getTypeDeclaration(p); - } - - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type; - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type) || defaultIncludes.contains(type)) { - return type; - } - } else { - type = openAPIType; - } - return toModelName(type); - } - - @Override - public boolean isDataTypeFile(String dataType) { - return "URL".equals(dataType); - } - - @Override - public boolean isDataTypeBinary(final String dataType) { - return "Data".equals(dataType); - } - - /** - * Output the proper model name (capitalized). - * - * @param name the name of the model - * @return capitalized model name - */ - @Override - public String toModelName(String name) { - // FIXME parameter should not be assigned. Also declare it as "final" - name = sanitizeName(name); - - if (!StringUtils.isEmpty(modelNameSuffix)) { // set model suffix - name = name + "_" + modelNameSuffix; - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { // set model prefix - name = modelNamePrefix + "_" + name; - } - - // camelize the model name - // phone_number => PhoneNumber - name = camelize(name); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - String modelName = "Model" + name; - LOGGER.warn("{} (reserved word) cannot be used as model name. Renamed to {}", name, modelName); - return modelName; - } - - // model name starts with number - if (name.matches("^\\d.*")) { - // e.g. 200Response => Model200Response (after camelize) - String modelName = "Model" + name; - LOGGER.warn("{} (model name starts with number) cannot be used as model name. Renamed to {}", name, - modelName); - return modelName; - } - - return name; - } - - /** - * Return the capitalized file name of the model. - * - * @param name the model name - * @return the file name of the model - */ - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override - public String toDefaultValue(Schema p) { - if (p.getEnum() != null && !p.getEnum().isEmpty()) { - if (p.getDefault() != null) { - if (ModelUtils.isStringSchema(p)) { - return "." + toEnumVarName(escapeText((String) p.getDefault()), p.getType()); - } else { - return "." + toEnumVarName(escapeText(p.getDefault().toString()), p.getType()); - } - } - } - if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); - } - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { - return "\"" + escapeText((String) p.getDefault()) + "\""; - } - } - return null; - } - - @Override - public String toInstantiationType(Schema p) { - if (ModelUtils.isMapSchema(p)) { - return getSchemaType(getAdditionalProperties(p)); - } else if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - String inner = getSchemaType(ap.getItems()); - return "[" + inner + "]"; - } - return null; - } - - @Override - public String toApiName(String name) { - if (name.length() == 0) { - return "DefaultAPI"; - } - return camelize(name) + "API"; - } - - @Override - public String apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath).replace("/", File.separator); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath).replace("/", File.separator); - } - - @Override - public String toModelDocFilename(String name) { - return toModelName(name); - } - - @Override - public String toApiDocFilename(String name) { - return toApiName(name); - } - - @Override - public String toOperationId(String operationId) { - operationId = camelize(sanitizeName(operationId), true); - - // Throw exception if method name is empty. - // This should not happen but keep the check just in case - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - String newOperationId = camelize(("call_" + operationId), true); - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); - return newOperationId; - } - - // operationId starts with a number - if (operationId.matches("^\\d.*")) { - LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), true)); - operationId = camelize(sanitizeName("call_" + operationId), true); - } - - - return operationId; - } - - @Override - public String toVarName(String name) { - // sanitize name - name = sanitizeName(name); - - // if it's all upper case, do nothing - if (name.matches("^[A-Z_]*$")) { - return name; - } - - // camelize the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public String toParamName(String name) { - // sanitize name - name = sanitizeName(name); - - // replace - with _ e.g. created-at => created_at - name = name.replaceAll("-", "_"); - - // if it's all upper case, do nothing - if (name.matches("^[A-Z_]*$")) { - return name; - } - - // camelize(lower) the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public CodegenModel fromModel(String name, Schema model) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - CodegenModel codegenModel = super.fromModel(name, model); - if (codegenModel.description != null) { - codegenModel.imports.add("ApiModel"); - } - if (allDefinitions != null) { - String parentSchema = codegenModel.parentSchema; - - // multilevel inheritance: reconcile properties of all the parents - while (parentSchema != null) { - final Schema parentModel = allDefinitions.get(parentSchema); - final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, - parentModel); - codegenModel = Swift4Codegen.reconcileProperties(codegenModel, parentCodegenModel); - - // get the next parent - parentSchema = parentCodegenModel.parentSchema; - } - } - - return codegenModel; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setNonPublicApi(boolean nonPublicApi) { - this.nonPublicApi = nonPublicApi; - } - - public void setUnwrapRequired(boolean unwrapRequired) { - this.unwrapRequired = unwrapRequired; - } - - public void setObjcCompatible(boolean objcCompatible) { - this.objcCompatible = objcCompatible; - } - - public void setLenientTypeCast(boolean lenientTypeCast) { - this.lenientTypeCast = lenientTypeCast; - } - - public void setResponseAs(String[] responseAs) { - this.responseAs = responseAs; - } - - public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { - this.swiftUseApiNamespace = swiftUseApiNamespace; - } - - @Override - public String toEnumValue(String value, String datatype) { - // for string, array of string - if ("String".equals(datatype) || "[String]".equals(datatype) || "[String:String]".equals(datatype)) { - return "\"" + value + "\""; - } else { - return String.valueOf(value); - } - } - - @Override - public String toEnumDefaultValue(String value, String datatype) { - return datatype + "_" + value; - } - - @Override - public String toEnumVarName(String name, String datatype) { - if (name.length() == 0) { - return "empty"; - } - - Pattern startWithNumberPattern = Pattern.compile("^\\d+"); - Matcher startWithNumberMatcher = startWithNumberPattern.matcher(name); - if (startWithNumberMatcher.find()) { - String startingNumbers = startWithNumberMatcher.group(0); - String nameWithoutStartingNumbers = name.substring(startingNumbers.length()); - - return "_" + startingNumbers + camelize(nameWithoutStartingNumbers, true); - } - - // for symbol, e.g. $, # - if (getSymbolName(name) != null) { - return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), true); - } - - // Camelize only when we have a structure defined below - Boolean camelized = false; - if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { - name = camelize(name, true); - camelized = true; - } - - // Reserved Name - String nameLowercase = StringUtils.lowerCase(name); - if (isReservedWord(nameLowercase)) { - return escapeReservedWord(nameLowercase); - } - - // Check for numerical conversions - if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) - || "Float".equals(datatype) || "Double".equals(datatype)) { - String varName = "number" + camelize(name); - varName = varName.replaceAll("-", "minus"); - varName = varName.replaceAll("\\+", "plus"); - varName = varName.replaceAll("\\.", "dot"); - return varName; - } - - // If we have already camelized the word, don't progress - // any further - if (camelized) { - return name; - } - - char[] separators = {'-', '_', ' ', ':', '(', ')'}; - return camelize(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) - .replaceAll("[-_ :\\(\\)]", ""), - true); - } - - @Override - public String toEnumName(CodegenProperty property) { - String enumName = toModelName(property.name); - - // Ensure that the enum type doesn't match a reserved word or - // the variable name doesn't match the generated enum type or the - // Swift compiler will generate an error - if (isReservedWord(property.datatypeWithEnum) - || toVarName(property.name).equals(property.datatypeWithEnum)) { - enumName = property.datatypeWithEnum + "Enum"; - } - - // TODO: toModelName already does something for names starting with number, - // so this code is probably never called - if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; - } else { - return enumName; - } - } - - @Override - public Map postProcessModels(Map objs) { - Map postProcessedModelsEnum = postProcessModelsEnum(objs); - - // We iterate through the list of models, and also iterate through each of the - // properties for each model. For each property, if: - // - // CodegenProperty.name != CodegenProperty.baseName - // - // then we set - // - // CodegenProperty.vendorExtensions["x-codegen-escaped-property-name"] = true - // - // Also, if any property in the model has x-codegen-escaped-property-name=true, then we mark: - // - // CodegenModel.vendorExtensions["x-codegen-has-escaped-property-names"] = true - // - List models = (List) postProcessedModelsEnum.get("models"); - for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); - boolean modelHasPropertyWithEscapedName = false; - for (CodegenProperty prop : cm.allVars) { - if (!prop.name.equals(prop.baseName)) { - prop.vendorExtensions.put("x-codegen-escaped-property-name", true); - modelHasPropertyWithEscapedName = true; - } - } - if (modelHasPropertyWithEscapedName) { - cm.vendorExtensions.put("x-codegen-has-escaped-property-names", true); - } - } - - return postProcessedModelsEnum; - } - - @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - super.postProcessModelProperty(model, property); - - // The default template code has the following logic for - // assigning a type as Swift Optional: - // - // {{^unwrapRequired}}?{{/unwrapRequired}} - // {{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}} - // - // which means: - // - // boolean isSwiftOptional = !unwrapRequired || (unwrapRequired && !property.required); - // - // We can drop the check for unwrapRequired in (unwrapRequired && !property.required) - // due to short-circuit evaluation of the || operator. - boolean isSwiftOptional = !unwrapRequired || !property.required; - boolean isSwiftScalarType = property.isInteger || property.isLong || property.isFloat - || property.isDouble || property.isBoolean; - if (isSwiftOptional && isSwiftScalarType) { - // Optional scalar types like Int?, Int64?, Float?, Double?, and Bool? - // do not translate to Objective-C. So we want to flag those - // properties in case we want to put special code in the templates - // which provide Objective-C compatibility. - property.vendorExtensions.put("x-swift-optional-scalar", true); - } - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - - @Override - public void postProcessFile(File file, String fileType) { - if (file == null) { - return; - } - String swiftPostProcessFile = System.getenv("SWIFT_POST_PROCESS_FILE"); - if (StringUtils.isEmpty(swiftPostProcessFile)) { - return; // skip if SWIFT_POST_PROCESS_FILE env variable is not defined - } - // only process files with swift extension - if ("swift".equals(FilenameUtils.getExtension(file.toString()))) { - String command = swiftPostProcessFile + " " + file; - try { - Process p = Runtime.getRuntime().exec(command); - int exitValue = p.waitFor(); - if (exitValue != 0) { - LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); - } else { - LOGGER.info("Successfully executed: {}", command); - } - } catch (InterruptedException | IOException e) { - LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); - // Restore interrupted state - Thread.currentThread().interrupt(); - } - } - } - - @Override - public Map postProcessOperationsWithModels(Map objs, List allModels) { - Map objectMap = (Map) objs.get("operations"); - - HashMap modelMaps = new HashMap(); - for (Object o : allModels) { - HashMap h = (HashMap) o; - CodegenModel m = (CodegenModel) h.get("model"); - modelMaps.put(m.classname, m); - } - - List operations = (List) objectMap.get("operation"); - for (CodegenOperation operation : operations) { - for (CodegenParameter cp : operation.allParams) { - cp.vendorExtensions.put("x-swift-example", constructExampleCode(cp, modelMaps)); - } - } - return objs; - } - - public String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps) { - if (codegenParameter.isArray) { // array - return "[" + constructExampleCode(codegenParameter.items, modelMaps) + "]"; - } else if (codegenParameter.isMap) { // TODO: map, file type - return "\"TODO\""; - } else if (languageSpecificPrimitives.contains(codegenParameter.dataType)) { // primitive type - if ("String".equals(codegenParameter.dataType) || "Character".equals(codegenParameter.dataType)) { - if (StringUtils.isEmpty(codegenParameter.example)) { - return "\"" + codegenParameter.example + "\""; - } else { - return "\"" + codegenParameter.paramName + "_example\""; - } - } else if ("Bool".equals(codegenParameter.dataType)) { // boolean - if (Boolean.parseBoolean(codegenParameter.example)) { - return "true"; - } else { - return "false"; - } - } else if ("URL".equals(codegenParameter.dataType)) { // URL - return "URL(string: \"https://example.com\")!"; - } else if ("Date".equals(codegenParameter.dataType)) { // date - return "Date()"; - } else { // numeric - if (StringUtils.isEmpty(codegenParameter.example)) { - return codegenParameter.example; - } else { - return "987"; - } - } - } else { // model - // look up the model - if (modelMaps.containsKey(codegenParameter.dataType)) { - return constructExampleCode(modelMaps.get(codegenParameter.dataType), modelMaps); - } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenParameter.dataType); - return "TODO"; - } - } - } - - public String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps) { - if (codegenProperty.isArray) { // array - return "[" + constructExampleCode(codegenProperty.items, modelMaps) + "]"; - } else if (codegenProperty.isMap) { // TODO: map, file type - return "\"TODO\""; - } else if (languageSpecificPrimitives.contains(codegenProperty.dataType)) { // primitive type - if ("String".equals(codegenProperty.dataType) || "Character".equals(codegenProperty.dataType)) { - if (StringUtils.isEmpty(codegenProperty.example)) { - return "\"" + codegenProperty.example + "\""; - } else { - return "\"" + codegenProperty.name + "_example\""; - } - } else if ("Bool".equals(codegenProperty.dataType)) { // boolean - if (Boolean.parseBoolean(codegenProperty.example)) { - return "true"; - } else { - return "false"; - } - } else if ("URL".equals(codegenProperty.dataType)) { // URL - return "URL(string: \"https://example.com\")!"; - } else if ("Date".equals(codegenProperty.dataType)) { // date - return "Date()"; - } else { // numeric - if (StringUtils.isEmpty(codegenProperty.example)) { - return codegenProperty.example; - } else { - return "123"; - } - } - } else { - // look up the model - if (modelMaps.containsKey(codegenProperty.dataType)) { - return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps); - } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenProperty.dataType); - return "\"TODO\""; - } - } - } - - public String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps) { - String example; - example = codegenModel.name + "("; - List propertyExamples = new ArrayList<>(); - for (CodegenProperty codegenProperty : codegenModel.vars) { - propertyExamples.add(codegenProperty.name + ": " + constructExampleCode(codegenProperty, modelMaps)); - } - example += StringUtils.join(propertyExamples, ", "); - example += ")"; - return example; - } - - @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SWIFT; } -} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 434911baff5..43071dd2f03 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -65,6 +65,7 @@ org.openapitools.codegen.languages.JavaPlayFrameworkCodegen org.openapitools.codegen.languages.JavaUndertowServerCodegen org.openapitools.codegen.languages.JavaVertXServerCodegen org.openapitools.codegen.languages.JavaVertXWebServerCodegen +org.openapitools.codegen.languages.JavaCamelServerCodegen org.openapitools.codegen.languages.JavaCXFServerCodegen org.openapitools.codegen.languages.JavaCXFExtServerCodegen org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen @@ -127,7 +128,6 @@ org.openapitools.codegen.languages.SpringCodegen org.openapitools.codegen.languages.StaticDocCodegen org.openapitools.codegen.languages.StaticHtmlGenerator org.openapitools.codegen.languages.StaticHtml2Generator -org.openapitools.codegen.languages.Swift4Codegen org.openapitools.codegen.languages.Swift5ClientCodegen org.openapitools.codegen.languages.TypeScriptClientCodegen org.openapitools.codegen.languages.TypeScriptAngularClientCodegen @@ -142,5 +142,3 @@ org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen org.openapitools.codegen.languages.WsdlSchemaCodegen - -org.openapitools.codegen.languages.JavaCamelServerCodegen diff --git a/modules/openapi-generator/src/main/resources/swift4/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift4/APIHelper.mustache deleted file mode 100644 index 8cf57841b7d..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/APIHelper.mustache +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper { - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/modules/openapi-generator/src/main/resources/swift4/APIs.mustache b/modules/openapi-generator/src/main/resources/swift4/APIs.mustache deleted file mode 100644 index 0c3f78b057c..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/APIs.mustache +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{projectName}}API { - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var basePath = "{{{basePath}}}" - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var credential: URLCredential? - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var customHeaders: [String:String] = [:] - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var apiResponseQueue: DispatchQueue = .main -} - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String:Any]? - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let isBody: Bool - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let method: String - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var onProgressReady: ((Progress) -> ())? - - required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders({{projectName}}API.customHeaders) - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addHeaders(_ aHeaders:[String:String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func addCredential() -> Self { - self.credential = {{projectName}}API.credential - return self - } -} - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/modules/openapi-generator/src/main/resources/swift4/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift4/AlamofireImplementations.mustache deleted file mode 100644 index d0750a5fd00..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/AlamofireImplementations.mustache +++ /dev/null @@ -1,451 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireRequestBuilder: RequestBuilder { - required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename : String? = nil - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with:"") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url : URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -fileprivate enum DownloadException : Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: {{projectName}}API.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? = nil - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/modules/openapi-generator/src/main/resources/swift4/Cartfile.mustache b/modules/openapi-generator/src/main/resources/swift4/Cartfile.mustache deleted file mode 100644 index 23031126023..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Cartfile.mustache +++ /dev/null @@ -1,3 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0{{#usePromiseKit}} -github "mxcl/PromiseKit" ~> 6.11.0{{/usePromiseKit}}{{#useRxSwift}} -github "ReactiveX/RxSwift" ~> 4.5.0{{/useRxSwift}} diff --git a/modules/openapi-generator/src/main/resources/swift4/CodableHelper.mustache b/modules/openapi-generator/src/main/resources/swift4/CodableHelper.mustache deleted file mode 100644 index b8d29582b2e..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/CodableHelper.mustache +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} typealias EncodeResult = (data: Data?, error: Error?) - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encode(_ value: T) -> EncodeResult where T : Encodable { - var returnedData: Data? - var returnedError: Error? = nil - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/Configuration.mustache b/modules/openapi-generator/src/main/resources/swift4/Configuration.mustache deleted file mode 100644 index 84e92d2feed..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Configuration.mustache +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift4/Extensions.mustache deleted file mode 100644 index fa2c51d4964..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Extensions.mustache +++ /dev/null @@ -1,188 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation{{#usePromiseKit}} -import PromiseKit{{/usePromiseKit}} - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - -{{#usePromiseKit}}extension RequestBuilder { - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func execute() -> Promise> { - let deferred = Promise>.pending() - self.execute { (response: Response?, error: Error?) in - if let response = response { - deferred.resolver.fulfill(response) - } else { - deferred.resolver.reject(error!) - } - } - return deferred.promise - } -}{{/usePromiseKit}} diff --git a/modules/openapi-generator/src/main/resources/swift4/JSONEncodableEncoding.mustache b/modules/openapi-generator/src/main/resources/swift4/JSONEncodableEncoding.mustache deleted file mode 100644 index 69636d84635..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/JSONEncodableEncoding.mustache +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/modules/openapi-generator/src/main/resources/swift4/JSONEncodingHelper.mustache b/modules/openapi-generator/src/main/resources/swift4/JSONEncodingHelper.mustache deleted file mode 100644 index 9ba6d2ae1f5..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/JSONEncodingHelper.mustache +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class JSONEncodingHelper { - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/modules/openapi-generator/src/main/resources/swift4/Models.mustache b/modules/openapi-generator/src/main/resources/swift4/Models.mustache deleted file mode 100644 index 62b20a27c32..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Models.mustache +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ErrorResponse : Error { - case error(Int, Data?, Error) -} - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class Response { - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let statusCode: Int - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let header: [String: String] - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let body: T? - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/modules/openapi-generator/src/main/resources/swift4/Package.swift.mustache b/modules/openapi-generator/src/main/resources/swift4/Package.swift.mustache deleted file mode 100644 index 3ca1dfcbfa2..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Package.swift.mustache +++ /dev/null @@ -1,33 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "{{projectName}}", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "{{projectName}}", - targets: ["{{projectName}}"]), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - {{#usePromiseKit}} - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.11.0"), - {{/usePromiseKit}} - {{#useRxSwift}} - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "4.5.0"), - {{/useRxSwift}} - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "{{projectName}}", - dependencies: ["Alamofire"{{#usePromiseKit}}, "PromiseKit"{{/usePromiseKit}}{{#useRxSwift}}, "RxSwift"{{/useRxSwift}}], - path: "{{projectName}}/Classes" - ), - ] -) diff --git a/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache deleted file mode 100644 index 2a9dd2703d3..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Podspec.mustache +++ /dev/null @@ -1,38 +0,0 @@ -Pod::Spec.new do |s| - s.name = '{{projectName}}'{{#projectDescription}} - s.summary = '{{.}}'{{/projectDescription}} - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '{{podVersion}}{{^podVersion}}{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}{{/podVersion}}' - s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}' }{{/podSource}} - {{#podAuthors}} - s.authors = '{{.}}' - {{/podAuthors}} - {{#podSocialMediaURL}} - s.social_media_url = '{{.}}' - {{/podSocialMediaURL}} - {{#podDocsetURL}} - s.docset_url = '{{.}}' - {{/podDocsetURL}} - s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}} - s.homepage = '{{podHomepage}}{{^podHomepage}}https://github.com/OpenAPITools/openapi-generator{{/podHomepage}}' - s.summary = '{{podSummary}}{{^podSummary}}{{projectName}} Swift SDK{{/podSummary}}' - {{#podDescription}} - s.description = '{{.}}' - {{/podDescription}} - {{#podScreenshots}} - s.screenshots = {{& podScreenshots}} - {{/podScreenshots}} - {{#podDocumentationURL}} - s.documentation_url = '{{.}}' - {{/podDocumentationURL}} - s.source_files = '{{projectName}}/Classes/**/*.swift' - {{#usePromiseKit}} - s.dependency 'PromiseKit/CorePromise', '~> 6.11.0' - {{/usePromiseKit}} - {{#useRxSwift}} - s.dependency 'RxSwift', '~> 4.5.0' - {{/useRxSwift}} - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/modules/openapi-generator/src/main/resources/swift4/README.mustache b/modules/openapi-generator/src/main/resources/swift4/README.mustache deleted file mode 100644 index 95f4a63ff29..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/README.mustache +++ /dev/null @@ -1,69 +0,0 @@ -# Swift4 API client for {{{projectName}}} - -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -## Overview -This API client 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 an API client. - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} All endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}## {{{name}}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/swift4/Result.mustache b/modules/openapi-generator/src/main/resources/swift4/Result.mustache deleted file mode 100644 index e4216be5509..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/Result.mustache +++ /dev/null @@ -1,17 +0,0 @@ -// -// Result.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -#if swift(<5) - -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum Result { - case success(Value) - case failure(Error) -} - -#endif diff --git a/modules/openapi-generator/src/main/resources/swift4/XcodeGen.mustache b/modules/openapi-generator/src/main/resources/swift4/XcodeGen.mustache deleted file mode 100644 index 596193cf856..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/XcodeGen.mustache +++ /dev/null @@ -1,17 +0,0 @@ -name: {{projectName}} -targets: - {{projectName}}: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [{{projectName}}] - info: - path: ./Info.plist - version: {{podVersion}}{{^podVersion}}{{#apiInfo}}{{version}}{{/apiInfo}}{{^apiInfo}}}0.0.1{{/apiInfo}}{{/podVersion}} - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire{{#useRxSwift}} - - carthage: RxSwift{{/useRxSwift}}{{#usePromiseKit}} - - carthage: PromiseKit{{/usePromiseKit}} diff --git a/modules/openapi-generator/src/main/resources/swift4/_param.mustache b/modules/openapi-generator/src/main/resources/swift4/_param.mustache deleted file mode 100644 index 770458343aa..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/_param.mustache +++ /dev/null @@ -1 +0,0 @@ -"{{baseName}}": {{paramName}}{{^required}}?{{/required}}.encodeToJSON() \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/api.mustache b/modules/openapi-generator/src/main/resources/swift4/api.mustache deleted file mode 100644 index 99c79f9bd57..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/api.mustache +++ /dev/null @@ -1,216 +0,0 @@ -{{#operations}}// -// {{classname}}.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation{{#usePromiseKit}} -import PromiseKit{{/usePromiseKit}}{{#useRxSwift}} -import RxSwift{{/useRxSwift}} - -{{#swiftUseApiNamespace}} -extension {{projectName}}API { -{{/swiftUseApiNamespace}} - -{{#description}} -/** {{.}} */{{/description}} -{{#objcCompatible}}@objc {{/objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{classname}}{{#objcCompatible}} : NSObject{{/objcCompatible}} { -{{#operation}} - {{#allParams}} - {{#isEnum}} - /** - * enum for parameter {{paramName}} - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}} { - {{#allowableValues}} - {{#enumVars}} - case {{name}} = {{{value}}} - {{/enumVars}} - {{/allowableValues}} - } - - {{/isEnum}} - {{/allParams}} -{{^usePromiseKit}} -{{^useRxSwift}} - /** - {{#summary}} - {{{.}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - parameter completion: completion handler to receive the data and the error objects - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?,_ error: Error?) -> Void)) { - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute { (response, error) -> Void in - {{#returnType}} - completion(response?.body, error) - {{/returnType}} - {{^returnType}} - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - {{/returnType}} - } - } -{{/useRxSwift}} -{{/usePromiseKit}} -{{#usePromiseKit}} - /** - {{#summary}} - {{{.}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - returns: Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { - let deferred = Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}>.pending() - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) -{{#returnType}} - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() -{{/returnType}} -{{^returnType}} - } else { - deferred.resolver.fulfill(()) -{{/returnType}} - } - } - return deferred.promise - } -{{/usePromiseKit}} -{{#useRxSwift}} - /** - {{#summary}} - {{{.}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - returns: Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { - return Observable.create { observer -> Disposable in - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) -{{#returnType}} - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() -{{/returnType}} -{{^returnType}} - } else { - observer.onNext(()) -{{/returnType}} - } - observer.onCompleted() - } - return Disposables.create() - } - } -{{/useRxSwift}} -{{#useResult}} - /** - {{#summary}} - {{{.}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - parameter completion: completion handler to receive the result - */ - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping ((_ result: Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error>) -> Void)) { - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - {{#returnType}} - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - {{/returnType}} - {{^returnType}} - } else { - completion(.success(())) - } - {{/returnType}} - } - } -{{/useResult}} - - /** - {{#summary}} - {{{.}}} - {{/summary}} - - {{httpMethod}} {{{path}}}{{#notes}} - - {{{.}}}{{/notes}}{{#subresourceOperation}} - - subresourceOperation: {{.}}{{/subresourceOperation}}{{#defaultResponse}} - - defaultResponse: {{.}}{{/defaultResponse}} - {{#authMethods}} - - {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}: - - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}} - - name: {{name}} - {{/authMethods}} - {{#hasResponseHeaders}} - - responseHeaders: [{{#responseHeaders}}{{{baseName}}}({{{dataType}}}){{^-last}}, {{/-last}}{{/responseHeaders}}] - {{/hasResponseHeaders}} - {{#externalDocs}} - - externalDocs: {{.}} - {{/externalDocs}} - {{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}} - - returns: RequestBuilder<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{description}} - */ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> RequestBuilder<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { - {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{#-first}}var{{/-first}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} - let {{paramName}}PreEscape = "\({{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}APIHelper.mapValueToPathItem({{paramName}}){{/isEnum}})" - let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}} - let URLString = {{projectName}}API.basePath + path - {{#bodyParam}} - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: {{paramName}}) - {{/bodyParam}} - {{^bodyParam}} - {{#hasFormParams}} - let formParams: [String:Any?] = [ - {{#formParams}} - {{> _param}}{{^-last}},{{/-last}} - {{/formParams}} - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - {{/hasFormParams}} - {{^hasFormParams}} - let parameters: [String:Any]? = nil - {{/hasFormParams}} - {{/bodyParam}}{{#hasQueryParams}} - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([{{^queryParams}}:{{/queryParams}} - {{#queryParams}} - {{> _param}}{{^-last}}, {{/-last}} - {{/queryParams}} - ]){{/hasQueryParams}}{{^hasQueryParams}} - let url = URLComponents(string: URLString){{/hasQueryParams}}{{#headerParams}}{{#-first}} - let nillableHeaders: [String: Any?] = [{{/-first}} - {{> _param}}{{^-last}},{{/-last}}{{#-last}} - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders){{/-last}}{{/headerParams}} - - let requestBuilder: RequestBuilder<{{{returnType}}}{{^returnType}}Void{{/returnType}}>.Type = {{projectName}}API.requestBuilderFactory.{{#returnType}}getBuilder(){{/returnType}}{{^returnType}}getNonDecodableBuilder(){{/returnType}} - - return requestBuilder.init(method: "{{httpMethod}}", URLString: (url?.string ?? URLString), parameters: parameters, isBody: {{hasBodyParam}}{{#headerParams}}{{#-first}}, headers: headerParameters{{/-first}}{{/headerParams}}) - } - -{{/operation}} -} -{{#swiftUseApiNamespace}} -} -{{/swiftUseApiNamespace}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/swift4/api_doc.mustache b/modules/openapi-generator/src/main/resources/swift4/api_doc.mustache deleted file mode 100644 index c634111c699..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/api_doc.mustache +++ /dev/null @@ -1,97 +0,0 @@ -# {{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{{basePath}}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} -# **{{{operationId}}}** -```swift -{{^usePromiseKit}} -{{^useRxSwift}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping (_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void) -{{/useRxSwift}} -{{/usePromiseKit}} -{{#usePromiseKit}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> -{{/usePromiseKit}} -{{#useRxSwift}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> -{{/useRxSwift}} -``` - -{{{summary}}}{{#notes}} - -{{{.}}}{{/notes}} - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import {{{projectName}}} - -{{#allParams}}let {{paramName}} = {{{vendorExtensions.x-swift-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -{{/allParams}} - -{{^usePromiseKit}} -{{^useRxSwift}} -{{#summary}} -// {{{.}}} -{{/summary}} -{{classname}}.{{{operationId}}}({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -{{/useRxSwift}} -{{/usePromiseKit}} -{{#usePromiseKit}} -{{#summary}} -// {{{.}}} -{{/summary}} -{{classname}}.{{{operationId}}}({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -{{/usePromiseKit}} -{{#useRxSwift}} -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -{{/useRxSwift}} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}Void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache deleted file mode 100755 index 0e3776ae6dd..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/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-petstore-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="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - 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/modules/openapi-generator/src/main/resources/swift4/gitignore.mustache b/modules/openapi-generator/src/main/resources/swift4/gitignore.mustache deleted file mode 100644 index fc4e330f8fa..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/gitignore.mustache +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/modules/openapi-generator/src/main/resources/swift4/model.mustache b/modules/openapi-generator/src/main/resources/swift4/model.mustache deleted file mode 100644 index a47acfb01ef..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/model.mustache +++ /dev/null @@ -1,24 +0,0 @@ -{{#models}}{{#model}}// -// {{classname}}.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#description}} -/** {{.}} */{{/description}} -{{#isArray}} -{{> modelArray}} -{{/isArray}} -{{^isArray}} -{{#isEnum}} -{{> modelEnum}} -{{/isEnum}} -{{^isEnum}} -{{> modelObject}} -{{/isEnum}} -{{/isArray}} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/swift4/modelArray.mustache b/modules/openapi-generator/src/main/resources/swift4/modelArray.mustache deleted file mode 100644 index 536c5e9eea4..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/modelArray.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} typealias {{classname}} = {{parent}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/modelEnum.mustache b/modules/openapi-generator/src/main/resources/swift4/modelEnum.mustache deleted file mode 100644 index 4a28e656e2d..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/modelEnum.mustache +++ /dev/null @@ -1,7 +0,0 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, Codable { -{{#allowableValues}} -{{#enumVars}} - case {{name}} = {{{value}}} -{{/enumVars}} -{{/allowableValues}} -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/modelInlineEnumDeclaration.mustache b/modules/openapi-generator/src/main/resources/swift4/modelInlineEnumDeclaration.mustache deleted file mode 100644 index e7fed7d16ea..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/modelInlineEnumDeclaration.mustache +++ /dev/null @@ -1,7 +0,0 @@ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { - {{#allowableValues}} - {{#enumVars}} - case {{name}} = {{{value}}} - {{/enumVars}} - {{/allowableValues}} - } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache deleted file mode 100644 index 41c0245ca7f..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache +++ /dev/null @@ -1,81 +0,0 @@ -{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct {{classname}}: Codable { {{/objcCompatible}} -{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable { {{/objcCompatible}} - -{{#allVars}} -{{#isEnum}} -{{> modelInlineEnumDeclaration}} -{{/isEnum}} -{{/allVars}} -{{#allVars}} -{{#isEnum}} - {{#description}}/** {{.}} */ - {{/description}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var {{name}}: {{{datatypeWithEnum}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{.}}}{{/defaultValue}} -{{/isEnum}} -{{^isEnum}} - {{#description}}/** {{.}} */ - {{/description}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var {{name}}: {{{datatype}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var {{name}}Num: NSNumber? { - get { - return {{name}} as NSNumber? - } - }{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}} -{{/isEnum}} -{{/allVars}} - -{{#hasVars}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{^-last}}, {{/-last}}{{/allVars}}) { - {{#allVars}} - self.{{name}} = {{name}} - {{/allVars}} - } -{{/hasVars}} -{{#additionalPropertiesType}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var additionalProperties: [String:{{{additionalPropertiesType}}}] = [:] - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} subscript(key: String) -> {{{additionalPropertiesType}}}? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - {{#allVars}} - try container.encode{{#unwrapRequired}}IfPresent{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}IfPresent{{/required}}{{/unwrapRequired}}({{{name}}}, forKey: "{{{baseName}}}") - {{/allVars}} - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}}{{#objcCompatible}} required{{/objcCompatible}} init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - {{#allVars}} - {{name}} = try container.decode{{#unwrapRequired}}IfPresent{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}IfPresent{{/required}}{{/unwrapRequired}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") - {{/allVars}} - var nonAdditionalPropertyKeys = Set() - {{#allVars}} - nonAdditionalPropertyKeys.insert("{{{baseName}}}") - {{/allVars}} - additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) - } - -{{/additionalPropertiesType}} -{{^additionalPropertiesType}}{{#vendorExtensions.x-codegen-has-escaped-property-names}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum CodingKeys: String, CodingKey { {{#allVars}} - case {{name}}{{#vendorExtensions.x-codegen-escaped-property-name}} = "{{{baseName}}}"{{/vendorExtensions.x-codegen-escaped-property-name}}{{/allVars}} - } -{{/vendorExtensions.x-codegen-has-escaped-property-names}}{{/additionalPropertiesType}} -} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift4/model_doc.mustache b/modules/openapi-generator/src/main/resources/swift4/model_doc.mustache deleted file mode 100644 index d3e4ecf5c76..00000000000 --- a/modules/openapi-generator/src/main/resources/swift4/model_doc.mustache +++ /dev/null @@ -1,11 +0,0 @@ -{{#models}}{{#model}}# {{classname}} - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isContainer}}[**{{dataType}}**]({{complexType}}.md){{/isContainer}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -{{/model}}{{/models}} From 3ed6343933a27b8069e52f0bdf795b278f37a066 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 30 Jan 2022 15:57:02 +0800 Subject: [PATCH 113/113] remove deprecated options in java client generator (#11456) --- docs/generators/java.md | 6 +- .../codegen/languages/JavaClientCodegen.java | 76 +++---------------- .../libraries/retrofit2/ApiClient.mustache | 6 -- .../Java/libraries/retrofit2/api.mustache | 7 +- .../libraries/retrofit2/build.gradle.mustache | 20 ----- .../libraries/retrofit2/build.sbt.mustache | 12 --- .../libraries/retrofit2/play26/api.mustache | 9 ++- .../Java/libraries/retrofit2/pom.mustache | 39 ---------- .../client/api/AnotherFakeApi.java | 2 - .../org/openapitools/client/api/FakeApi.java | 2 - .../client/api/FakeClassnameTags123Api.java | 2 - .../org/openapitools/client/api/PetApi.java | 2 - .../org/openapitools/client/api/StoreApi.java | 2 - .../org/openapitools/client/api/UserApi.java | 2 - 14 files changed, 21 insertions(+), 166 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 4132f755c12..c33081e2df5 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -62,7 +62,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |performBeanValidation|Perform BeanValidation| |false| -|playVersion|Version of Play! Framework (possible values "play24" (Deprecated), "play25" (Deprecated), "play26" (Default))| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| @@ -81,9 +80,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |usePlayWS|Use Play! Async HTTP client (Play WS API)| |false| |useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false| |useRuntimeException|Use RuntimeException instead of Exception| |false| -|useRxJava|Whether to use the RxJava adapter with the retrofit2 library. IMPORTANT: this option has been deprecated and will be removed in the 5.x release.| |false| -|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false| -|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library.| |false| +|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false| +|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING 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 22bfafcfdaa..8476e2d88b7 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 @@ -49,12 +49,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen private final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); - public static final String USE_RX_JAVA = "useRxJava"; public static final String USE_RX_JAVA2 = "useRxJava2"; public static final String USE_RX_JAVA3 = "useRxJava3"; public static final String DO_NOT_USE_RX = "doNotUseRx"; public static final String USE_PLAY_WS = "usePlayWS"; - public static final String PLAY_VERSION = "playVersion"; public static final String ASYNC_NATIVE = "asyncNative"; public static final String CONFIG_KEY = "configKey"; public static final String PARCELABLE_MODEL = "parcelableModel"; @@ -69,10 +67,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String ERROR_OBJECT_TYPE= "errorObjectType"; public static final String ERROR_OBJECT_SUBTYPE= "errorObjectSubtype"; - public static final String PLAY_24 = "play24"; - public static final String PLAY_25 = "play25"; - public static final String PLAY_26 = "play26"; - public static final String MICROPROFILE_DEFAULT = "default"; public static final String MICROPROFILE_KUMULUZEE = "kumuluzee"; @@ -104,7 +98,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen // (mustache does not allow for boolean operators so we need this extra field) protected boolean doNotUseRx = true; protected boolean usePlayWS = false; - protected String playVersion = PLAY_26; protected String microprofileFramework = MICROPROFILE_DEFAULT; protected String configKey = null; @@ -149,12 +142,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen modelTestTemplateFiles.put("model_test.mustache", ".java"); - cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library. IMPORTANT: this option has been deprecated and will be removed in the 5.x release.")); - cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library.")); - cliOptions.add(CliOption.newBoolean(USE_RX_JAVA3, "Whether to use the RxJava3 adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.")); + cliOptions.add(CliOption.newBoolean(USE_RX_JAVA3, "Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.")); cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.")); cliOptions.add(CliOption.newBoolean(USE_PLAY_WS, "Use Play! Async HTTP client (Play WS API)")); - cliOptions.add(CliOption.newString(PLAY_VERSION, "Version of Play! Framework (possible values \"play24\" (Deprecated), \"play25\" (Deprecated), \"play26\" (Default))")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation")); cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests")); @@ -241,23 +232,14 @@ public class JavaClientCodegen extends AbstractJavaCodegen super.processOpts(); // RxJava - if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) { - LOGGER.warn("You specified all RxJava versions 1, 2 and 3 but they are mutually exclusive. Defaulting to v3."); + if (additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) { + LOGGER.warn("You specified all RxJava versions 2 and 3 but they are mutually exclusive. Defaulting to v3."); this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString())); } else { - if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) { - LOGGER.warn("You specified both RxJava versions 1 and 2 but they are mutually exclusive. Defaulting to v2."); - this.setUseRxJava2(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA2).toString())); - } else if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA3)) { - LOGGER.warn("You specified both RxJava versions 1 and 3 but they are mutually exclusive. Defaulting to v3."); - this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString())); - } else if (additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) { + if (additionalProperties.containsKey(USE_RX_JAVA2) && additionalProperties.containsKey(USE_RX_JAVA3)) { LOGGER.warn("You specified both RxJava versions 2 and 3 but they are mutually exclusive. Defaulting to v3."); this.setUseRxJava3(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA3).toString())); } else { - if (additionalProperties.containsKey(USE_RX_JAVA)) { - this.setUseRxJava(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA).toString())); - } if (additionalProperties.containsKey(USE_RX_JAVA2)) { this.setUseRxJava2(Boolean.parseBoolean(additionalProperties.get(USE_RX_JAVA2).toString())); } @@ -277,11 +259,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen } additionalProperties.put(USE_PLAY_WS, usePlayWS); - if (additionalProperties.containsKey(PLAY_VERSION)) { - this.setPlayVersion(additionalProperties.get(PLAY_VERSION).toString()); - } - additionalProperties.put(PLAY_VERSION, playVersion); - // Microprofile framework if (additionalProperties.containsKey(MICROPROFILE_FRAMEWORK)) { if (!MICROPROFILE_KUMULUZEE.equals(microprofileFramework)) { @@ -560,40 +537,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen } apiTemplateFiles.remove("api.mustache"); + apiTemplateFiles.put("play26/api.mustache", ".java"); - if (PLAY_24.equals(playVersion)) { - LOGGER.warn("`play24` option has been deprecated and will be removed in the 5.x release. Please use `play26` instead."); - additionalProperties.put(PLAY_24, true); - apiTemplateFiles.put("play24/api.mustache", ".java"); - - supportingFiles.add(new SupportingFile("play24/ApiClient.mustache", invokerFolder, "ApiClient.java")); - supportingFiles.add(new SupportingFile("play24/Play24CallFactory.mustache", invokerFolder, "Play24CallFactory.java")); - supportingFiles.add(new SupportingFile("play24/Play24CallAdapterFactory.mustache", invokerFolder, - "Play24CallAdapterFactory.java")); - } - - if (PLAY_25.equals(playVersion)) { - LOGGER.warn("`play25` option has been deprecated and will be removed in the 5.x release. Please use `play26` instead."); - additionalProperties.put(PLAY_25, true); - apiTemplateFiles.put("play25/api.mustache", ".java"); - - supportingFiles.add(new SupportingFile("play25/ApiClient.mustache", invokerFolder, "ApiClient.java")); - supportingFiles.add(new SupportingFile("play25/Play25CallFactory.mustache", invokerFolder, "Play25CallFactory.java")); - supportingFiles.add(new SupportingFile("play25/Play25CallAdapterFactory.mustache", invokerFolder, - "Play25CallAdapterFactory.java")); - setJava8ModeAndAdditionalProperties(true); - } - - if (PLAY_26.equals(playVersion)) { - additionalProperties.put(PLAY_26, true); - apiTemplateFiles.put("play26/api.mustache", ".java"); - - supportingFiles.add(new SupportingFile("play26/ApiClient.mustache", invokerFolder, "ApiClient.java")); - supportingFiles.add(new SupportingFile("play26/Play26CallFactory.mustache", invokerFolder, "Play26CallFactory.java")); - supportingFiles.add(new SupportingFile("play26/Play26CallAdapterFactory.mustache", invokerFolder, - "Play26CallAdapterFactory.java")); - setJava8ModeAndAdditionalProperties(true); - } + supportingFiles.add(new SupportingFile("play26/ApiClient.mustache", invokerFolder, "ApiClient.java")); + supportingFiles.add(new SupportingFile("play26/Play26CallFactory.mustache", invokerFolder, "Play26CallFactory.java")); + supportingFiles.add(new SupportingFile("play26/Play26CallAdapterFactory.mustache", invokerFolder, + "Play26CallAdapterFactory.java")); + setJava8ModeAndAdditionalProperties(true); supportingFiles.add(new SupportingFile("play-common/auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java")); supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java")); @@ -989,10 +939,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen this.usePlayWS = usePlayWS; } - public void setPlayVersion(String playVersion) { - this.playVersion = playVersion; - } - public void setAsyncNative(boolean asyncNative) { this.asyncNative = asyncNative; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 1196f2c1372..57c97726344 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -19,9 +19,6 @@ import org.threeten.bp.format.DateTimeFormatter; {{/threetenbp}} import retrofit2.Converter; import retrofit2.Retrofit; -{{#useRxJava}} -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; -{{/useRxJava}} {{#useRxJava2}} import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; {{/useRxJava2}} @@ -157,9 +154,6 @@ public class ApiClient { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) - {{#useRxJava}} - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) - {{/useRxJava}} {{#useRxJava2}} .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) {{/useRxJava2}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache index dd199a5e108..82c3fe068c8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -2,9 +2,6 @@ package {{package}}; import {{invokerPackage}}.CollectionFormats.*; -{{#useRxJava}} -import rx.Observable; -{{/useRxJava}} {{#useRxJava2}} import io.reactivex.Observable; {{/useRxJava2}} @@ -47,7 +44,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @return {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -74,7 +71,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}} + {{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 35a63779f64..a5c716b18d6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -118,21 +118,10 @@ ext { jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#play24}} - play_version = "2.4.11" - {{/play24}} - {{#play25}} - play_version = "2.5.14" - {{/play25}} - {{#play26}} play_version = "2.6.7" - {{/play26}} {{/usePlayWS}} swagger_annotations_version = "1.5.22" junit_version = "4.13.1" - {{#useRxJava}} - rx_java_version = "1.3.0" - {{/useRxJava}} {{#useRxJava2}} rx_java_version = "2.1.1" {{/useRxJava2}} @@ -152,10 +141,6 @@ dependencies { implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-scalars:$retrofit_version" implementation "com.squareup.retrofit2:converter-gson:$retrofit_version" - {{#useRxJava}} - implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" - implementation "io.reactivex:rxjava:$rx_java_version" - {{/useRxJava}} {{#useRxJava2}} implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' implementation "io.reactivex.rxjava2:rxjava:$rx_java_version" @@ -177,13 +162,8 @@ dependencies { implementation "org.threeten:threetenbp:$threetenbp_version" {{/threetenbp}} {{#usePlayWS}} - {{#play26}} implementation "com.typesafe.play:play-ahc-ws_2.12:$play_version" implementation "jakarta.validation:jakarta.validation-api:2.0.2" - {{/play26}} - {{^play26}} - implementation "com.typesafe.play:play-java-ws_2.11:$play_version" - {{/play26}} implementation "com.squareup.retrofit2:converter-jackson:$retrofit_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index d859cf83d24..a572f4b93e2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -15,25 +15,13 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", {{/usePlayWS}} {{#usePlayWS}} - {{#play24}} - "com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile", - {{/play24}} - {{#play25}} - "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - {{/play25}} - {{#play26}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", - {{/play26}} "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", {{/usePlayWS}} - {{#useRxJava}} - "com.squareup.retrofit2" % "adapter-rxjava" % "2.3.0" % "compile", - "io.reactivex" % "rxjava" % "1.3.0" % "compile", - {{/useRxJava}} {{#useRxJava2}} "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache index d4e97cc347b..dd3339ff840 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache @@ -2,9 +2,12 @@ package {{package}}; import {{invokerPackage}}.CollectionFormats.*; -{{#useRxJava}}import rx.Observable;{{/useRxJava}} -{{#useRxJava2}}import io.reactivex.Observable;{{/useRxJava2}} -{{#doNotUseRx}}import retrofit2.Call;{{/doNotUseRx}} +{{#useRxJava2}} +import io.reactivex.Observable; +{{/useRxJava2}} +{{#doNotUseRx}} +import retrofit2.Call; +{{/doNotUseRx}} import retrofit2.http.*; import okhttp3.RequestBody; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 39da1fd02e8..5c000617145 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -273,18 +273,6 @@ ${threetenbp-version} {{/threetenbp}} - {{#useRxJava}} - - io.reactivex - rxjava - ${rxjava-version} - - - com.squareup.retrofit2 - adapter-rxjava - ${retrofit-version} - - {{/useRxJava}} {{#useRxJava2}} io.reactivex.rxjava2 @@ -351,21 +339,6 @@ ${jackson-version} {{/withXml}} - {{#play24}} - - com.typesafe.play - play-java-ws_2.11 - ${play-version} - - {{/play24}} - {{#play25}} - - com.typesafe.play - play-java-ws_2.11 - ${play-version} - - {{/play25}} - {{#play26}} com.typesafe.play play-ahc-ws_2.12 @@ -376,7 +349,6 @@ jakarta.validation-api ${beanvalidation-version} - {{/play26}} {{/usePlayWS}} {{#parcelableModel}} @@ -410,23 +382,12 @@ 1.6.3 {{#usePlayWS}} 2.12.1 - {{#play24}} - 2.4.11 - {{/play24}} - {{#play25}} - 2.5.15 - {{/play25}} - {{#play26}} 2.6.7 - {{/play26}} {{#openApiNullable}} 0.2.2 {{/openApiNullable}} {{/usePlayWS}} 2.5.0 - {{#useRxJava}} - 1.3.0 - {{/useRxJava}} {{#useRxJava2}} 2.1.1 {{/useRxJava2}} diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index b638ac67690..4a546e53849 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -2,8 +2,6 @@ package org.openapitools.client.api; import org.openapitools.client.CollectionFormats.*; - - import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index 29c894d5661..e87dcd696da 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -2,8 +2,6 @@ package org.openapitools.client.api; import org.openapitools.client.CollectionFormats.*; - - import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index e4f16e34fd7..af53baad6ab 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -2,8 +2,6 @@ package org.openapitools.client.api; import org.openapitools.client.CollectionFormats.*; - - import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java index 96f8dacd1e0..ecc66db936a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,8 +2,6 @@ package org.openapitools.client.api; import org.openapitools.client.CollectionFormats.*; - - import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/StoreApi.java index 798245fd983..b9ccc8cff46 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,8 +2,6 @@ package org.openapitools.client.api; import org.openapitools.client.CollectionFormats.*; - - import retrofit2.Call; import retrofit2.http.*; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java index c568e477b92..2aed903655b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,8 +2,6 @@ package org.openapitools.client.api; import org.openapitools.client.CollectionFormats.*; - - import retrofit2.Call; import retrofit2.http.*;